x86 Virtualization with VirtualBox
Whatever your reasons, VirtualBox is the answer. VirtualBox is an advanced x86 (and x86_64) virtualization program and best of all, it's available for free!
And in case you're still not convinced, watch some videos of it in action below.
VirtualBox OSE or CSE?
If you will be using the virtual machine directly (not via another machine on the network), and you don't need to use any USB devices in your guest, then the OSE is enough for you.
If, on the other hand, you want the full set of features that VirtualBox has to offer (and will be using it for personal or evaluation reasons), then go for the full CSE.
Installation instructions below assume Ubuntu 8.04 (Hardy) or 8.10 (Intrepid). Older versions 'may' be supported, but you may run into trouble with advanced features (such as USB) on older platforms.
Installing VirtualBox OSE on Ubuntu
sudo apt-get install virtualbox-ose
sudo apt-get install virtualbox-ose-modules-`uname -r`
The first line will install the VirtualBox core application. The second line will install and build the required kernel modules.
Finally, you need to add yourself to the vboxusers group to give yourself permissions to use VirtualBox:
sudo usermod -Gvboxusers -a `whoami`
You may need to log out and back in before the change of groups will take effect.
That's it! You are now ready to start using VirtualBox.
NOTE: If you have a very new kernel, execution of the second line may fail if virtualbox modules are not yet uploaded for that kernel (see Bug #303199). In this event, execute the following in a terminal to build the modules manually:
sudo apt-get install virtualbox-ose-source module-assistant
sudo module-assistant auto-install virtualbox-ose-source
sudo /etc/init.d/vboxdrv start
Installing VirtualBox CSE on Ubuntu
From the top menu bar, click on System -> Administration -> Synaptic Package Manager. Enter your password when prompted.
Click on Settings -> Repositories. Open the "Third Party Software" tab. Click the "Add" button. The string you paste here depends on which version of Ubuntu you have installed (a full list is available at the VirtualBox download page):
Ubuntu 8.04 Hardy:
deb http://download.virtualbox.org/virtualbox/debian hardy non-free
Ubuntu 8.10 Intrepid:
deb http://download.virtualbox.org/virtualbox/debian intrepid non-free
Once you have pasted the appropriate deb line from above, click on "Add Source".
You should now reload the software list by pressing CTRL+R (or by clicking the reload button on the toolbar, or by selecting Reload from the Edit menu).
Close Synaptec.
Open up a new Terminal (under Applications -> Accessories) and copy/paste the following commands:
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
sudo apt-get install virtualbox-2.1
The first will update the keys used to sign VirtualBox (to ensure that you are getting the actual binary distributed by Sun, and not a trojan), while the second line will actually install VirtualBox.
During VirtualBox installation, you may be prompted to compile the kernel module (select Yes).
Finally, add yourself to the proper group (so that you have the correct permissions):
sudo usermod -Gvboxusers -a `whoami`
You may need to log out and back in before settings will take effect.
Using VirtualBox with an XP Guest
Using VirtualBox: Guest Extensions
Start your XP guest. At the top of the XP Guest window, click on Devices -> Install Guest Extensions from the menubar. This mounts the guest extensions CD image in the CDROM of your XP guest, and an installer should autorun. Click Next a few times, Continue if any dialogs pop-up, and then reboot the XP guest.
Now, we need to mount the shared folders to drives in XP. Open the Network Neighborhood and double click on "Entire Network" then "VirtualBox Shared Folders". If you do not see "Entire Network" listed, click on Tools -> Folder Options, and under Tasks select "Use Windows Classic folders" then click OK.
Right click on each of your shared folders, and click on Map Network Drive. Assign them each a drive letter.
Using VirtualBox: Shared Folders
Make sure you have already installed Guest Extensions above!
Shut down your XP guest. Right-click it in the Machine list, and click "Settings". Click on "Shared Folders" in the list on the left.
Click on the "Add New Shared Folder" icon (the one that looks like a little folder with a green + on it). Under Folder Path select Other and browse to the directory you want to share (your home directory is the default), and click Select then OK.
Repeat this process for any other folders you would like to share, then click OK to exit from the Settings dialog.
Now, we need to mount the shared folders to drives in XP. Start up the XP Guest.
Open the Network Neighborhood and double click on "Entire Network" then "VirtualBox Shared Folders". If you do not see "Entire Network" listed, click on Tools -> Folder Options, and under Tasks select "Use Windows Classic folders" then click OK.
Right click on each of your shared folders, and click on Map Network Drive. Assign them each a drive letter.
Using VirtualBox: USB Pass-through (CSE only!)
The exact process is different for Gutsy and Intrepid, but it's covered in the detail by the Ubuntu Community documentation. Instead of reproducing it here, I now direct you to follow their guide to VirtualBox USB under Ubuntu.
Once you are done, reboot your computer before continuing (remember to bookmark this page!)
Summary
Resources
- VirtualBox Homepage
- Official homepage for VirtualBox
- VirtualBox Documentation
- Official VirtualBox documentation
- VirtualBox Ubuntu Community Documentation
- VirtualBox documentation put together by Ubuntu volunteers.
Reader Feedback
-
Reply
- krypt krypt May 24, 2009 @ 12:07 pm | in reply to kermit524
- I'm happy you've enjoyed the article!
In answer to your question, you do NOT need to modify any of the command lines. The `x` syntax basically means "run x, and insert it's output here". The whoami command outputs the name of the currently signed in user. So `whoami` will automatically be replaced with the right username at execution time :)
-
Reply
- kermit524 kermit524 May 23, 2009 @ 2:24 pm
- Hey, first off I should say that this is the first guide that is actually understandable, of all the guides I have ran into on my way, including sun's own guide. So thanks so much for being so clear in your writing :-). I didn't give it a shot yet, but from here it looks possible to go through the process with no casualties :-). Then, sorry in advance for the silly question, but I am very new to all this. My question is: Is there anywhere in this guide, that i should replace a general part of the command string with my actual username? say, for example - here:
sudo usermod -Gvboxusers -a `whoami`
Does 'whoami' remains 'whoami' in the actual command line, or should I replace it with my actual username so it looks like:
sudo usermod -Gvboxusers -a `myActualUsername`?
Many thanks in advance for your reply,
Michal










