无法在 Kali 中安装 VirtualBox 来宾添加

无法在 Kali 中安装 VirtualBox 来宾添加

我在全新安装的 Kali Linux 64 位上尝试安装 Virtualbox Guest Additions 时遇到错误。 Windows 10 64 位是主机操作系统。

  1. apt-get update
  2. apt-get upgrade -y
  3. apt-get dist-upgrade -y
  4. 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'
  1. VBoxGuestAdditions.run从安装的光盘复制VBOXADDITIONS_5.1.22_1115126/root/Desktop

  2. chmod 755 ./VBoxLinuxAdditions.run

  3. ./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.listleafpad

leafpad etc/apt/sources.list

将此行添加到文件中以添加存储库:

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

然后按照您的步骤操作。

相关内容