4

I am experiencing errors while trying to install Virtualbox Guest Additions on a fresh install of Kali Linux 64-bit. Windows 10 64-bit is the host OS.

  1. apt-get update
  2. apt-get upgrade -y
  3. apt-get dist-upgrade -y
  4. apt-get install linux-headers-$(uname -r)

After running step 4, the following error appears

E: Unable to locate package 'linux-headers-4.9.0-kali3-amd64'
E: Couldn't find any package by glob 'linux-headers-4.9.0-kali3-amd64'
E: Couldn't find any package by regex 'linux-headers-4.9.0-kali3-amd64'
  1. Copied VBoxGuestAdditions.run from the mounted VBOXADDITIONS_5.1.22_1115126 disc to /root/Desktop

  2. chmod 755 ./VBoxLinuxAdditions.run

  3. ./VBoxAdditions.run

Running step 7 gave the error:

vboxadd.sh: Starting the VirtualBox Guest Additions.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details

Inside /var/log/VBoxGuestAdditions.log:

Created symlink /etc/systemd/system/multi-user.target.wants/vboxadd.service ->  /lib/systemd/system/vboxadd.service.
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: modprobe vboxguest failed.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxadd-service.service -> /lib/systemd/system/vboxadd-service.service
Created symlink /etc/systemd/system/multi-user.target.wants/vboxadd-x11.service -> /lib/systemd/system/vboxadd-x11.service

And inside /var/log/vboxadd-install.log:

/tmp/vbox.0/Makefile.include.header:112: *** ERror: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.

Before Restart uname -a :

 Linux k 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) X86_64 GNU/Linux

After Restart uname -a :

Linux k 4.9.0 -kali4-amd64 #1 SMP Debian 4.9.25-1kali1 (2017-05-04) x86_64 GNU/Linux

Any ideas what went wrong?


Output of apt-cache search linux-headers

enter image description here

7
  • Welcome to U&L what is the output of uname -a ?
    – GAD3R
    Commented May 8, 2017 at 14:09
  • 1
    You might have to reboot before; you might have upgrade the kernel and Linux in runtime still thinks you are using the previous version; OR you should not use Debian backports with kali. Commented May 8, 2017 at 14:23
  • @GAD3R Output of uname -a is Linux k 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) X86_64 GNU/Linux
    – Nyxynyx
    Commented May 8, 2017 at 14:38
  • @RuiFRibeiro Restarted Kali, same error. How should I use Debian backports?
    – Nyxynyx
    Commented May 8, 2017 at 14:41
  • 1
    @GAD3R Uploaded screenshot of the output in the question. Dont have copy-paste feature without VirtualboxAdditions installed.
    – Nyxynyx
    Commented May 8, 2017 at 16:06

2 Answers 2

2

To install the appropriate linux-headers to your kernel image , get the available linux-headers through :

apt-cache search linux-headers

Then install it:

apt-get install linux-headers-4.9.0-kali4-amd64
1
  • 1
    Or just install the meta package apt-get install linux-headers-amd64 and that will keep your header files up to date during upgrades.
    – Hrobky
    Commented Oct 13, 2022 at 22:04
1

Try adding a new repository the sources.list

Open sources.list in leafpad:

leafpad etc/apt/sources.list

Add this line to the file to add the repo:

deb http://http.kali.org/kali kali-rolling main contrib non-free

then follow your steps.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .