Linux

在 Linux 客戶機中掛載文件夾失敗

  • January 13, 2014

直到我重新安裝了我的 Virtual Box 和 Vagrant,一切正常。

現在,config.vm.synced_folder "source/tk_dev/src/repo/app", "/home/vagrant/www/tk_dev/app"在我的 Vagrantfile 中鍵入時會導致以下內容vagrant up

C:\Vagrant\box_website>vagrant up
[default] Attempting graceful shutdown of VM...
DL is deprecated, please use Fiddle
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.0.4
VirtualBox Version: 4.3
[default] Setting hostname...
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /home/vagrant/www/tk_dev/src/repo/app
Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`
/home/vagrant/www/tk_dev/src/repo/app /home/vagrant/www/tk_dev/src/repo/app
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /home/vagrant/www/tk_
dev/src/repo/app /home/vagrant/www/tk_dev/src/repo/app

不幸的是,我還沒有找到任何解決方案。你有什麼想法?

我找到了我的問題的原因。我的 Windows 機器上有一個符號連結,它從我的儲存庫指向共享目錄。刪除符號連結後,它起作用了。似乎使用符號連結不僅在 Linux 機器上而且在執行 Virtual Box 的機器上都非常困難。

引用自:https://serverfault.com/questions/566744