Last Updated: March 10, 2022
· stephenoldham

Use NFS to speed up your Homestead VM

Made the switch to Laravel Homestead and Vagrant in your dev workflow? Wondering why it's not responding as quick as your production environment?

Yeah...been there.

A bit of googling led me to the solution that using NFS for your synced folder is the way to go. Simply replace the folder sync settings in your homestead.rb with the following:

# Register All Of The Configured Shared Folders
settings["folders"].each do |folder|
    config.vm.synced_folder folder["map"], folder["to"],
        id: folder["map"],
    :nfs => true,
        :mount_options => ['nolock,vers=3,udp,noatime']

Props go to Stricken for the solution:

Avoid caching issues

You'll also need to make sure you turn off sendfile in your apache/nginx config to avoid caching strangeness. Props to adamwathan for this:

For more detailed info on the sendfile change checkout Pierre Groth's tip here:

5 Responses
Add your response

On the latest version of Homestead, you can simply edit your Homestead.yamlfile and change the folder type. E.g. folders:- map: ~/Code to: /home/vagrant/Code type: nfs

over 1 year ago ·

and make sure that "winnfsd.exe is running in your processes."

over 1 year ago ·

Not really TomSta, this post is about Mac.

over 1 year ago ·

How to check if "NFS" is actually working apart from drastically improved performance? :) I'm concern about mine, looks like it is not set properly (Mac OS X Yosemite, Homestead 2 latest version).

Doesn't look like @zejesago tip working for me.


over 1 year ago ·

I'm finally able to install decent, fast and working configuration with such versions of corresponding tools:

I'm using Mac OS X 10.10

Vagrant 1.7.4

VirtualBox 5.0.11 r104456

over 1 year ago ·