VBox Guest Additions 安装找不到 Kali kernal 4.14.0-kali1-amd64 的标头

VBox Guest Additions 安装找不到 Kali kernal 4.14.0-kali1-amd64 的标头

我已经在 VirtualBox 中安装了 Kali,现在尝试安装 Guest Additions 以获得全屏视图。

我更新并安装了我的软件包并安装了 dkms。当我尝试安装 linux-headers 时,我得到以下信息:

# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-4.14.0-kali1-amd64 is already the newest version (4.14.2-1kali1).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.

安装的标头如下:

# dpkg --get-selections | grep linux-headers
linux-headers-4.14.0-kali1-amd64        install
linux-headers-4.14.0-kali1-common       install
linux-headers-amd64             install

当我尝试运行 Guest Additions CD 时,我得到以下信息:

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.40 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.40 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
update-initramfs: Generating /boot/initrd.img-4.13.0-kali1-amd64
update-initramfs: Generating /boot/initrd.img-4.14.0-kali1-amd64
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
Press Return to close this window...

在我看来,内核的正确 linux 标头已安装。为什么 VBox 找不到它们?

尝试更新到 VBox 5.2.2,但在删除现有版本并安装 5.2.2 后,我无法启动 Kali-Linux - 附有屏幕截图

答案1

您应该按照教程在 VirtualBox Gest Additions 上安装Kali Linux 官方文档

VirtualBox Guest Additions 提供与主机操作系统的适当的鼠标和屏幕集成以及文件夹共享。要安装它们,请按以下步骤操作。

启动 Kali Linux 虚拟机,打开终端窗口并发出以下命令。

apt-get update
apt-get install -y virtualbox-guest-x11
reboot

答案2

如果您相信您安装了正确的标头,请按照以下步骤操作

Cd /media/cdrom
sudo chmod +x VBoxLinuxAdditions.run // chmod: changing permissions of 'VBoxLinuxAdditions.run': Read-only file system. ignoere this message

sudo sh ./VBoxLinuxAdditions.run

安装后你必须重新启动你的系统

相关内容