To create a VM with opal server installed with all the test data etc using vagrant. On your host machine (i.e. your laptop etc):

Set up


Build the VM and install DataSHIELD

After you have install Vagrant and VirtualBox getting a VM with DataSHIELD up and running is as easily as three commands, for example to create a DataSHIELD server with test data using a Ubuntu system (assuming you are in the root directory of this repo) you would run:


git clone https://github.com/datashield/datashield-infrastructure.git

cd datashield-infrastructure

git checkout ubuntu16

cd vagrant/datashield_testdata_ubuntu/

vagrant up


This will download an image of a vanilla Ubuntu VM, create a new VM on your system with all the networking set up etc, then run the puppet scripts to install everything. It will probably take 10-15 mins for the whole thing to finish.

Check it's working

Once it is finished you should be able to go to http://192.168.56.100:8080 and log into opal (Opal logon username: administrator,  password: datashield_test&). 


Troubleshooting

Sometimes the network setup in VirtualBox doesn't quite work with what vagrant has set up. It seems that it needs to be flushed somehow, and the easiest way I have seen of doing this is to go to the network settings in VirtualBox (the main setting not the settings for the VM), delete the hostonly adaptor then add it back again.


Exporting the VM

If you want to export the VM for use elsewhere (e.g. to give to someone else) then there is a couple of steps to take, this is because vagrant does a few things like setting up passwordless SSH using key files that will not work on a different host. 

Create admin user account for SSH


Change the IP address

The IP address is hardcoded in the vagrant set up, so if you want to clone this and have a different IP address then follow the relevant instructions on the manual set up page.


Shared drives

Note that vagrant creates shared folders in virtualbox. This is a problem when you export the VM from one host and try to import it into a new host. This is because when you export the VM it uses the full file path (i.e. it will expect your username in the path) for the shared folders. These shared folders are only used for setting up the VM (and will hold private keys that are specific to the host), so you can delete them. To delete them, close the VM, then in virtual box click on the shared folder part and delete the folders that have vagrant in them.

Not sure what this was referring to!


Export the VM as an OVA file if you want to give it to someone else.