Setting Up VirtualBox on Arch Linux
By VictorG
VirtualBox is a special type of Virtualization software that lets you run another Operating Systems within your current Operating System. That is to say, if you are running Linux, you could use VirtualBox to run Windows XP, within Linux.
This can come in very handy, especially if you are a web developer, as you can use it to run multiple versions of Windows, OSX, and Linux, without having to have a separate hard drive or even restarting your computer.
Using VirtualBox with Arch Linux is very easy, however it is now owned by Oracle, who has been strategically dismantling Sun's Assets. So, it is probably only a matter of time until they decide to offer some sort of enterprise VirtualBox package. With that said, the other open-source Virtualization Packages available for Linux do not currently(8/31/2010) offer USB support.
Installing VirtualBox Manually
While VirtualBox is available in the Arch Linux Repositories, but I typically download and install it directly from the VirtualBox website.
- First, Download the correct version of VirtualBox for your system. There is no Arch Specific version, so you can choose the “All distributions” option at the bottom, which is available in AMD64 or i386.
- Open a terminal and navigate to the directory that you downloaded the VirtualBox Package
- As Root, use the command "sh VirtualBox.run"
- Keep in mind the name "VirtualBox.run" will vary, depending on the package/architecture you use.
- VirtualBox should be installed now and you should be able to use the Command “VirtualBox” to start the program. If you are using Gnome as your Desktop Manager, there is also a link under Applications → System Tools
Setting Up USB
While the initial installation should get you up and running quickly, you will still need to make a few more changes to get USB working.
- Add Your User to the group called vboxusers by issuing the following command: gpasswd -a your_user_name vboxusers (Except replace your_user_name with the name of your user)
- Next, issue the command “grep vboxusers /etc/group” this should print out the group number of the vboxusers group.
- Using the group number, add the following line to your /etc/fstab file: none /proc/bus/usb usbfs auto,busgid=###,busmode=0775,devgid=108,devmode=0664 0 0
- Replace the “###” above with the group number from step 2.
- Run the command “mount -a” or restart your computer to reload your /etc/fstab file
Getting Started
Hopefully, with those changes you will be up and running. One of the first things you may want to do is setup a new virtual machine.
- Run the command VirtualBox to open the GUI
- Click on “New” to start the New Virtual Machine Wizard.
- The process is fairly straightforward and allows you to choose the desired Operating System, as well as set memory, and create a hard drive.
- Once the machine is setup, click on “Settings” to change things like the number of processors or increase your video memory.
- Select the Virtual Machine and click “Start”
- You can mount a disc, such as a windows install disc, by going to: Devices → CD/DVD Devices
Copying a Virtual Box Hard Drive
Once you get your Virtual Machine setup, you might decide that you want to make a copy of the hard drive, however you can not just copy it like a regular file. Instead, you must use the “VboxManage” tool.
- Open a terminal and navigate to the folder that has the Virtual Machine Hard Drive, the default location is in your home folder: ~/.VirtualBox/HardDisks
- Run the Command, VboxManage clonevdi your_old_hard_drive.vdi ~/new_hard_drive.vdi
- Where “your_old_hard_drive.vdi” is the name of the original hard drive and “new_hard_drive.vdi” is the name of the copy
- You must use the full path for the copy and it can not be in the same folder as the original. So, in the above example, it is placed in the root of your home folder.
Getting Help
There is a much more in depth Arch Virtual Box Wiki Article that offers some troubleshooting and explains the installation process in much more detail. Many of the questions have also been answered already on the Arch Forums, so make sure you do some searching before you ask for help! While arguably not the best for a development solution, like website hosting, arch is a very fun Linux Distribution with a great community!