Vagrant was unable to mount VirtualBox shared folders

VirtulaBoxをアップデートすると、Vagrantの共有フォルダが同期できないエラーが表示された。

  • VirtualBox: 5.1.20
  • Vagrant: 1.9.1
  • Host: Ubuntu 16.04

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:

mount: wrong fs type, bad option, bad superblock on vagrant,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.

修復

vagrant sshでログイン後、GuestAdditionsのシンボリックリンクを調べると存在しないところにリンクが貼られていた。


ls -l /sbin/mount.vboxsf
lrwxrwxrwx 1 root root 49 /sbin/mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf

これを修正する。


sudo ln -sf /opt/VBoxGuestAdditions-5.1.20/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

vagrant reload後、マウントが成功する。

コメントする




twenty − 12 =