4860
Comment: Initial version
|
14645
add a hint that virtualbox is available via stretch-backports
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
VirtualBox is an x86 emulator developed by [http://www.virtualbox.org/wiki/innotek innotek] comparable to VMWare, but freely available as Open Source Software under the terms of the GNU General Public License (GPL). Its a relatively new program and still has some minor issues, but in general it is reliable, stable and, above all, very fast. It has been used successfully to do installation tests with Debian Installer. This page contains some tips and tricks that can be useful when setting up and using VirtualBox (based on version 1.5.2). == Switching consoles == |
#language en ~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[ru/VirtualBox|Русский]]-~ ---- ||<tablestyle="width:100%; text-align: left" style="border:0">{{https://upload.wikimedia.org/wikipedia/commons/d/d5/Virtualbox_logo.png|Virtualbox logo|width=128}}||<style="border:0;vertical-align: middle;">VirtualBox is an open source x86 emulator developed by [[http://www.virtualbox.org/wiki/innotek|innotek]] ''(bought by Sun, now Oracle)'' comparable to [[VMware]]. A proprietary extra package enhances 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.|| Since version 4.0 the name suffix OSE became obsolete. All non-GPL parts are now packed in an additional extension pack available from Oracle. <<TableOfContents(3)>> <<Anchor(install)>> == Installation of non-free edition == <<Anchor(stretch)>> === Debian 9 "Stretch" === Packages for VirtualBox are [[DebianBug:794466|not available in Debian 9]]. To install VirtualBox you must use the stretch-backports repository or the upstream third-party repository. ==== stretch-backports ==== See the instructions on https://backports.debian.org/Instructions/ and install with {{{ apt install virtualbox }}} ==== Oracle Virtualbox third-party repository ==== 1. Add {{{virtualbox.list}}} to {{{/etc/apt/sources.list.d}}} {{{ deb http://download.virtualbox.org/virtualbox/debian stretch contrib }}} 1. Add Oracle VirtualBox public key: {{{ curl -O https://www.virtualbox.org/download/oracle_vbox_2016.asc sudo apt-key add oracle_vbox_2016.asc }}} 1. Install virtualbox-5.1 {{{ sudo apt-get update sudo apt-get install virtualbox-5.1 }}} Complete instructions on the [[https://www.virtualbox.org/wiki/Linux_Downloads|VirtualBox Wiki]] <<Anchor(jessie)>> === Debian 8 "Jessie" === ## nb. APT installs recommended packages by default; virtualbox-dkms and virtualbox-qt are included as a result. VirtualBox 4.3.18 is packaged for [[DebianJessie|Debian 8 "Jessie"]]. The virtualbox-* packages were moved to [[http://www.debian.org/doc/debian-policy/ch-archive#s-contrib|contrib]] at VirtualBox 4.2, as a non-free compiler (Open Watcom) is required to build the BIOS. 1. Add the "contrib" component to {{{/etc/apt/sources.list}}}, for example: {{{ # Debian 8 "Jessie" deb http://httpredir.debian.org/debian/ jessie main contrib }}} 1. Update the list of available packages: {{{ # sudo apt-get update }}} 1. Install the relevant linux-headers package and [[DebianPkg:jessie/virtualbox|virtualbox]] package, for example: {{{ # sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox }}} This will also install [[DebianPkg:jessie/virtualbox-dkms|virtualbox-dkms]] and other recommended packages. DKMS will build the VirtualBox modules for your system. VirtualBox can now be [[#Starting|started]]. To not load the VirtualBox modules at system startup, edit {{{/etc/default/virtualbox}}} and set LOAD_VBOXDRV_MODULE to 0. <<Anchor(jessie-backports)>> <<Anchor(Jessie Backports)>> === Debian 8 "Jessie" Backports === The backport allow you to install a more recent version of VirtualBox. [[https://packages.debian.org/jessie-backports/virtualbox|VirtualBox 5.1.8]] is packaged for [[DebianJessie|Debian 8 "Jessie"]] via [[http://backports.debian.org/|jessie-backports]]. 1. Add [[http://backports.debian.org/|Debian Backports]] sources to {{{/etc/apt/sources.list}}}, also including the "contrib" component. For example: {{{ # Backported packages for Debian 8 "Jessie" deb http://ftp.debian.org/debian jessie-backports main contrib }}} Important: In this source above, double check that your included "contrib" component at the end of this line. Otherwise the following steps will not install the latest version of Virtualbox and all its dependencies. 1. Update the list of available packages: {{{ # apt-get update }}} 1. Install the relevant linux-headers package for your system, for example: {{{ # apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') }}} 1. Install the DebianPkg:jessie-backports/virtualbox package: {{{ # apt-get -t jessie-backports install virtualbox }}} Note: This command line above will also automatically install the following new packages: * [[DebianPkg:jessie-backports/virtualbox-dkms|dkms]], which automatically build the VirtualBox initial modules for your system * [[DebianPkg:jessie-backports/virtualbox-dkms|fakeroot]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libfakeroot]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libgsoap5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5core5a]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5dbus5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5gui5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5opengl5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5printsupport5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5widgets5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libqt5x11extras5]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libvncserver0]] * [[DebianPkg:jessie-backports/virtualbox-dkms|libxcb-render-util0]] * [[DebianPkg:jessie-backports/virtualbox-dkms|qttranslations5-l10n]] * [[DebianPkg:jessie-backports/virtualbox-dkms|virtualbox-dkms]] * [[DebianPkg:jessie-backports/virtualbox-dkms|virtualbox-qt]] * The command line above might also install other recommended packages depending on your system 1. Optionally, you might be interested to install the DebianPkg:jessie-backports/virtualbox-guest-additions-iso package. Which provides a [[https://www.virtualbox.org/manual/ch04.html|number of advantages and useful additional features]]: {{{ # apt-get -t jessie-backports install virtualbox-guest-additions-iso }}} 1. Also optionally, you might be interested to install the DebianPkg:jessie-backports/virtualbox-guest-x11 package. Which adds [[https://www.virtualbox.org/manual/ch12.html#idm10311|various features]], such as shared clipboard, auto-resizing, seamless desktop in X11 guests such as Gnome, KDE and others, and more features: {{{ # apt-get -t jessie-backports install virtualbox-guest-x11 }}} VirtualBox can now be [[#Starting|started]]. To not load the VirtualBox modules at system startup, edit {{{/etc/default/virtualbox}}} and set LOAD_VBOXDRV_MODULE to 0. <<Anchor(wheezy)>> === Debian 7 "Wheezy" === ## nb. APT installs recommended packages by default; virtualbox-dkms and virtualbox-qt are included as a result. VirtualBox 4.1.42 is packaged for [[DebianWheezy|Debian 7 "Wheezy"]]. 1. Install the relevant linux-headers and [[DebianPkg:wheezy/virtualbox|virtualbox]] packages: {{{ # apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox }}} VirtualBox can now be [[#Starting|started]]. To not load the VirtualBox modules at system startup, edit {{{/etc/default/virtualbox}}} and set LOAD_VBOXDRV_MODULE to 0. <<Anchor(wheezy-backports)>> <<Anchor(Wheezy Backports)>> === Debian 7 "Wheezy" Backports === The backport allow you to install a more recent version of VirtualBox. [[https://packages.debian.org/wheezy-backports/virtualbox|VirtualBox 4.3.36]] is packaged for [[DebianWheezy|Debian 7 "Wheezy"]] via [[http://backports.debian.org/|wheezy-backports]]. The virtualbox-* packages were moved to [[http://www.debian.org/doc/debian-policy/ch-archive#s-contrib|contrib]] at VirtualBox 4.2, as a non-free compiler (Open Watcom) is required to build the BIOS. 1. Add [[http://backports.debian.org/|Debian Backports]] sources to {{{/etc/apt/sources.list}}}, also including the "contrib" component. For example: {{{ # Backported packages for Debian 7 "Wheezy" deb http://http.debian.net/debian/ wheezy-backports main contrib }}} 1. Update the list of available packages: {{{ # apt-get update }}} 1. Install the relevant linux-headers package for your system, for example: {{{ # apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') }}} 1. Install the DebianPkg:wheezy-backports/virtualbox package: {{{ # apt-get -t wheezy-backports install virtualbox }}} This will also install DebianPkg:wheezy-backports/virtualbox-dkms and other recommended packages. DKMS will build the VirtualBox modules for your system. VirtualBox can now be [[#Starting|started]]. To not load the VirtualBox modules at system startup, edit {{{/etc/default/virtualbox}}} and set LOAD_VBOXDRV_MODULE to 0. == Starting == === Desktop === * In [[KDE]], go to: KDE menu > System > VirtualBox OSE * In [[GNOME]], go to: GNOME menu > Applications > System tools > VirtualBox OSE * From an X terminal: {{{ $ virtualbox Or $ VirtualBox }}} === 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: . {{{ WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-ose-modules package for your kernel and load the module named vboxdrv into your system. You will not be able to start VMs until this problem is fixed. }}} Load the VirtualBox kernel module (also load {{{vboxnetflt}}} in Debian [[DebianSqueeze|Squeeze]]): . {{{ $ su # modprobe vboxdrv }}} If the module is not found, refer to [[#Installation|Installation]] to provide a virtualbox-dkms* package to your system. <<Anchor(error-vboxusers)>> === You are not a member of the "vboxusers" group === As stated by VirtualBox: . {{{ WARNING: You are not a member of the "vboxusers" group. Please add yourself to this group before starting VirtualBox. You will not be able to start VMs until this problem is fixed. }}} Add your user account to the vboxusers group via [[DebianMan:8/adduser|adduser(8)]], as described in [[#Installation|Installation]]: . {{{ $ su # adduser yourusername vboxusers }}} Log out and log back in to your system to apply the group membership change. <<Anchor(error-1908)>> === Kernel driver not installed (rc=-1908) === You receive the following message . {{{ 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 '/etc/init.d/vboxdrv setup' as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary. }}} After running . {{{ $sudo /etc/init.d/vboxdrv setup }}} VirtualBox works fine until you reboot the system. This is because "vboxdrv" is not loaded during system boot. <<BR>> Solution. <<BR>> Make sure that you actually have these packages in your system<<BR>> 1) dkms;<<BR>> 2) build-essential;<<BR>> 3) linux-headers-$(uname -r)<<BR>> <<BR>> Then, append the following line to /etc/modules . {{{ vboxdrv }}} <<BR>> === -1909 VERR VM DRIVER NOT ACCESSIBLE === {{attachment:error-1909-VERR_VM_DRIVER_NOT_ACCESSIBLE.png}} See [[#error-vboxusers|You are not a member of the "vboxusers" group]] above. <<BR>> === RDP not working out of the box? === To get RDP working you need to install the VirtualBox Extensions Pack from the vendors website [[https://www.virtualbox.org/wiki/Downloads|VirtualBox Downloads]]. Simply download the extensions pack, click "File" => "Preferences" => "Extensions" => "Down arrow". Select the file you downloaded above. Click "OK". Restart VirtualBox. <<Anchor(tips)>> == Tips & Tricks == === Switching consoles === |
Line 12: | Line 265: |
This also works for {{{ctrl-alt-del}}} and {{{ctrl-alt-backspace}}}. It is documented in the [http://www.virtualbox.org/download/UserManual.pdf VirtalBox user manual] in the section "Keyboard and mouse support in virtual machines", subsection "Typing special characters". == Setting up bridged networking for VirtualBox == By default VirtualBox uses NAT for the network interfaces of virtual machines and use an internal DHCP server to obtain an IP address. This works well but the disadvantage is that the machine will not have an IP address visible outside the VM and so you cannot connect to it from the host system or from other systems. By attaching the VM's interface to "Host Interface" and creating a bridge on the host system, the VM can be made visible on the local network. This also allows to do fun stuff like netbooting the VM (boot from LAN using PXE). It is comparable to the "bridged networking" option in VMWare. ==== Preparation ==== First install the packages {{{uml-utilities}}} and {{{bridge-utils}}}. As we're not actually interested in User Mode Linux but just need the {{{tunctl}}} utility to create a TAP device, prevent {{{uml-switch}}} from being started at system boot by editing {{{/etc/default/uml-utilities}}} and setting {{{UML_SWITCH_START="false"}}}. Next, change the network configuration of the host system so that the network interface becomes part of a bridge. Note that this requires restarting the network, so be careful when doing this on a remote system! Change the file {{{/etc/network/interfaces}}} to look something like this: {{{ # The loopback network interface auto lo iface lo inet loopback # The primary network interface (without IP address) auto eth0 iface eth0 inet static address 0.0.0.0 netmask 255.255.255.255 # Create the bridge (with the regular IP address of the host) auto br0 iface br0 inet dhcp bridge_ports eth0 bridge_fd 2.5 }}} In this example the bridge gets its IP address and configuration from DHCP. For static configuration see[[BR]]{{{/usr/share/doc/bridge-utils/README.Debian.gz}}} Restart the networking of the host system using: {{{ # /etc/init.d/networking restart}}} After this {{{brctl show}}} should show the bridge and {{{ifconfig}}} should show the bridge has the host's IP address. ==== Configuring the VirtualBox VM ==== There are different ways the TAP interface for the VM can be created: * statically (before VirtualBox is even started) * on demand (when a VM is being started) See also the chapter on "Virtual networking" in the [http://www.virtualbox.org/download/UserManual.pdf VirtalBox user manual]. The example below shows the second method. In the example the name of the interface is hardcoded in the script. If you want to be able to create multiple interfaces, you'll have to adapt the script. Note that the script assumes you can execute the needed commands using sudo. {{{ #! /bin/sh set -e IF=vbox0 BRIDGE=br0 case "$1" in up) # Create a TAP network device sudo tunctl -u $LOGNAME -t $IF >/dev/null 2>&1 # Bring it up (without IP address) sudo ifconfig $IF up # Add it to the bridge sudo brctl addif $BRIDGE $IF # Tell VirtualBox the name of the interface echo $IF ;; down) sudo tunctl -d $IF >/dev/null 2>&1 ;; esac }}} Save the script, for example as {{{~/.VirtualBox/bridge_setup}}}. The script can be tested by running it from the command line. If successful, {{{brctl show}}} should show interface {{{vbox0}}} added to the bridge. To configure the VM to use bridged networking, go to the "network" page of the VM's settings and change the following fields: * Attached to: {{{Host Interface}}} * Setup Application: {{{~/.VirtualBox/bridge_setup}}} up * Terminate Application: {{{~/.VirtualBox/bridge_setup}}} down |
This also works for {{{ctrl-alt-del}}} and {{{ctrl-alt-backspace}}} This is documented in the [[http://www.virtualbox.org/manual/UserManual.html|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: * log onto your remote box * install DebianPkg:tightvncserver * launch it (you don't need a display), pick a password * determine which port it is using, a way to do so: * {{{netstat -tap | grep vnc}}} * Let's say it's 5901 * unlog from there since the server forked in the background Local: * install DebianPkg:xtightvncviewer * create a ssh tunnel to your box: * {{{ssh -L 5901:localhost:5901 you@remote}}} * use it: (note there are two colons) * {{{xtightvncviewer localhost::5901}}} * then {{{VBoxManage startvm $yourvm &}}} * and start as many virtual machines as wanted. == See Also == * Alternative SystemVirtualization tools. * It is possible to use [[Veewee]] to automate the creation of Debian guests images for VirtualBox == External Links == * http://www.virtualbox.org/ - VirtualBox OSE homepage; * http://www.virtualbox.org/wiki/User_FAQ - Frequently Asked Questions * http://www.virtualbox.org/manual/UserManual.html ([[http://download.virtualbox.org/virtualbox/UserManual.pdf|PDF]]) - Official User Manual * [[irc://irc.freenode.net/%23vbox|#vbox]] - [[IRC]] channel * [[http://www.virtualbox.org/wiki/Linux_Downloads#Debian-basedLinuxdistributions|http://www.virtualbox.org/wiki/Linux_Downloads]] - Using upstream's binaries (repository). ---- ToDo: * Describe shared folders feature (user needs to be in {{{vboxsf}}} group) ------ ## This page is referenced from /usr/share/doc/virtualbox-ose/README.Debian.gz CategoryPermalink |
Translation(s): English - Русский
VirtualBox is an open source x86 emulator developed by innotek (bought by Sun, now Oracle) comparable to VMware. A proprietary extra package enhances 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. |
Since version 4.0 the name suffix OSE became obsolete. All non-GPL parts are now packed in an additional extension pack available from Oracle.
Contents
Installation of non-free edition
Debian 9 "Stretch"
Packages for VirtualBox are not available in Debian 9. To install VirtualBox you must use the stretch-backports repository or the upstream third-party repository.
stretch-backports
See the instructions on https://backports.debian.org/Instructions/ and install with
apt install virtualbox
Oracle Virtualbox third-party repository
Add virtualbox.list to /etc/apt/sources.list.d
deb http://download.virtualbox.org/virtualbox/debian stretch contrib
Add Oracle VirtualBox public key:
curl -O https://www.virtualbox.org/download/oracle_vbox_2016.asc sudo apt-key add oracle_vbox_2016.asc
Install virtualbox-5.1
sudo apt-get update sudo apt-get install virtualbox-5.1
Complete instructions on the VirtualBox Wiki
Debian 8 "Jessie"
VirtualBox 4.3.18 is packaged for Debian 8 "Jessie".
The virtualbox-* packages were moved to contrib at VirtualBox 4.2, as a non-free compiler (Open Watcom) is required to build the BIOS.
Add the "contrib" component to /etc/apt/sources.list, for example:
# Debian 8 "Jessie" deb http://httpredir.debian.org/debian/ jessie main contrib
Update the list of available packages:
# sudo apt-get update
Install the relevant linux-headers package and virtualbox package, for example:
# sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox
This will also install 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.
Debian 8 "Jessie" Backports
The backport allow you to install a more recent version of VirtualBox. VirtualBox 5.1.8 is packaged for Debian 8 "Jessie" via jessie-backports.
Add Debian Backports sources to /etc/apt/sources.list, also including the "contrib" component. For example:
# Backported packages for Debian 8 "Jessie" deb http://ftp.debian.org/debian jessie-backports main contrib
- Important: In this source above, double check that your included "contrib" component at the end of this line. Otherwise the following steps will not install the latest version of Virtualbox and all its dependencies.
Update the list of available packages:
# apt-get update
Install the relevant linux-headers package for your system, for example:
# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
Install the jessie-backports/virtualbox package:
# apt-get -t jessie-backports install virtualbox
- Note: This command line above will also automatically install the following new packages:
dkms, which automatically build the VirtualBox initial modules for your system
- The command line above might also install other recommended packages depending on your system
- Note: This command line above will also automatically install the following new packages:
Optionally, you might be interested to install the jessie-backports/virtualbox-guest-additions-iso package. Which provides a number of advantages and useful additional features:
# apt-get -t jessie-backports install virtualbox-guest-additions-iso
Also optionally, you might be interested to install the jessie-backports/virtualbox-guest-x11 package. Which adds various features, such as shared clipboard, auto-resizing, seamless desktop in X11 guests such as Gnome, KDE and others, and more features:
# apt-get -t jessie-backports install virtualbox-guest-x11
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.
Debian 7 "Wheezy"
VirtualBox 4.1.42 is packaged for Debian 7 "Wheezy".
Install the relevant linux-headers and virtualbox packages:
# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox
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.
Debian 7 "Wheezy" Backports
The backport allow you to install a more recent version of VirtualBox. VirtualBox 4.3.36 is packaged for Debian 7 "Wheezy" via wheezy-backports.
The virtualbox-* packages were moved to contrib at VirtualBox 4.2, as a non-free compiler (Open Watcom) is required to build the BIOS.
Add Debian Backports sources to /etc/apt/sources.list, also including the "contrib" component. For example:
# Backported packages for Debian 7 "Wheezy" deb http://http.debian.net/debian/ wheezy-backports main contrib
Update the list of available packages:
# apt-get update
Install the relevant linux-headers package for your system, for example:
# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
Install the wheezy-backports/virtualbox package:
# apt-get -t wheezy-backports install virtualbox
This will also install wheezy-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
In KDE, go to: KDE menu > System > VirtualBox OSE
In GNOME, go to: GNOME menu > Applications > System tools > VirtualBox OSE
From an X terminal:
$ virtualbox Or $ VirtualBox
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:
WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-ose-modules package for your kernel and load the module named vboxdrv into your system. You will not be able to start VMs until this problem is fixed.
Load the VirtualBox kernel module (also load vboxnetflt in Debian Squeeze):
$ su # modprobe vboxdrv
If the module is not found, refer to Installation to provide a virtualbox-dkms* package to your system.
You are not a member of the "vboxusers" group
As stated by VirtualBox:
WARNING: You are not a member of the "vboxusers" group. Please add yourself to this group before starting VirtualBox. You will not be able to start VMs until this problem is fixed.
Add your user account to the vboxusers group via adduser(8), as described in Installation:
$ su # adduser yourusername vboxusers
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
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 '/etc/init.d/vboxdrv setup' as root. Users of Ubuntu, Fedora or Mandriva should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
After running
$sudo /etc/init.d/vboxdrv setup
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
vboxdrv
-1909 VERR VM DRIVER NOT ACCESSIBLE
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:
- log onto your remote box
install tightvncserver
- launch it (you don't need a display), pick a password
- determine which port it is using, a way to do so:
netstat -tap | grep vnc
- Let's say it's 5901
- unlog from there since the server forked in the background
Local:
install xtightvncviewer
- create a ssh tunnel to your box:
ssh -L 5901:localhost:5901 you@remote
- use it: (note there are two colons)
xtightvncviewer localhost::5901
then VBoxManage startvm $yourvm &
- and start as many virtual machines as wanted.
See Also
Alternative SystemVirtualization tools.
It is possible to use Veewee to automate the creation of Debian guests images for VirtualBox
External Links
http://www.virtualbox.org/ - VirtualBox OSE homepage;
http://www.virtualbox.org/wiki/User_FAQ - Frequently Asked Questions
http://www.virtualbox.org/manual/UserManual.html (PDF) - Official User Manual
http://www.virtualbox.org/wiki/Linux_Downloads - Using upstream's binaries (repository).
ToDo:
Describe shared folders feature (user needs to be in vboxsf group)