Sunday, November 9, 2008

Vritualbox on Ubuntu - update

VirtualBox Update

We went to run XP under virtualbox and found it was broken. Since we've been using ubuntu on the laptop we installed xp for those times we needed it, which has turned out to be not very much - so far we have not found anything we did on windows that we can't do on ubuntu. Since the summer there have been numerouse updates to the os but we have not run xp...

Anyway when starting up the xp virtual machine we got an error.

"virtualbox kernetl driver not installed.' The vboxdrv kernel module was either not loaded or /dev/vboxdrv was not created for some reason. Please install the virtualbox-ose-modules package for your kernet and execute /etc/init.d/vboxdrv start as root."

So off to the package manager we go to do a search for virtualbox. And we see that in fact we had installed the virtual-box-ose-module so maybe one of the updates broke this. Time to test out starting the vboxdrv module.

Off to Applications, Accessories, Terminal. Since starting the vboxdrv requires root priviledges we will use the sudo command.

barugon:~$ sudo /etc/init.d/vboxdrv start

Which gives us an error message about 'module vboxdrv not found'. Since modprobe (module probe) will not load a module unless it is installed first it looks like vboxdrv is not installed anymore. Should be re-install?

From the virtualbox help, about screen we see that we are using verison 1.5.0 and maybe the vbpxdrv module does not match my current linux kernel. Do we upgrade to 1.6.0 - but will upgrading destroy existing virtual machines? One would think not!

We go to the virtualbox downloads and see that it is at version 2.0.4 so we click to download the i386 version for Ubuntu 7.10 which automatically opens in the gDebi package manager. However, we get an error message: 'conflicts with teh installed package virtualbox-ose'.

Looks like we cannot do this directly. There is a note on the virtualbox web site that ubuntu users need to install the dkms package to ensure that the virtualbox host kernel module (vboxdrv) is properly updated if the linux kernel version changes during upgrades.

It seems likely this is what happened to us. Would have been useful it when installing virtualbox on ubunutu the package saw dkms as a 'dependency' and installed it. Will it work retroactively or do we have to remove the current version of virtualbox and reinstall the xp vm?

Back to the package manager to search for dkms which turns out to be the dynamic kernel module support framework and it was not installed. So we install it.

Now we retry the virtualbox-2.0 package but it gives the same error message. Oh well, let's deleted the existing vm's and remove the existing virtualbox installation and install the version 2 and then show how to install xp in class next week as a demo of a virtual machine installation.

We run virtualbox , select the xp vm and click Delete. We then run the package manager, search for virtualbox and mark the packages for removal.

Back to the virtualbox 2.0 download (just click the downloaded file in the firefox downloads window) and we click Install Package. It notes that "users of virtualbox must be members of the virtualbox group and host network interfaces will be assigned to that group."

A couple of Forwar clicks and the program installs itself.

Now we have to do the administrative tasks. Linux uses a different security model than windows (XP and lower) where everything basically has to have administrative rights. In Linux you can

We go to:

  1. System, administration, users and groups.
  2. Click on Manage Groups
  3. Select vboxusers
  4. Click properties
  5. Ensure the current user has a tick mark
  6. Click OK


One annoying thing it that the install did not add virtualbox to the applications, system menu. This is a long-standing annoyance with many linux installs - they seem to assume you know exactly where it installed...why? There are lots of places programs can install themselves to. Why i don't like the windows installer's habit of strewing icons across your desktop, the better installs ASK if you want an icon added to the menu and/or the desktop. Many linux installs do even do that. Why force people to have to hunt around the system trying to find out where the damn program is located so you can run it?



So how do you run it?

1. Run terminal (Applications, Accessories, Terminal)
2. VirtualBox

Note the capitalization of VirtualBox, you must type it exactly, else it the program will not be found. Linux is case-sensitive (unlike Windows) so that VirtualBox and virtualbox are different programs.

Once the program runs you have to agree to the EULA and register.


Next Step

Create a menu icon for VirtualBox so we don't have to run it from the terminal. But lunch first!



Appendix

Seeing how the version in the ubuntu repository is rather old, because there are two versions of Virtualbox, the open source one (ose) that gets included in distributions, and the more up to date closed version, which does not - so how do you keep up to date with virtualbox updates etc?
You have to add it to your list of repository sources.

Goto: http://www.virtualbox.org/wiki/Linux_Downloads
The easiest way seems to be to copy the following text from the web site and to open a terminal and paste it in:

wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -

To get some pre-built virtual machines for virtualbox goto:

http://virtualbox.wordpress.com/images/

No comments: