Thursday, January 15, 2009

VirtualBox

I've been recently getting into virtual machines for work and for school. Mainly because I needed a solution to the problem that a lot of Bioinformatic (what I study for those who don't know) programs run on linux machines. I've grown up using windows and still quite a novice at linux as I only really started using it a year ago. Previously, I had a setup a dual boot on my PC running Vista and Ubuntu. However that didn't work so well because I always had to restart my machine just to get into Ubuntu or vice versa.

And thanks to a client who requested I test out some webpages in IE6 which I couldn't because I had Vista which comes with IE7 pre-installed (for those who don't know, you can't downgrade IE7 to IE6). I had to resort to a virtual machine to install windows XP just so I could test out the site in IE6. Frustrating!

Anyways, most virtual wares are quite expensive except for one: Virtualbox which is free! And it is a great piece of software too supporting many host OS and guest OS. I got it installed and setting up my guest OS was a breeze thanks to a very simple wizard.

When installing the Ubuntu guest OS, I took a Ubuntu LiveCD (I had previously burned this) and popped it in and followed the wizard. During the installation it got stuck at 82% saying it was configuring apts for a good like 15 minutes. I thought it had hanged on me, but it finally it got passed it. I noticed the network adapter was running so it was using the internet to search for applications? Not sure what would happen if the network adaptor was disconnected. In any case, it took a while so you should be prepared to wait a while too when installing.

A better idea is to actually download the latest version of Ubuntu as an iso onto your host machine. And then when you first start your guest os it will ask how you want to install it. You can then choose the CD-ROM and mount an image onto and install from there.


After installing, it would be wise to get the "guest additions" as this improves like mouse handling and the resolution. You can this by going to:

Devices ->Install Guest Additions


And then you should use an image on the desktop which means it has been mounted into the CD rom. And then open up a terminal and type:

sudo /media/cdrom/VBoxLinuxAdditions-x86.run


It will do some setup and then once it is done restart the virtual machine and you'll use the changes instantly!

Thank you Virtualbox!

Update:

I've found that when you run the ubuntu update, it will end up nullifying the guest additions. And then when you try to re-install the guest additions, it will complain about linux-headers build-essentials needing to be updated.

The way to solve this: sudo aptitude install build-essential linux-headers-`uname -r`

Where `-uname -r` is the version of the linux kernel. Apparently, you can just enter uname -r and it will enter the linux kernel version number for you. But I couldn't get it to work. So I ended up using entering uname -r in the terminal to get the version number displayed and then manually entering that into the command. So it ended up being something like this:

sudo aptitude install build-essential linux-headers-2.6.11-generic (something like that). And should install everything you need. And then try to re-install your guest additions and it should work.

No comments: