Article submitted by Tomas Pospisek. Please help DPOTD by submitting good articles about software you like!
VirtualBox is a piece of software that uses virtualisation to simulate a PC. With it you can run Windows, Open BSD or even Linux from your Debian system. Since it also runs on Windows and Mac OS, you can use it to run Debian from that other non-free OS. Note however that it only works on x86 and x86_64 hosts.
You can do all this in a nice and hassle free GUI, driven by menus or application wizards. Here you can see the mentioned "KDE Four Live" CD booted up and ready within VirtualBox.
VirtualBox requires to load its own set of kernel modules and won’t start without them. There is a package providing pre-built modules for the stock kernels in testing, you will need to manually install the correct version for your kernel. If those packages doesn’t suit you, you will need to compile them; the standard Debian way to do this would be:
$ sudo module-assistant prepare virtualbox-ose
$ sudo module-assistant auto-install virtualbox-ose
$ ls /usr/src/virtualbox-ose-modules-*
$ sudo dpkg -i /usr/src/virtualbox-ose-modules-*.deb
That last line will need to be re-written to pick the virtualbox-ose-modules package that corresponds to your kernel.
You’ll also need to add the users that should be allowed to run VirtualBox to the
vboxusers group. I’m adding the current user here:
Now you have to re-login so that your process context picks up the fact that you now belong to then vboxusers group. You can do that by "su"ing into yourself:
$ su `whoami` -
And here you go:
Note for those who like to know how it works: VirtualBox tries to run native code whenever possible, when it’s necessary it uses dynamic recompilation as QEMU does. It also moves guest code intended to run on ring 0 to ring 1, and because of this it doesn’t use the VMX features from the processor too much. See the technical documentation for details.
The virtualbox-ose package is available in Debian testing and unstable, and in Ubuntu since Gutsy (if you’re thinking of upgrading to testing, be sure you are aware of the implications, before doing so!). There’s also a backport to the currently stable Debian "etch" release.