Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Shovels's avatar

@dragon thanks for the link... Will check it out.

Another thing that's a little odd is my desktop is really quick, but similar spec laptop is dog slow.

alberto1el's avatar

An Update on my environment: I have been having lots of problems with this nfs deal on windows (7) and homestead, I found it much much easier to have PHPstorm upload my changes to the homestead vm each time I make a save (trough SFTP), it is really fast and also laravel runs as fast as expected, so no more nfs between windows and homestead needed. The Only thing I still had problems with, was on the caching of views, but I solved it with this approach: http://stackoverflow.com/a/26216634/2479380 (I have already upgraded to laravel 5.1 and it still works, I previously was working with this on Laravel 5.0)

abass's avatar

Worked great for initial load but then all of a sudden I got "winnfsd.exe has stopped working" and everything stopped working. Anyone else experience this problem?

mistermat's avatar

Correct me if I'm wrong, but I think it's not necessary to muck around with the homestead.rb file. Instead we can simply add mount options and type to the homestead.yaml file, as follows:

folders:
    - map: local\path
    - to: /home/vagrant/path
    - type: "nfs"
    - mount_opts: ['nolock,vers=3,udp,noatime,actimeo=1']

And ensure the vagrant nfs plugin is installed

vagrant plugin install vagrant-winnfsd

PS. looks like actimeo=1 really helps speed up gulp watch.

1 like
larryeitel's avatar

Although I am successfully syncing Windows directory with a directory on vm, all directories and files are owned by root and have FULL permissions 777!

folders:
    - map: F:/_vms/HomesteadCode/xchg
      to: /srv/www/xchg2
      type: "nfs"
      owner: "vagrant"
      group: "vagrant"
      mount_options: [dmode=775,fmode=664,nolock,vers=3,udp,noatime]

When looking at permissions on Windows, all is well. However, on vagrant/homestead VM mapped directory, all permissions are 777!!

PS: Noticed after posting that I probably should open a new thread. Let me know if I should. :)

UPDATE:

I have everything working now!!! For anyone interested, I updated to latest Homestead, I think 4.2. I upgraded VirtualBox as well as Vagrant to latest.

Couple things to keep in mind. Make a backup! At the moment I only mapped/mounted a folder for one project. First try mapping to a non-existent dir on vagrant vm.

Once you have nfs mapping/mounting a folder, now you can work on you files locally in Windows. I use PHPStorm with all the IDE goodness AS WELL AS git management. I do any composer installs on vagrant. Files created are synced back to Windows! :) Happiness!

If you are using PHPStorm and you wanna do remote debugging, you have to set up remote deployment with sftp. HOWEVER, in the options, do not have it automatically copy ANY files to remote. Remote sftp is only used for remote debugging.

Also, if you have debug bar running your will notice a huge degradation with any sizeable project. Least I did. That was why I revisited this whole issue. THAT was the culprit however in the process I finally got nfs working!!! :)

asolopovas's avatar

I have spend all morning trying to get it working with nfs. It simply keeps failing on windows 10 nothing works. Homestead.yaml, Homestead.rb. http://iteration9.com/2015/using-laravel-homestead-on-windows/, github. I think the solution is way to complicated to setup. And each time same crappy error [NFS] Status: running ==> default: Mounting NFS shared folders... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! mount -o 'actimeo=1' 192.168.10.1:'/C/Projects/vhosts' /home/vagrant/Code Stdout from the command: Stderr from the command: mount.nfs: mount system call failed

with no nfs it works ok but twice as slow.

kikvors's avatar

Thanks so much @phazei ! Without the vagrant nfs plugin the nfs mounting hangs. Installing the plugin and updating homestead.rb did the trick! Load times reduced from 6-8s to a few hundred milliseconds. Good enough for me!!

1 like
bramcou's avatar

@mistermat solution works aswell and is really quick and easy. Do mind that you add:

  type: "nfs"
  mount_opts: ['nolock,vers=3,udp,noatime,actimeo=1']

For each folder mapping and without the stripes in front of type and mount_opts.

Thx!

Bartestro's avatar

Using homestead 6.0 at the moment. I was fiddling with all these setups and my system (Windows 10 with VirtualBox) finally used vagrant nfs plugin, but performance gain was very low, and even hard to notice. Performance of VM depends on host. I've tried to verify it many times, keeping that in mind. Therefore while it is not giving me any substantial gain in performance I would prefer sticking to official docs of Laravel and homestead builds... BTW The most significant performance gain I've seen was when I moved homestead disk to ssd drive...

robjbrain's avatar

I've had this issue multiple times (often after restarting machine). Normally I go through the steps of installing the the nfs plugin for vagrant and it gets back to normal, but now its happened for 2 days and I can't get below 10-20 second load times.

Has anyone come up with any other solutions?

I've got the vagrant plugin installed and nfs-kernel-server installed on the vagrant machine.

I've got the following in my Homestead.yaml

- map: c:\my\code
      to: /home/vagrant/code
      type: nfs
      mount_options: [nolock,vers=3,udp,noatime,actimeo=1]

and i've done vagrant reload --provision

But like I said i've still got 10-20 load times.

Surely there's got to be a better way? I can't believe everyone on Windows using vagrant is having these sorts of issues.

robjbrain's avatar

I've found that tools such as debugbug, clockwork and telescope have a big affect on this.

I've attempted to get these to use something other than files such as redis, but that hasn't made a great deal of difference

Previous

Please or to participate in this conversation.