我在全新安装的 Kali Linux 64 位上尝试安装 Virtualbox Guest Additions 时遇到错误。 Windows 10 64 位是主机操作系统。
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install linux-headers-$(uname -r)
执行步骤4后,出现如下错误
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'
VBoxGuestAdditions.run
从安装的光盘复制VBOXADDITIONS_5.1.22_1115126
到/root/Desktop
chmod 755 ./VBoxLinuxAdditions.run
./VBoxAdditions.run
运行第7步出现错误:
vboxadd.sh: Starting the VirtualBox Guest Additions.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details
里面/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
里面/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.
重启前 uname -a
:
Linux k 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) X86_64 GNU/Linux
重启后 uname -a
:
Linux k 4.9.0 -kali4-amd64 #1 SMP Debian 4.9.25-1kali1 (2017-05-04) x86_64 GNU/Linux
有什么想法出了什么问题吗?
输出apt-cache search linux-headers
答案1
要安装适合linux-headers
您的内核映像的版本,请通过以下方式获取可用版本linux-headers
:
apt-cache search linux-headers
然后安装它:
apt-get install linux-headers-4.9.0-kali4-amd64
答案2
尝试添加一个新的存储库sources.list
打开: sources.list
leafpad
leafpad etc/apt/sources.list
将此行添加到文件中以添加存储库:
deb http://http.kali.org/kali kali-rolling main contrib non-free
然后按照您的步骤操作。