Debian virtualbox linux headers

Error: kernel headers not found. (But they are in place)

I’m trying to install the Guest Additions in VirtualBox 4.04. Host OS is Ubuntu desktop 11.04 64bit, guest OS is Ubuntu server 11.10 64bit.

$ sudo ./VBoxLinuxAdditions.run 
The headers for the current running kernel were not found. 
$ dpkg --get-selections | grep linux-headers linux-headers-3.0.0-12 install linux-headers-3.0.0-12-server install linux-headers-server install 
$ uname -a Linux foobar 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 X86_64 GNU/Linux 

How do I fix things so that Guest Additions installer is able to find kernel headers? Update: added full output.

The headers for the current running kernel were not found. If the module compilation fails then this could be the reason. Building the main Guest Additions module . done. Building the shared folder support module . fail! (Look at /var/log/vboxadd-install.log to find out what went wrong) Installing the Window System drivers . fails! (Could not find the X.Org or XFree86 Window System). 

I don’t care for fail #2, because that’s a server and I don’t need X server. But I need shared folder support. Some further detail:

$ tail /val/log/vboxadd-install.log . cc1: some warnings being treated as errors make[2]: *** [/tmp/vbox.0/vfsmod.o] Error 1 make[1]: *** [_module_/tmp/vbox.0] Error 2 make: *** [vboxsf] Error 2 

Источник

How to install VirtualBox Guest Additions in a Debian virtual machine

I have been struggling to install VirtualBox Guest Additions in a Debian Virtual Machine (Debian 7, Debian 8 and Debian 9).

4 Answers 4

The TL;DR version for Debian 9 is, as root:

echo deb http://ftp.debian.org/debian stretch-backports main contrib > /etc/apt/sources.list.d/stretch-backports.list apt update apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r) 

That’s it, the VirtualBox Guest Additions are installed.

Читайте также:  Root login enable in linux

For Debian 10 and 11, the VirtualBox packages are being made available in the new Fast Track service (see also the VirtualBox page on the Debian wiki). Thus for Debian 11:

echo deb http://ftp.debian.org/debian bullseye-backports main contrib > /etc/apt/sources.list.d/bullseye-backports.list apt update apt install fasttrack-archive-keyring echo deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-fasttrack main contrib > /etc/apt/sources.list.d/bullseye-fasttrack.list echo deb https://fasttrack.debian.net/debian-fasttrack/ bullseye-backports-staging main contrib >> /etc/apt/sources.list.d/bullseye-fasttrack.list apt update apt install virtualbox-guest-x11 

The guest kernel modules are included in the Debian 11 kernel. For Debian 10, follow the instructions above, replacing bullseye with buster , and install the same packages as in Debian 9:

apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r) 

In more detail, here’s the solution for Debian 7, 8, and 9, using Debian packages:

    for Debian 7 and 8, enable the contrib repositories; e.g. for Debian 8, make sure your /etc/apt/sources.list contains something like

 deb http://ftp.debian.org/debian jessie main contrib 
 deb http://ftp.debian.org/debian stretch-backports main contrib 
 sudo apt update sudo apt install virtualbox-guest-dkms virtualbox-guest-x11 linux-headers-$(uname -r) 

That’s all that’s needed — you don’t need to mount the guest additions in your VM, or run the installer. You can add the three lines of shell invocations to your Vagrantfile (or whatever you use to provision your VMs) and forget about them.

Installing the virtualbox-guest-dkms package will ensure that the appropriate kernel modules are automatically built (and rebuilt when the kernel is upgraded), and install the guest additions.

(Note that this will install the version of the guest additions available in whichever version of Debian you’re using in the VM, which may not match the version of Virtual Box running the VM — but the guest additions should still work fine.)

Читайте также:  Установка drweb linux mint

Источник

Оцените статью
Adblock
detector