If you’re upgrading from the version of VirtualBox you get from Ubuntu 8.04’s repository to the latest version from Sun, there are a few issues that could trip you up. I was doing this recently in order to run the latest Ubuntu alpha releases in a virtual machine, more on that in the second half of this post.
VirtualBox 1.6 adds seamless windowing for Linux guests, virtual SATA hard disks, PAE support (lets you boot Ubuntu server kernels), and better support for newer guests OSs.
Since Sun Microsystems purchased the company behind VirtualBox, they are now providing packages for Ubuntu 8.04 through their website. If you have an older VirtualBox installed from the Ubuntu repositories, installing Sun’s package will fail.
The first problem is that because Ubuntu’s package has a different name,
virtualbox-ose instead of
virtualbox, APT doesn’t know to replace the older
package with the new one. APT is smart enough to see that there is a conflict
and will give a
virtualbox-ose conflicts with virtualbox error.
Removing the virtualbox-ose package will fix this:
sudo apt-get remove virtualbox-ose
The second problem is that Ubuntu provides some other VirtualBox packages that will also conflict. You may see an error similar to this:
trying to overwrite `/lib/modules/2.6.24-18-generic/misc/vboxdrv.ko', which is also in package virtualbox-ose-modules-2.6.24-18-generic
This can be solved by removing all of the VirtualBox modules packages. If you’ve had VirtualBox installed for awhile, you’ll have one of these packages for each kernel update you’ve received. This command will remove them all:
sudo apt-get remove virtualbox-ose-modules-2.6.24-*
Now try and install Sun’s package:
sudo dpkg -i virtualbox_1.6.4-33808_Ubuntu_hardy_i386.deb
Hopefully the install was successful that time!
The next time you start VirtualBox it will ask you before upgrading your VM settings files for the new version.
If you’ve installed KVM, you may run into another issue when trying to run a VM.
I got the
VirtualBox can't operate in VMX root mode. error until I uninstalled
kvm. My guess is that KVM is running in the background with the
kernel and is doing things with my CPU’s hardware virtualization support that
conflicts with VirtualBox 1.6.
The reason I upgraded to the latest version of VirtualBox is that I’ve been wanting to virtualize the Ubuntu 8.10 Alpha releases, none of which I have been able to boot due to a kernel panic.
The only workaround at the moment is to run the VM with the latest versions of VirtualBox and with VT-x/AMD-V hardware acceleration enabled. This requires that you have a supported CPU, and that this support is enabled in your BIOS (it was turned off by default on my PC). If running this command produces output, you’re ready to go:
egrep '(vmx|svm)' /proc/cpuinfo
Open the settings for your VM and select the
Advanced tab. Select the
VT-x/AMD-V option. Be careful, there are actually three states for that check
box. If the check appears gray, click it again to make it black.
This should allow you to boot the Ubuntu 8.10 Alphas and use them without further trouble. This worked for me with the Alpha 3 desktop CD, I was able to complete the installation and the installed system also works fine.