Translation(s): English - ?Español - Русский


VirtualBox is an opensource x86 emulator developed by innotek (bought by Sun, now Oracle) comparable to VMware. A proprietary extra package enhance the base experience, adding things like RDP access to the Guest. This page contains some how-to, tips and tricks when setting up and using VirtualBox.

Installation

VirtualBox 4.1.8 is packaged for Debian Wheezy. Please use the history of this wiki if you are looking for information before Squeeze.

Since version 4.0 the name suffix OSE became obsolete. All non-GPL parts are now packed in an additonal extension pack available from oracle.

Wheezy

Install the linux headers for you architecture and the virtualbox package:

apt-get install linux-headers-amd64 virtualbox

To not load the ?VirtualBoxmodules at system startup, edit /etc/default/virtualbox and set LOAD_VBOXDRV_MODULE to 0.

Squeeze

  1. Install the relevant linux-headers and virtualbox-ose packages:

    # aptitude install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox-ose

    This will also install virtualbox-ose-dkms and other recommended packages. DKMS will build the VirtualBox OSE modules for your system.

VirtualBox OSE can now be started.

To not load the ?VirtualBoxmodules at system startup, edit /etc/default/virtualbox and set LOAD_VBOXDRV_MODULE to 0.

Squeeze Backports

  1. Add the Debian Backports repository to /etc/apt/sources.list. For example:

    # Backported packages for Debian Squeeze
    deb http://backports.debian.org/debian-backports squeeze-backports main
  2. Update the list of available packages:

    # aptitude update
  3. Install the relevant linux-headers package for your system, for example:

    # aptitude install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
  4. Install the squeeze-backports/virtualbox package:

    # aptitude -t squeeze-backports install virtualbox

    This will also install squeeze-backports/virtualbox-dkms and other recommended packages. DKMS will build the VirtualBox modules for your system.

VirtualBox can now be started.

To not load the VirtualBox modules at system startup, edit /etc/default/virtualbox and set LOAD_VBOXDRV_MODULE to 0.

Starting

Desktop

Server

You can start VirtualBox in Headless mode using VBoxHeadless like this:

$ VBoxHeadless -startvm "VMName"

You should run this inside a screen instance and detach the screen after starting the VM with Ctrl+a d. At least in version 4.0.x you won't need to use screen. Just start the vm with:

$ VBoxManage startvm "VMName" --type headless

and a VBoxSVC process appears in the background. You can loggoff without problems.

Troubleshooting

The character device /dev/vboxdrv does not exist

When starting VirtualBox, the following message is shown:

Load the VirtualBox kernel module (also load vboxnetflt in Debian Squeeze):

If the module is not found, refer to Installation to provide a virtualbox-dkms* package to your system. To load the module(s) at system startup, edit /etc/default/virtualbox and set LOAD_VBOXDRV_MODULE to 1.

You are not a member of the "vboxusers" group

As stated by VirtualBox:

Add your user account to the vboxusers group via adduser(8), as described in Installation:

Log out and log back in to your system to apply the group membership change.

Kernel driver not installed (rc=-1908)

You receive the following message

After running

VirtualBox works fine until you reboot the system. This is because "vboxdrv" is not loaded during system boot.
Solution.
Make sure that you actually have these packages in your system
1) dkms;
2) build-essential;
3) linux-headers-$(uname -r)

Then, append the following line to /etc/modules


-1909 VERR VM DRIVER NOT ACCESSIBLE

error-1909-VERR_VM_DRIVER_NOT_ACCESSIBLE.png

See You are not a member of the "vboxusers" group above.


RDP not working out of the box?

To get RDP working you need to install the VirtualBox Extensions Pack from the vendors website VirtualBox Downloads.

Simply download the extensions pack, click "File" => "Preferences" => "Extensions" => "Down arrow". Select the file you downloaded above. Click "OK". Restart VirtualBox.

Tips & Tricks

Switching consoles

The normal way to switch consoles in Linux is to use the ctrl-alt-Fx key combination. This does not work for a VirtualBox virtual machine (VM); it will switch consoles for the host system instead.

You should use <Host Key>-Fx instead, where <Host Key> is the key defined in File->Preferences->Input.

This also works for ctrl-alt-del and ctrl-alt-backspace

This is documented in the VirtualBox user manual in the section "Keyboard and mouse support in virtual machines", subsection "Typing special characters".

(An alternative method to switch between text consoles is to use alt-left and alt-right, but that does not work for graphical consoles like XOrg or DirectFB.)

How to remotely start virtual machines using VNC

Remote:

Local:

See Also


ToDo:


CategoryPermalink