Sunday, August 22, 2010

VirtualBox For Windows 7 and Ubuntu 10.04

So, I decided to investigate setting up a virtual machine so I don't have to constantly reboot as I go between Windows and Linux.
After doing some quick research on all the various options out there (VMWare, VirtualBox, Microsoft Virtual PC,...) I decided to go with Sun VirtualBox.

The setup was fairly easy:
1. You decide a "host OS" that you want to use (in my case it was Windows 7).
2. Download and install VirtualBox from http://www.virtualbox.org/wiki/Downloads
3. Decide on the guest OS (or OSes) you want to install (in my case Ubuntu 10.04)
4. Run the VirtualBox console.
5. Select New Machine - this brings up the wizard.
6. Give it a name and select the operating system type from the dropdown.
7. Browse to the ISO image to install
8. Install the OS.

There is one quirk I've encountered so far - When I run my guest OS (Ubuntu) and try the switch to full screen - I see a full screen, but the actual OS itself, remains in the same size screen. I found the solution to this problem at this link :
This post was particularly useful:
Start the guest
  • Open a terminal window
  • sudo -i press enter
  • apt-get install build-essential
  • apt-get install Linux-headers-generic
Leave the terminal open you are going to need it again.

When this is done the devices tab is at the top left of the guest window (called a VM which stands for virtual machine) then click install guest additions.
This will put a CD on the desktop. Double click to open and then select the guest additions for your machine (see note below) and right click-drag and drop on the terminal window.
Click once in the terminal to get focus and then hit enter. Wait for everything to finish and then reboot the machine. Watch for any errors and if you have any report back here with the exact error message.

Note: Select VBoxLinuxAdditions-amd64.run for 64 bit or VBoxLinuxAdditions-x86.run for 32 bit

After you have the Guest additions installed you use the mouse to adjust the screen to the size you want or you can use the (Host+f) toggle for full screen or the (Host+L) toggle for seamless. The Host key is the right Ctrl key which a MAC does not have so to use this feature you will need to go into the main VirtualBox Program and at the top left click file, then preferences and then input. Click once where it says Right Control and then press the left ctrl key on your MAC keyboard. Close and then start the guest again for this to take effect.