How to get VirtualBox (Oracle VBox VM) running

After installing the VirtualBox software from Oracle start it up. Depending on your distribution and window manager it will be in the “System’ start menu or it may be somewhere else.

Create a new Virtual Machine (e.g. another Linux box with Fedora – select these from the ‘OS Type’ drop-down boxes). You may select an existing virtual disk (.vdi file) or create a new one. If selecting an existing vdi file, try to match the ‘hardware’ of your new VM as best you can with the one that was previously used with this .vdi image or you may run into problems.

When you first start up your newly created VM it may complain about the VBox kernel driver not being installed, in which case it will give you a command line to run (as root) to compile and install the driver. Just copy that command to your terminal window and execute it as root (prepend sudo). If this is the source of the problem you should also see vboxdrv driver fail at kernel startup (on your real, non-virtual PC), so that’s yet another indication that this is the problem.

The command that VirtualBox wants you to execute should look something like /etc/init.d/vboxdrv setup

It may look like it hung at the “Trying to register…” line but just give it time, it will finish. If this procedure fails it most likely means that the installer was unable to find your kernel headers. Use the appropriate for your distribution means to get the kernel-headers package. Below are some examples (all need root permissions):

The suffix i386 may be different on your machine, e.g. if you’re running 64-bit Linux. You can usually omit this suffix and let the package installer figure it out.

Once you got the header the ‘/etc/init.d/vboxdrv setup’ command should work out. Of course, you must have gcc installed on your machine, but that’s kinda assumed.. (what are you doing with a Linux box that’s got no gcc on it anyways? 🙂 )

2 Responses to How to get VirtualBox (Oracle VBox VM) running

Things may often go wrong if you upgrade your kernel or if you are running an older Linux version and you did not bother to constantly upgtrade it and by the time you decide you want to install VB, the latest VB packages has gotten ahead and want to install a newer kernel version (and possibly other stuff as well).

An error which may happen after you have successfully installed Virtual Box and are now booting up one of your virtual machines and which looks like this:
—————————————————
Failed to open a session for the virtual machine WinXP.
Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT).Unknown error creating VM (VERR_SUPLIB_OWNER_NOT_ROOT)
Details: