“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"
Code language: PHP (php)

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']
Code language: PHP (php)

Interesting related articles: