How to install VirtualBox Virtual Machine for
Windows XP on Ubuntu Linux (11.10)
My beloved sister was complaining games were failing to properly be
played with
wine emulator , therefore I decided to be kind
and help her by installing a Windows XP to run inside a Virtual
Machine. My previous install experiments with
running MS Windows XP on Linux was on Debian using QEMU
virtualmachine emulator.
However as
Qemu is a bit less interactive and slower
virtualmachine for running Windows (though I prefer it for being
completely free software), this time I decided to
install the
Windows OS with Virtualbox.
My hope was using
VirtualBox would be a way easier but I was
wrong... I've faced few troubles and I thought many people who
initially
try to install Virtualbox VM to run Windows on Ubuntu
and other Debian based Linux distros will probably experience
the same problems as mine, so here is how this article was
born.
Here is what I did to
have a VirtualBox OS emulator to run
Windows XP SP2 on Ubuntu 11.10 Linux
1. Install Virtualbox required packages with apt
root@ubuntu:~# apt-get install virtualbox virtualbox-dkms
virtualbox-guest-dkms \
virtualbox-ose-dkms virtualbox-guest-utils
virtualbox-guest-x11
...
If you prefer more GUI or lazy to type commands, the Software
Package Manager can also be used to straight install the same
packages.
virtualbox-dkms virtualbox-guest-dkms packages are the two
which are absolutely necessery in order to
enable VirtualBox to
support installing Microsoft Windows XP.
DKMS modules
are also necessery to be able to emulate some other
proprietary
(non-free) operating systems.
The DKMS packages provide a source for building Vbox guest (OS)
additional kernel modules. They also require the kernel source to
be install otherwise they fail to compile.
Failing to build the DKMS modules will give you error every time
you try to create new VirtualMachine container for installing a
fresh
Windows XP.
The error happens if the two packages do not properly build the
vboxdrv extra Vbox kernel module while the Windows XP
installer is loaded from a CD or ISO. The error to pop up is:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded
or there is a permission problem with /dev/vboxdrv. Please
reinstall the kernel module by executing
To fix the error:
2. Install latest Kernel source that corresponds to your current
kernel version
root@ubuntu:~# apt-get install linux-headers-`uname -r`
...
Next its necessery to rebuild the DKMS modules using
dpkg-reconfigure:
3. Rebuild VirtualBox DKMS deb packages
root@ubuntu:~# dpkg-reconfigure virtualbox-dkms
...
root@ubuntu:~# dpkg-reconfigure virtualbox-guest-dkms
...
root@ubuntu:~# dpkg-reconfigure virtualbox-ose-dkms
...
Hopefully the copilation of
vboxdrv kernel module should
complete succesfully.
To test if all is fine just load the module:
4. Load vboxdrv virtualbox kernel module
root@ubuntu:~# modprobe vboxdrv
root@ubuntu:~#
If you get some error during loading, this means
vboxdrv
failed to properly compile, try read thoroughfully what the error
is and fix it) ;).
As a next step the vboxdrv has to be set to load on every system
boot.
5. Set vboxdrv to load on every Ubuntu boot
root@ubuntu:~# echo 'vboxdrv' >>
/etc/modules
I am not sure if this step is required, it could be
/etc/init.d/virtualbox init script automatically loads the
module, anyways putting it to load on boot would do no harm, so
better do it.
That's all now, you can launch VirtualBox and use the
New
button to initiate a new Virtual Machine, I will skip explaining
how to do the configurations for a Windows XP as most of the
configurations offered by default would simply work without any
tampering.
After booting the
Windows XP installer I simply followed the
usual steps to install Windows and all went smoothly.
Below you see a screenshot showing the
installed Windows XP
Virtualbox saved VM session. The screenshot letters are in
Bulgarian as my sisters default lanaguage for Ubuntu is bulgarian
;)
I hope this article helps someone out there. Please drop me a
comment if you experience any troubles with it. Cya :)