Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having symlinks in Varying-Vagrant-Vagrants (VVV) shared folders

I am currently using Varying-Vagrant-Vagrants to setup local WordPress development environment in my Macbook Pro.

VVV creates separate hosts (default, develop, trunk etc) and has corresponding shared folders created inside the /www folder.

$ tree -L 1 www
www
├── default
├── phpcs
├── vvv-hosts
├── wordpress-default
├── wordpress-develop
├── wordpress-trunk
└── wp-cli

Instead of copying my current plugin into all the three WordPress installation's plugin folder I was to use a symlink.

Assuming that my plugin code is in ~/Dropbox/code/my-plugin, I want to create symlinks to the following locations

  • wordpress-default/wp-content/plugins/my-plugin
  • wordpress-develop/wp-content/plugins/my-plugin
  • wordpress-trunk/wp-content/plugins/my-plugin

The problem with this approach is that when these folders are mapped inside the vm the symlink still points to the location in the host os which is not available inside vm. Is there any alternative to this?

I have already checked this answer from another question which deals with vagrant (not specific VVV) but that doesn't seem to work.

like image 645
Sudar Avatar asked Dec 01 '14 07:12

Sudar


1 Answers

I finally did it by creating a new shared folder. If someone is interested then this is what I added to my own Customfile.

if vagrant_version >= "1.3.0"
  config.vm.synced_folder "/Users/sudar/Dropbox/plugins/", "/srv/www/wordpress-default/wp-content/plugins", :owner => "www-data", :mount_options => [ "dmode=775", "fmode=774" ]
else
  config.vm.synced_folder "/Users/sudar/Dropbox/plugins/", "/srv/www/wordpress-default/wp-content/plugins", :owner => "www-data", :extra => 'dmode=775,fmode=774'
end

Update: I have also written a blog post explaining my setup, since a couple of people were asking about it.

like image 120
Sudar Avatar answered Oct 19 '22 23:10

Sudar