使用一個 Windows 主機和一個運行在in的Linux客戶機使用同步文件夾,我有一個奇怪的問題。
在第一個引導( 或者在 vagrant destroy 之後) 中,項目文件夾掛載到/vagrant,但在停止並啟動虛擬機之後,文件夾將不會掛載。
這是vagrant輸出結束時出現的錯誤消息:...
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:
mount -t vboxsf -o uid=1000,gid=1000 vagrant/vagrant
The error output from the command was:
: Protocol error
Vagrantfile中沒有同步的文件夾相關配置選項,我只是嘗試使用默認同步的文件夾行為。
一些類似的問題提示運行Vagrant插件 vagrant-vbguest 可能解決一些類似的問題,但我有這個插件。 同時,虛擬框和已經安裝的客戶機添加都是版本 5.1.10.
電腦重新啟動后,運行 sudo mount -t vboxsf vagrant/vagrant 僅給出這裡錯誤:/sbin/mount.vboxsf: mounting failed with the error: Protocol error
因為某些原因 sudo mount -t vboxsf vagrant/vagrant ( 大寫V ) 將掛載已經同步的文件夾。 首次啟動時 mount | grep vagrant 顯示同步的文件夾名為 vagrant with小寫'v',VirtualBox顯示文件夾的共享名,即使在重新啟動這個文件夾之後。
我真的需要在不給錯誤的情況下正確地使用vagrant行為。 是什麼導致了這種情況發生?