PDA

View Full Version : Kali 2018 on VirtualBox issue



Nyebodnye
2018-02-17, 21:01
Unable to Install VBoxGuestAdditions_5.2.6

root@kali:~# cp /media/cdrom/* /root
root@kali:~# pwd
/root
root@kali:~# chmod 755 VBoxLinuxAdditions.run
root@kali:~# chmod 755 runasroot.sh
root@kali:~# whoami
root
root@kali:~# ./runasroot.sh

Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-amd64 linux-headers-4.14.0-kali3-amd64

root@kali:~# sudo apt-get install linux-headers-4.14.0-kali3-amd64

E: Unable to locate package linux-headers-4.14.0-kali3-amd64

root@kali:~# sudo apt-get install linux-headers-amd64

E: Unable to locate package linux-headers-amd64

Please could https://docs.kali.org/general-use/kali-linux-virtual-box-guest be updated ?

Mister_X
2018-02-18, 01:00
You should follow the instructions at the top of the page.

If you really want to do it manually like that, you need to run apt-get update and apt-get dist-upgrade then reboot before running the scripts

Nyebodnye
2018-02-18, 08:15
You should follow the instructions at the top of the page.

If you really want to do it manually like that, you need to run apt-get update and apt-get dist-upgrade then reboot before running the scripts

root@kali@~# apt-get update
Reading package lists... Done

root@kali@~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... DOne
Calculating upgrade... Done
0 Upgraded, 0 newly installed, 0 to remove and 0 not upgraded

and then... ?

viklander
2018-02-26, 22:14
from Unix Stack Exchange

On kali linux rolling release (https://en.wikipedia.org/wiki/Rolling_distribution) the package will be continuously updated , the old package will be removed and replaced by the newest version. on your system you have an old kernel image linux-image-4.12.0-kali1-amd64 , it is no longer available on the kali linux repository , Also its linux-headers-4.12.0-kali1-amd64 will be removed too.
After the system update (apt update) you can check the available linux-image and linux-headers through:
apt-cache search linux-image
apt-cache serach linux-headers
based on the apt-cache output you can install a specific linux-image and linux-headers package .
the must important part do not use the apt install linux-headers-$(uname -r) , the uname -r it will point to 4.12.0-kali1-amd64 headers package which it is no longer available it will work after installing a new linux-image and booting the new kernel.
installing the linux-image and the linux-headers without rebooting , the linux-headers package will be useful after the system reboot.
apt install linux-image-4.12.0-kali2-amd64
apt install linux-headers-4.12.0-kali2-amd64
Or , install the linux-image :
apt install linux-image-4.12.0-kali2-amd64
Reboot your system then install the linux-headers:
apt install linux-headers-$(uname -r)
now the uname -r should point to the 4.12.0-kali2-amd64 kernel headers version.
The easy way is to upgarade entirely your system followig those steps:
apt update
apt upgrade
apt dist-upgrade
reboot
then install the linux-headers:
apt install linux-headers-$(uname -r)
apt autoremove
The uname -a will display:
4.13.0-kali1-amd64
On kali-linux rolling the /etc/apt/sources.list should contain only the following line (kali docs (https://docs.kali.org/general-use/kali-linux-sources-list-repositories)):
deb http://http.kali.org/kali kali-rolling main contrib non-free

Mister_X
2018-02-27, 14:52
Don't install an older version

IndyMorning
2018-03-30, 01:02
Unable to Install VBoxGuestAdditions_5.2.6

root@kali:~# cp /media/cdrom/* /root
root@kali:~# pwd
/root
root@kali:~# chmod 755 VBoxLinuxAdditions.run
root@kali:~# chmod 755 runasroot.sh
root@kali:~# whoami
root
root@kali:~# ./runasroot.sh

Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-amd64 linux-headers-4.14.0-kali3-amd64

root@kali:~# sudo apt-get install linux-headers-4.14.0-kali3-amd64

E: Unable to locate package linux-headers-4.14.0-kali3-amd64

root@kali:~# sudo apt-get install linux-headers-amd64

E: Unable to locate package linux-headers-amd64

Please could https://docs.kali.org/general-use/kali-linux-virtual-box-guest be updated ?

I had the same issue as you, and even updates/upgrades all told me I was up to date:

root@burtreynolds:~# apt update
Hit:1 http://archive-7.kali.org/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@burtreynolds:~# apt dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Manually updating the linux image to the version of linux headers that was available in the repo was what finally fixed the issue for me.

What version of linux headers is in the repo?

root@burtreynolds:~# apt-cache search linux-headers | grep kali
linux-headers-4.15.0-kali2-all - All header files for Linux 4.15 (meta-package)
linux-headers-4.15.0-kali2-all-amd64 - All header files for Linux 4.15 (meta-package)
linux-headers-4.15.0-kali2-amd64 - Header files for Linux 4.15.0-kali2-amd64
linux-headers-4.15.0-kali2-cloud-amd64 - Header files for Linux 4.15.0-kali2-cloud-amd64
linux-headers-4.15.0-kali2-common - Common header files for Linux 4.15.0-kali2

linux-headers-4.15.0-kali2-amd64 is the guy I want, so I installed installed the linux image for that version of linux-headers:


apt install linux-image-4.15.0-kali2-amd64

Rebooted, then I could install the linux headers with the classic:

apt install linux-headers-$(uname -r)

Voila, I could run VBoxLinuxAdditions.run and now I've got everything working. The part that was super annoying was that I actually had virtualbox-guest-x11 installed via apt the whole time, it just wasn't working. Had to do it the hard way.