DrupalVM is a great project with some very complete documentation. However, for some reason I kept having difficulty getting it to work on Ubuntu despite seemingly straightforward instructions including a reference to DigitalOcean documentation (usually very good) about getting NFS running on Debian/Ubuntu.
After a few mis-starts, I think I have found the magic combination to getting it all running on a new Ubuntu-based system. As with most things, it seems incredibly simple in hindsight. One major prerequisite is that NFS does not work reliably with home directory encryption turned on. If you must run with this you’ll have to turn off NFS support in DrupalVM. Once you have that squared away, here’s the basic process:
- sudo apt-get update
- sudo apt-get install nfs-common
- apt-get install nfs-kernel-server
- sudo apt-get install virtualbox – you may need to make sure your software sources is configured correctly, usually needs to include Canonical Partners
- sudo apt-get install vagrant
- sudo apt-get install ansible
- sudo apt-get install git
- git clone https://github.com/geerlingguy/drupal-vm.git
- cd drupal-vm
- sudo ansible-galaxy install -r provisioning/requirements.yml --force
- vagrant plugin install vagrant-hostsupdater
- vagrant plugin install vagrant-vbguest
- [edit config files]
- vagrant up
The key pieces, I’ve found, are installing the nfs-common package and the vagrant-vbguest plugin.
The end result is a DrupalVM with NFS (much more performant) with magical DNS capability (via vagrant-hostsupdater, no need to edit /etc/hosts). If you add new sites to the config file just run vagrant provision to quickly get them configured in the VM and added to your local DNS without losing anything else or needing to wait for a full VM rebuild.