The learning objectives for Vagrant Setup Guide are:
- Setting up a local VM using Vagrant
Setup Instructions #
We are Vagrant to provision VMs. Vagrant allows us to provide a consistent VM environment, similar to your EngrIT-provisioned VM and the environment in which assignments will be graded.
Here are the steps to provision a VM on your own laptop using Vagrant:
You will first need to install Vagrant. You can do this by following the instructions at this page.
Next, you will need to download VirtualBox. You can do this by going here and then downloading the correct version for your operating system.
Next, you will need to download a Vagrantfile. The Vagrantfile sets the enviornment for your VM, so please do not modify it. The libraries configured are the exact same versions as the ones that will be used when grading. We have 2 different versions depending on the number of cores your computer has. If your computer has 2 cores, download this version. If your computer has 4 or more cores, download this version.
Next, make a directory called
cs241-vm. Move the downloaded file from step (3) into this folder, and rename the downloaded file to
Now, everything needed for your VM should be installed. Here are some commands that you will need to use to connect to your personal VM. All these commands should be run in the
cs241-vm directory (i.e. the directory that contains the Vagrantfile).
vagrant up- This command turns on and configures the VM according to the Vagrantfile.
vagrant halt- This command shuts down the VM.
vagrant ssh- You can use this command to SSH into the VM. Make sure that the VM is already running before trying to SSH into the VM.
Here’s the complete list of commands: https://www.vagrantup.com/docs/cli.
If you want to use a VScode SSH plugin to edit the files on Vagrant VM, you can configure the plugin to connect to localhost port 2222 with user name “student” (e.g.
ssh student@localhost -p 2222). No password is needed if you use the correct ssh config files.