如何?它给出了一个错误。
[vagrant@localhost mnt]$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.16 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.16 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.
[vagrant@localhost mnt]$ cat /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..
[vagrant@localhost mnt]$ cat /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.
vagrant init centos/7
vagrant up; vagrant halt
VBoxGuestAdditions.iso
要插入驱动器中的文件。vagrant
和路径为您的目录Vagrantfile
。Vagrant没有正确设置/ vagrant。编辑Vagrantfile
此文件并将其添加到底部,以在每次启动时置备共享文件夹。
config.vm.provision "shell", run: "always", inline: <<-SHELL
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
SHELL
继续
vagrant up
vagrant ssh
sudo yum update
sudo yum install kernel-devel gcc
exit
vagrant halt; vagrant up; vagrant ssh
export KERN_DIR=/usr/src/kernels/`uname -r`
sudo mount /dev/sr0/ /mnt
cd /mnt
sudo ./VBoxLinuxAdditions.run
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句