Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 87

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/33/d337644085/htdocs/kieron-wp/wp-content/themes/Divi/includes/builder/functions.php on line 4940
Vagrant on Windows - Improve slow performance by using SMB instead of NFS - Kieron Howard
Select Page

I love Vagrant, its a great tool for development. Sadly, once your project gets too big, performance really drops off a cliff on Windows. Running a Symfony2 project, I was getting ~20 second page refresh times. Apparently this relates to VirtualBox NFS on the shared folder.

 

A few people mentioned using Samba instead of NFS, but I couldn’t find anyone who had successfully used it. I gave it a go, and can confirm, it works a treat.

 

So first off, ssh into your Vagrant box:

vagrant ssh

 

then install Samba and edit the conf file

apt-get install samba
sudo nano /etc/samba/smb.conf

and add in:

[shared]
comment = Local Dev Server – /var/www
path = /var/www
browsable = yes
guest ok = yes
read only = no
create mask = 0777
force user = root
force group = root
#[shared] End

after that restart the Samba server

sudo restart smbd
sudo restart nmbd

Then I copied all the files in my project to my new Samba share directory ( called in this case ‘shared’).
after that I edited my Vagrantfile to make sure the NFS share was definitely turned off.

config.vm.synced_folder “.”, “/vagrant”, disabled: true

%d bloggers like this: