0% found this document useful (0 votes)
19 views5 pages

VM and Docker

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

VM and Docker

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Virtual Machines and Docker

Building Angband in a VM and


Container
Building Angband in a VM and Container 1
What to do with your VM 2
Start a Virtual Machine 2
Compiling and Running Angband in a VM 2
Installing Docker 4
Running Angband in Docker 4
VM and Docker 4
Submission to Canvas 5

1 of 5 Fall 2024 P465/565












Virtual Machines and Docker

What to do with your VM


For this assignment, once you have started you virtual machine, you will install the Angband
repository in the VM under the vagrant account and compile the Angband within the VM.

Start a Virtual Machine


Vagrant makes creating a VM easy but providing web accessible VM disk images known as
Vagrant Boxes. These images are provided by supporting organizations like Ubuntu and
devops enthusiasts. Always pay attention to the source of the box image.

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.

vagrant init generic/ubuntu2204

For Apple Silicon based Macs (those with M1, M2, or M3 chips), you must use an ARM
compatible box image. Run the following command:

vagrant init gyptazy/ubuntu22.04-arm64

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:

con g.vm.synced_folder ".", "/vagrant"

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.

Compiling and Running Angband in a VM


Once logged into the VM, you can clone the Angband source directly into a directory in the VM
or into the your host directory from which you launched the VM. The former will increase the
size of the VM disk image, the latter will use your host storage directly.

2 of 5 Fall 2024 P465/565



fi
fi

fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
Virtual Machines and Docker

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:

sudo apt update


sudo apt upgrade
sudo apt install gcc automake make libncurses5-dev libncursesw5-dev

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.

Clone the Angband repository into your VM's /vagrant directory:

git clone https://github.com/angband/angband.git /vagrant/angband

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.

3 of 5 Fall 2024 P465/565




fi
fi
Virtual Machines and Docker

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.

Running Angband in Docker


After getting acquainted with the getting started material, cd back to the directory from which
you launch the Vagrant VM and built angband. (This assumes you cloned Angband to your host
rather than into the VM.) Create a Docker le in your repository to build a Docker le to run
Angband. You probably will want to start with an Ubuntu docker container.

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.

Test your Docker le by running Angband via a container.

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.

4 of 5 Fall 2024 P465/565




fi
fi
fi
fi
fi
fi
fi
Virtual Machines and Docker

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.

This is worth 100 points an is an individual assignment.

5 of 5 Fall 2024 P465/565




fi
fi
fi

You might also like