====== VirtualBox issues ======
===== Install Guest Additions =====
VirtualBox 4.3.18 is packaged with Debian 8 and Debian 7 backports. Debian 7 stable is packaged with VirtualBox 4.1.18, it's Guest Additions to not build on kernel 3.16 which is the latest kernel on Debian 8.5. To fix, you need to upgrade VirtualBox to 4.3.18. See [[https://www.virtualbox.org/ticket/13123|Ticket #13123]]
==== Upgrade VirtualBox to 4.3.18 ====
Follow [[https://wiki.debian.org/VirtualBox|VirtualBox]] on the Debian Wiki:
- Add [[https://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
- 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 [[https://packages.debian.org/wheezy-backports/virtualbox|wheezy-backports/virtualbox]] package:# apt-get -t wheezy-backports install virtualbox
This will also install [[https://packages.debian.org/wheezy-backports/virtualbox-dkms|wheezy-backports/virtualbox-dkms]] and other recommended packages. DKMS will build the VirtualBox modules for your system.
Check whether the Guest Additions have installed to 4.3.18, if not, then you must install the 4.3.18 Guest Additions manually:
- Download from [[https://packages.debian.org/wheezy-backports/virtualbox-guest-additions-iso|Package: virtualbox-guest-additions-iso (4.3.18-1~bpo70+1)]]
- Install with:dpkg -i
==== Install USB2.0/3.0 Extension ====
- Download the extension from [[https://www.virtualbox.org|VirtualBox]]
- Run VirtualBox, then click "File -> Preferences -> Extensions"
- Install the extension
- If elevating to root permissions does not work, close all instances of VirtualBox, and restart VirtualBox as root user
==== Compile the Guest Additions in the guest OS ====
Follow these steps to install the Guest Additions on your Debian virtual machine:
- Login as root;
- Update your APT database with apt-get update;
- Install the latest security updates with apt-get upgrade;
- Install required packages with apt-get install build-essential module-assistant;
- Configure your system for building kernel modules by running m-a prepare;
- Click on "Install Guest Additions…" from the Devices menu, then run mount /media/cdrom.
- Run //sh /media/cdrom/VBoxLinuxAdditions.run//, and follow the instructions on screen.
If the header files are not found, or the wrong header files are found, do the following:
sudo apt-get remove dkms build-essential linux-headers-*
sudo apt-get install dkms build-essential linux-headers-$(uname -r)
==== Debian 9 ====
enable backports with contrib; to do so, add a line like
deb http://ftp.debian.org/debian stretch-backports main contrib
to /etc/apt/sources.list (or better yet, a stretch-backports.list file in /etc/apt/sources.list.d);
install virtualbox-guest-dkms, kernel headers, and, optionally, virtualbox-guest-x11 (for the graphical guest utilities):
sudo apt update
sudo apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r)
* [[https://unix.stackexchange.com/questions/286934/how-to-install-virtualbox-guest-additions-in-a-debian-virtual-machine|How to install VirtualBox Guest Additions in a Debian virtual machine]]