Build and run with Vagrant
In this document, you will learn to create a VirtualBox VM that runs the gds_env
container using vagrant
.
Requirements
This approach does not require Docker installed on the host machine, but the following needs to be installed and available:
- VirtualBox
vagrant
- The
Vagrantfile
for this project, available to download here.
Once the VM is created, only VirtualBox is required to run it.
Provision VirtualBox image
To provision a VM that runs Docker and the gds_env
image on startup, automatically, navigate to the folder with the Vagrantfile
:
cd path/to/my/folder
And run:
vagrant up
The first time you run this on a machine, it will take a long time and will require a good internet connection as it has to download all the components of the Docker image, as well as a lightweight layer to make it run on VirtualBox.
When completed, you should be able to point your browser to localhost:8888
and JupyterLab should be running.
Once built, you can export the VM into an .ova
file for transport. Before that, make sure the VM is not running:
vagrant halt
And then export with the following command:
vboxmanage export "GDS Box" -o gds_4p1_vagrant.ova
This might take a while but will result on a compressed single file that can be imported by VirtualBox on a different machine.
Run VM through vagrant
+ VirtualBox
Once built, every time you want to start the VM again, you need to navigate to the folder where you keep the Vagrantfile
:
cd path/to/my/folder
And run:
vagrant up
If the VM is built, booting up should only take a few seconds, one or two minutes at the most depending on hardware.
Once ready, you should be able to point your browser to localhost:8888
and JupyterLab should be running.
Password
To login to the JupyterLab instance you will need the password geods
.
File sharing
By default, the folder where you keep the Vagrantfile
and where you run vagrant up
from is mounted under /home/jovyan/work
in the container. This means that, when you access JupyterLab, the work
folder that appears on the left-hand side is a “window” into the folder in the host where you start the VM from.
NOTE: you can access all the files and folders within the folder from which you start the session, but you cannot move outside such location.
Shutting down
Once you are done with your work and want to stop JupyterLab, you can run:
vagrant halt