Installing VirtualBox 2 On A Debian Lenny Desktop

Version 1.0
Author: Falko Timme

This tutorial shows how you can install Sun xVM VirtualBox 2 on a Debian Lenny desktop. VirtualBox is available as a package from the official Debian Lenny repository, but it's very old (version 1.6.6), therefore I explain how to install the current version (2.1.4 at the time of this writing). With VirtualBox you can create and run guest operating systems ("virtual machines") such as Linux and Windows under a host operating system. There are two ways of installing VirtualBox: from precompiled binaries that are available for some distributions and come under the PUEL license, and from the sources that are released under the GPL. This article will show how to set up VirtualBox 2 (2.1.4 at the time of this writing) from the precompiled binaries.

As of version 2 VirtualBox supports 32 and 64bit host and guest operating systems (if you want to install 64bit guests your processor must support hardware virtualization and, of course, the host operating system must be 64bit as well).

This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!


Installing VirtualBox From Precompiled Binaries

First, we install the packages gdeb, gedbi, and gdebi-core. Open the Synaptic Package Manager (System > Administration > Synaptic Package Manager):

You can use the search function to find the three packages. Select them for installation and click on Apply. Close Synaptic after the packages have been installed:

Open Firefox and go to For Debian Lenny, click on the i386 or AMD64 link (depending on if you have a 32 or 64 bit host operating system) right of Debian 5.0 ("Lenny"):

In the Firefox download dialogue, select Save File...

... and download the package, e.g. to your desktop (/home/falko/Desktop in this example):

After the download has finished, open a terminal (Applications > Accessories > Terminal)...

... and type


to become root.

Then run

gdebi /home/falko/Desktop/virtualbox-2.1_2.1.4-42893_Debian_lenny_i386.deb

to install VirtualBox (make sure you use the correct path; also the package name can differ, for example if you have downloaded the amd64 version or if there is a newer version - use the TAB key to use autocompletion in the terminal).

During the installation you will see the following message. It says that the user that runs VirtualBox - that's the user you're logged in as on your desktop - must be a member of the vboxusers group:

To add the user falko to the vboxusers group, we run

usermod -G vboxusers -a falko

in the terminal, delete the VirtualBox package...

rm -f /home/falko/Desktop/virtualbox-2.1_2.1.4-42893_Debian_lenny_i386.deb

... and close the terminal afterwards.

To start VirtualBox, go to Applications > System Tools > Sun xVM VirtualBox (if you don't see the VirtualBox launcher, log out of the desktop and back in again):

When you start VirtualBox for the first time, you are prompted to accept its license:

Afterwards, type in your name and email address to register your VirtualBox installation:

Click on OK in the registration confirmation window:

That's it! You can now use VirtualBox to create virtual machines:


Share this page:

Suggested articles

8 Comment(s)

Add comment


By: ramack

I found these steps that will get your USB devices working.

Edit /etc/fstab and add:

none /proc/bus/usb usbfs devgid=XXX,devmode=664 0 0

Change XXX to be a group you are a member of, vboxusers is a natural choice (cat /etc/group | grep vboxusers - use the number there).

By: Dean W. Anneser

There is an easy workaround.  Before starting the virtual machine, define /media as a shared folder.  Then from windows explorer, map a network drive M: (for example) as \\VBOXSRV\media.  You will then be able to access files on the USB memory stick at M:\disk.

I am running VirtualBox 2.1.4 on Debian Lenny.



By: Anonymous

As root:

  1. Add to /etc/apt/sources.list the following line:

    deb lenny non-free

  2.  Install the linux headers package "linux-headers-all" or similar (you do not have this step and if the package is not installed you cannot build the kernel module, which means VB won't start)
  3. Install the key
    wget -q -O- | sudo apt-key add -
  4. apt-get update

    apt-get install virtualbox-2.1


And that's it. No need to install gdebi and similar and of course it is not advisable downloading and installing the package manually when there is a specific repo for debian Lenny...

The steps are described here:

By: miksuh

You don't need to download the Debian package from the Virtualbox's webpage first and then install it. Virtualbox project maintains their own Debian repository and you can install Virtualbox using eg. Synaptic or aptitude. If you use the repository you will also get updates automatically when those are available.

1) Open terminal-window

2) Download Sun public key for secure-apt:

$ wget -q

3) switch to root using command su (give root's password when asked

$ su

4) Add Sun public key to keyring:

# apt-key add sun_vbox.asc

5) Remove key file

# rm sun_vbox.asc

6)  Add Virtualbox repository to the /etc/apt/sources.list

# gedit /etc/apt/sources.list

Add this line to file:

deb lenny non-free

Save file and then close the text editor.

7) Update the package database:

# aptitude update

8) Install Virtualbox 2.1

# aptitude install virtualbox-2.1

9) Add user to vboxusers group, eg:

# adduser miksuh vboxusers

By: Csarlee

Yes, it is true. I installed VBox with this method. But VirtualBox is useful but only if you don't want to connect devices to the guest operating system. I mean a USB stick cannot be seen from the guest.


By: Anonymous

These instructions are outdated.  You need the oracle key and the repository is no longer non-free (but contrib).

Follow these directions to add VirtualBox to the aptitude sources on a Debian Linux box:

By: neon

 information is very clear. good and understandable explanation. super-topics. Thank you for sharing a very nice web site.

By: john cavebe

Thanks a lot, Falko! It worked out very easily to get VirtualBox up and running!  Thanks for taking the time to make the tutorial.