Usage:

drush vagrant-build --project-name=Example --blueprint=drupal7 --docroot=~/src/mysite/docroot

In this case /var/www/drupal would be a NFS shared folder of "~/src/mysite/docroot".

This is a follow-up to #1734782: Make it easy to import an existing site

Comments

discipolo’s picture

this is working in aegir-up. so that functionality could maybe be ported over?

wizonesolutions’s picture

I'd love this option as well. I just realized that /var/www/drupal only exists in the VM. This defeats the purpose of Vagrant, which is to be able to work near-transparently on my laptop instead of having to use Vim inside of the VM. I'm OK with that, mind, but I'm trying to switch over to using GUI Vim on my laptop just because it's more fluid. This makes that harder (I guess the workaround is to run nfsd on the guest and share the folder to the host).

wizonesolutions’s picture

Workaround for Mac OS X host:

Install NFS on the VM

apt-get update
apt-get install nfs-kernel-server

vim /etc/exports

/path/to/docroot <your_host_ip>(rw,sync,all_squash,no_subtree_check,insecure,anonuid=33,anongid=33)

From mine:

/var/www 192.168.11.1(rw,wdelay,insecure,root_squash,all_squash,no_subtree_check,anonuid=33,anongid=33)

In Mac OS X, open Disk Utility. File -> NFS Mounts. Type nfs://<vm_ip_on_host_network>/path/to/docroot (only one preceding slash)

My <vm_ip_on_host_network> is 192.168.11.11.

Enter the path corresponding to docroot. The files and folders in docroot will appear under here.

Expand advanced options, type resvport.

Save, exit out of Disk Utility (enter password if prompted), wait a couple seconds while the automounter runs, and then browse to your directory. With any luck, you'll be able to work locally now.

Bonus: Add an appropriate symlink to /path/to/docroot on the *host*, if possible (probably needs sudo), to make Xdebug-in-Vim work :)

eli-t’s picture

You need to restart nfs on the virtual machine after editing /etc/exports before the new export will be mountable from OSX.
sudo /etc/init.d/nfs-kernel-server restart

discipolo’s picture

Just to verify. It seems issues with docroot NFS occur when building the second project(vm)