当我使用以下语法设置不带:user
和:group
的同步文件夹时,它可以正常工作:
config.vm.synced_folder "..", "/home/vagrant/repo"
如果我也尝试同时设置:user
和:group
config.vm.synced_folder "..", "/home/vagrant/repo", :owner => 'vagrant', :group => 'httpd'
我遇到一个错误:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
getent group httpd
The error output from the command was:
我将VirtualBox
更新为6.0.20,也降级为5.2,并使用vagrant-vbguest
安装了vagrant plugin install vagrant-vbguest
。在来宾上,我还运行了sudo yum -y install kernel-headers kernel-devel
错误仍然存在。解决办法是什么?
config.vm.box = "generic/centos7"
在centos 7上,不是httpd
用户正在运行Apache
,而是apache
。