VM and Docker
VM and Docker
Vagrant requires a separate directory from which you will launch VM's. Each VM directory
requires a Vagrant le to be present. When you run the vagrant command it will search the
current directory for a Vagrant le as a con guration for the VM (or VM's) including the box
image to download and use. If vagrant cannot locate a Vagrant le in the current directory it will
recursively search the parent directory for one. Create the directory $HOME/SE1 on your
laptop, if it does not already exist.
For Windows users and users of Intel based Macs, to use the following command to create an
initial Vagrant le. Remember to run this command from within the directory $HOME/SE1.
For Apple Silicon based Macs (those with M1, M2, or M3 chips), you must use an ARM
compatible box image. Run the following command:
You should edit the Vagrant le to allow your VM to share your host directory under the the path
/vagrant in the VM. To do this add the following line in the Vagrant le after the line starting with
con g.vm.box:
At this point you can start your VM by running vagrant up --provider vmware_desktop and
waiting for the prompt to return. This will download the box image if it is not already available.
It will then direct VMWare to con gure a VM and use the box image as the system disk. It will
then launch the VM and run some con guration changes.
Note it can take as long as 90-120 seconds for the VM to nish launching and you may see
several retry messages as vagrant waits for the VM to setup its networking con guration.
Once the vagrant nishes launching and con guring the VM, you can login to your VM with the
command: vagrant ssh which will use ssh to log you into your new VM.
These VM images probably do not have all the libraries installed in order to build Angband. So
you will need to install them in the VM using the apt tool with the following commands:
After this follow the Angband instructions for compiling it found in the docs directory. Make
sure you follow the instructions for linux and run compile it while logged into the VM.
This will make the angband repo available to both your host laptop (in the SE1 directory) and
the VM in /vagrant/agnband. Build the angband project in the /vagrant/angband repository
while in the VM. Do not install it on the VM, but take note from the con gure.sh script output
where the support les for the angband binary are expected to be.
Installing Docker
For this second part you will install Docker for Windows or Docker for Mac according to your
laptop OS. https://docs.docker.com/desktop/
Once you have this installed, go through the Quick hands-on guide and the Getting started
Guide.
Create the Docker le in your SE1/angband repository. (This was built while in the VM.) In
addition to copying the angband les into the docker container image, you will need to set the
environment variable TERM to the value xterm-256color.
You should install the ncurses library into the container as well.
A good reference for generally building a simple Docker le, checkout the Docker Overview of
Docker le.
VM and Docker
If you want to be even more adventuresome, I recommend installing Docker into your VM and
then launching your Angband container in the VM rather than on your host.
Submission to Canvas
Create a free account on DockerHub. Submit your Angband container to DockerHub making it
publicly accessible.
Post a link to your DockerHub container into Canvas. Add a comment to the assignment telling
us whether you Docker container is built for AMD or ARM systems.
As well as loading your container URL in DockerHub, also upload your Docker le to Canvas.
You can add comments to your Docker le to explain the statements in the Docker le.