This is the Deeson fork of Vagrant Drupal Development (VDD) is fully configured and ready to use development environment built with VirtualBox, Vagrant, Linux and Chef Solo provisioner.
We use this on MacOSX - if you use other OS then your mileage may vary.
You should have git installed, type git and complete the xcode command line tools instructions if it pops up.
Once xcode is installed, run sudo git as the local admin user to agree to the terms and conditions
You will need a github account with the SSH key installed.
- Goto https://github.com/join to create an account
- Create a local SSH key and install it into your github account by following these instructions
You will also need to have sudo access for your local user. Get a senior dev to add this for you.
These instructions include setting up a raw D7 site with shortname drupal7.
-
cd ~/Applications
-
git clone git@github.com:teamdeeson/vdd.git
-
cd vdd
-
git checkout develop/xenial
-
cp config.example.json config.json
-
edit config.json - you should also add your first site configuration now as well. We will include a raw Drupal 7 instance as an example. This project shortname is drupal7. Replace placeholders in the file from [shortname] with drupal7
-
Setup your DNS so that requests to all domains ending in .dev are sent to the vagrant box by running these commands. After doing this it takes a little while for everything to start resolving. Try flushing DNS cache or just restart your Mac.
su - localadmin sudo mkdir -p /etc/resolver sudo tee /etc/resolver/dev >/dev/null <<EOF nameserver 192.168.44.44 EOF exit
-
Check that you have a Sites directory in your home folder (~/Sites)
-
vagrant plugin install vagrant-persistent-storage
This installs a plugin which allows the databases to be stored in an external file -
Go to synced folder instructions and skip to the section labelled “Root Privilege Requirement”. Add the section required for OSX to your sudoers file.
-
vagrant up
this step takes a while to go through as it is downloading the OS image & all needed software packages so go do something else -
vagrant provision
this step also takes a while as all the packages need to be downloaded and configured. -
When done, go to http://192.168.44.44 to confirm it is working. You should get an HTML page back.
-
Configure the ssh config to connect to your VDD box. To do this, run the following command within the vdd directory
cd ~/Applications/vdd; vagrant ssh-config
. Make a note of the IdentityFile path. Edit the file~/.ssh/config
and add the following to the end. Later, this will allow you to automatically ssh into the virtual box via ssh dev.local Replace [IdentityFile] with the path from the vagrant ssh config output.Host dev.local HostName 192.168.44.44 User ubuntu UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile [IdentityFile] IdentitiesOnly yes RequestTTY Yes LogLevel QUIET
If you were previously tracking develop and would like to switch to the new Xenial release follow the instructions below.
The Xenial branch is slimmed down from the original for developer ease (no Varnish for example) and runs Ubuntu Xenial OS and PHP 7.0
- Make sure you are running the latest versions of VirtualBox and Vagrant
- There is a chance you will lose the files on your persistent storage during this process. If you can backup the file at ~/Applications/vdd/persistant-storage.vdi then do this. Otherwise, you can just take some db backups of your active projects so you can restore them after if this happens.
- cd ~/Applications/vdd
- vagrant destroy
- Switch to the new branch: git fetch && git checkout xenial/develop
- Edit your config.json file - compare with the config.json.example file, there is a new line required ("domain_suffix": "dev") also you can remove ("persist_db": true). You could also take this opportunity to remove unnecessary lines from the individual site configurations in the file as well (compare with the new example file) vagrant up - this will build the new VDD box by downloading a Xenial OS image from ubuntu and installing the more mimimal set of packages.
- Once complete you will need to go into the box and change the owner of the mysql files stored in the persistent storage as the UID of the mysql user will have changed: vagrant ssh
- cd /mnt/persistent/mysql
- sudo chown -R mysql.mysql .
- sudo service mysql restart
- On your Mac, you'll need to make a change your to ssh config file because the user on the Xenial box has changed from vagrant to ubuntu edit ~/.ssh/config
- Find the section which starts Host dev.local
- Change User vagrant to User ubuntu (if this is missing then add it)
Some of your sites may have hard coded the vdd user as vagrant
. The best thing to do is to remove these lines from the projects drush aliases file. i.e. in the sites/all/drush/sites.aliases.drushrc.php file remove any lines that look like this:
$aliases['vdd']['remote-user'] = 'vagrant';
Question: I'm seeing a message that says A newer version of the box 'ubuntu/xenial64' is available! - can I update the box?
Answer: Yes you can by running vagrant box update
.
Checkout the list of Known issues on our VDD Wiki