根据以下文档下载以下iso VBoxGuestAdditions_5.1.0.iso之后:https: //www.vagrantup.com/docs/virtualbox/boxes.html
然后运行以下命令
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_5.1.0.iso /media/VBoxGuestAdditions
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
我收到错误:
无法设置服务vboxadd,请检查日志文件/var/log/VBoxGuestAdditions.log以获取详细信息。
当我查看此日志时,它引用了另一个日志文件/var/log/vboxadd-install.log
。查看此日志时,会看到以下内容:
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/3.13.0-93-generic/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: Makefile: No such file or directory
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: *** No rule to make target `Makefile'. Stop.
make: *** [vboxguest] Error 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
我安装了以下软件包。我什至删除了它们并再次添加了它们:
linux-headers-$(uname -r) linux-generic linux-image-generic linux-headers-generic linux-signed-generic dkms build-essential
我不确定如何进一步调试它。对这个问题的任何帮助将不胜感激。
另外,我然后尝试使用Virtual Box附带的Guest附加CD。进入CD并接受安装后,发生以下情况。插入Guest Additions CD时,出现以下错误:
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.4 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 4.3.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.
Press Return to close this window...
然后,我继续查看文件/var/log/VBoxGuestAdditions.log,这表明:
vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed..
然后,我继续打开/var/log/vboxadd-install.log,看到以下内容:
/tmp/vbox.0/Makefile.include.header:97: *** 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.
这会使系统处于故障状态,除了重新启动映像外无法恢复。