在vagrant up --provider=vmware_fusion
期间收到此错误:
[default] Waiting for HGFS kernel module to load...
The HGFS kernel module was not found on the running virtual machine.
This must be installed for shared folders to work properly. Please
install the VMware tools within the guest and try again. Note that
the VMware tools installation will succeed even if HGFS fails
to properly install. Carefully read the output of the VMware tools
installation to verify the HGFS kernel modules were installed properly.
谷歌搜索,我发现这与问题有关
$ lsmod | grep -i '^vmhgfs'
$
但我不清楚解决方案是什么。
我在我的基础vmx中安装了VMWare工具,这是由打包器构建的:
$ vmware-
vmware-checkvm vmware-uninstall-tools.pl
vmware-config-tools.pl vmware-user
vmware-hgfsclient vmware-vmblock-fuse
vmware-rpctool vmware-xdg-detect-de
vmware-toolbox-cmd vmware-xferlogs
我还在VMWare设置中启用了共享文件夹
任何想法我能做什么?
答案 0 :(得分:9)
由于缺少gcc和linux标头,VMWare工具安装在安装过程中无声地失败。我没有看到错误,因为我正在运行sudo ./vmware-install.pl -d
,它不会在失败时停止。
解决问题安装先决条件:
sudo apt-get install build-essential linux-headers-$(uname -r)
然后重新安装VMWare工具(没有-d
标志以确保一切正常)
sudo ./vmware-install.pl
答案 1 :(得分:1)
扩展杰夫的回答,
vmware工具图片位于/Applications/VMware Fusion.app/Contents/Library/isoimages
解压缩iso文件,你应该在里面找到vmware tools tar文件。把它放在实例中。
您需要先卸载现有的vmware工具。运行此
sudo /usr/bin/vmware-uninstall-tools.pl
然后
sudo apt-get install build-essential linux-headers-$(uname -r)
从之前提取的vmware工具包中,应该有一个vmware-install.pl
文件。运行它
sudo ./vmware-install.pl
重新启动,您的vmware工具应该正常工作。
答案 2 :(得分:1)
找到一个优雅的解决方案here,这需要添加到Vagrantfile
:
# Ensure that VMWare Tools recompiles kernel modules when we update the linux images
$fix_vmware_tools_script = <<SCRIPT
sed -i.bak 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSWER yes/g' /etc/vmware-tools/locations
sed -i.bak 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# ...
config.vm.provision :shell, :inline => $fix_vmware_tools_script
end