VirtualBox OSE Debian install howto

Tested under:

  • GNU/Linux distro: Debian lenny/sid
  • Kernel: 2.6 (2.6.22-3-k7)
  • Architecture: AMD K7 (Athlon XP 1900+)

Prerequisites: make sure you’ve selected both lenny and sid repositories. In your /etc/apt/sources.list you must read something like this:

## Debian Unstable (sid)
deb sid main contrib non-free
deb-src sid main contrib non-free
## Debian Testing (lenny)
deb lenny main contrib non-free
deb-src lenny main contrib non-free

You can also add the Virtual Box repository:

deb etch non-free
deb lenny non-free

But achtung! It’s the Evil Proprietary Version. ๐Ÿ˜‰

In this howto, I install the VirtualBox OSE (Open Source Editon) available in Debian repositories.

  1. # apt-get update (necessary if you changed /etc/apt/sources.list)
  2. # apt-get install virtualbox-ose virtualbox-ose-source virtualbox-ose-modules-2.6-k7 virtualbox-ose-guest-utils virtualbox-ose-guest-source Note: virtualbox Guest Additions should be installed only if you’re running a linux distro within a virtualbox (such a virtual machine is called “guest”)Change virtualbox-ose-modules-2.6-XXX with your architecture (486,686 ecc.). The 486 version is installed by default. This is a meta-package that download the latest version of virtualbox for 2.6 kernel on specified architecture.
  3. After installation, in order to run VirtualBox, you have to plug a kernel module named vboxdrv specific for your kernel. To do this:
    1. # apt-get install module-assistant
    2. # m-a prepare
    3. # m-a a-i virtualbox-ose If you’ve installed the binary version from, specify virtualbox instead virtualbox-ose
    4. # modprobe vboxdrv

    During module-assistant auto-install (m-a a-i) of vboxdrv module, kernel headers of the running kernel are used to create the module. Then modprobe add plug vboxdrv to the running kernel. If something going wrong in this phase, follow the on screen instruction from the module assistant. Make sure you’ve downloaded the right kernel headers (module assistant should automatically do this, i.e. installing linux-headers-2.6.22-3-k7 for linux-image-2.6.22-3-k7), elsewhere module build cannot be completed.

  4. Now you can try to run virtualbox-ose. After you’ve created and run a virtual machine, you can get a message asking you to check dmesg. Open a root shell and type dmesg | grep vbox. The error message ask you to add a kernel command line about NMI watchdog. If it’s your case, do this:
    1. # gedit /boot/grub/menu.lst
    2. Find a line like kopt=... and add, before all, the required command: nmi_watchdog=0 and save. DO NOT uncomment the line, update-grub make the dirty job for you.
    3. # update-grub
    4. Reboot
  5. Reading the dmesg, you find:
    $ dmesg | grep vbox
    vboxdrv: Trying to deactivate the NMI watchdog permanently...
    vboxdrv: Successfully done.

    This meant that NMI issue is solved.

  6. Now you can run successfully the virtual machine. Enjoy virtualization! ๐Ÿ˜‰

After installation:

The vboxusers group
If you want to allow your unprivileged user to use virtualbox, do:
# sudo adduser `whoami` vboxusersAdd to vboxusers group any other user you want to use this.
Install VirtualBox Guest Additions on Guest
If you want to enable some advanced features, like mouse and screen resolution tweaks, you’ve to install VirtualBox Guest Additions in the guest virtual machine. If you run a Windows virtual machine, you can get the precompiled (.exe) installer from this dedicated Google Code projectAfter you reboot guest, VirtualBox enable the advanced functionalities, like seamless mode for mouse pointer and a wide range of resolution and colors for the emulated VM video card.
Update: Well, you can also download Guest Additions from the dropdown menu (Devices) of a running guest. You’ll get a CD image to mount on virtual machine with all the packages you’ve to install.
Note: Virtualbox guest additions on the “host” (real) machine has no effect: if during boot you get the “Not in a virtual machine” error from guest additions, it simply means that your OS run on a host machine, not in a guest one.

