Vagrantで Vagrant was unable to mount VirtualBox shared folders. エラーが起こった際の解決法



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 dmode=777,fmode=777,uid=500,gid=500 var_www_html /var/www/html

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device


mount -t vboxsf -o dmode=777,fmode=777,uid=500,gid=500 var_www_html /var/www/html




$ vagrant up


$ vagrant ssh

でログインし、次を実行。私の環境では以下のようになりました。OpenGL supportはコケていてもそもそも必要がないので気にしないことにします。

$ sudo /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Building the OpenGL support module [失敗]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions [ OK ]


$ vagrant reload