“Failed to mount folders in Linux guest.” – Homestead error

Enabling nfs in Homestead.yaml in a Windows environment, by doing only:

folders:
- map: ~/Code
  to: /home/vagrant/Code
  type: "nfs"

generate errors. E.g. Failed to mount folders in Linux guest. This is usually because the “vboxsf” file system is not available.

A possible solution is:

folders:
- map: ~/Code
  to: /home/vagrant/Code
  type: nfs
  owner: "vagrant"
  group: "vagrant"
  mount_options: ['nolock,vers=3,udp,noatime']

Interesting related articles:

  • http://stackoverflow.com/questions/22717428/vagrant-error-failed-to-mount-folders-in-linux-guest
  • https://laracasts.com/discuss/channels/general-discussion/for-those-who-find-homesteadvagrantvirtualbox-slow-on-windows?page=1
  • https://websanova.com/blog/laravel/speeding-up-homestead-on-windows-using-nfs
  • https://github.com/laravel/framework/issues/8410
  • http://iteration9.com/2015/using-laravel-homestead-on-windows/