See also:

22 responses to “VirtualBox OSE Debian install howto”

  1. Great HowTo .. very compliment ๐Ÿ™‚

    I have a question … after the install … the virtual box is fast or not? ๐Ÿ™‚

    Bye ๐Ÿ™‚

  2. Well, I try a Windows 98 SE and a Windows XP installation, and I found Win98 much more problematic and slowly than XP. A first workaround is to install rain20 on the Windows Machine (as suggested by User FAQ) to send HLT instruction to CPU when idle, but the system remains quite slow.

    I say “problematic” because actually both emulated audio and video cards aren’t supported by Win98, so you I can use it without sound and with 16 colors for windows applications. Guest Additions aren’t yet ported in Win98, so shared folders and screen resolution tuning aren’t allowed, a very limited system.

    Windows XP run smoothly, but if you want to run simple windows programs WINE is the best choice in performance and in freedom. I have some old multimedia encyclopedia Windows CD (bundled with my Pentium 100Mhz :-D) for Windows 95, and when when i want to show it to my niece I haven’t to start a virtual machine. ๐Ÿ˜‰

    If you want to run DOS programs, an emulator like DosBOX or a DOS rewrite like FreeDOS run faster, I suppose.

  3. virtualbox-ose-guest-utils virtualbox-ose-guest-source

    Just to be sure , do you mean if we wanted to run e.g. openSUSE/BSD inside the virtualbox, then the above packages need to be installed?

  4. Hi Mich, the above packages (Guest Additions) should be installed and available on the OS virtual machine (guest), not in the “real” one (host).

    When you get a message like “VirtualBox Additions Disabled, not in a Virtual Machine”, you’re on a host, “real” machine, not in a Virtual one. So you don’t need to install these modules.

  5. Virtualbox, Debian Sid and my AMD64

    There are a lot of virtualization solutions around and a played around with VMware a bit. It’s quite comfortable to use the VMware converter to convert your local Windows installation to a virtual machine.

  6. Hi, i have installed virtualbox-ose with your tutorial, but when i try to run it, this message appears:

    The VirtualBox kernel driver is not accessible to the current user. Make sure that the user has write permissions for /dev/vboxdrv by adding them to the vboxusers groups. You will need to logout for the change to take effect..
    VBox status code: -1909 (VERR_VM_DRIVER_NOT_ACCESSIBLE).

    Cรณdigo Resultado:
    IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}

    I have try with this:

    # sudo adduser ‘jose’ vboxusers

    but the message appears again.

  7. I don’t remember an error like this, but Virtualbox FAQ suggests the following:

    # groups
    [Shows a list of groups for that login name]
    # useradd -g -G ,,…,vboxusers

    You must logout then login again to apply changes.

  8. How can I get the necessary module vboxdrv to automatically load at startup?

  9. +++++++++++++++++++
    # groups
    [Shows a list of groups for that login name]
    # useradd -g -G ,,โ€ฆ,vboxusers

    You must logout then login again to apply changes.


    My question is why should I logout? If the system on which is running is very why should I log out? After added one’s account to the group it can be verified by running id. What exactly does logging out do that can’t be replicated manually to avoid having to log out. It’s absurd to think that on a system which is by “nature” multitasking, I have to stop what I’m doing so that an application can realize that I’m now part of a group.

    Does anyone know what happens on a logout which makes it usable?

  10. Thanks for the excellent instructions. I had independently tried but had some problems with the module. (Virtualbox didn’t seem happy with it. Was asking for some recompilation). After running the module-assistant bit it started working.

    As for badiane’s query when you login the user settings get updated and are fixed for the session. Since you have made a change to the setting you need to logout and login so that the changes get into use.
    There must be a login script which is run for doing this.

%d bloggers like this: