Readying VM for the Course

Once you have created you fresh VM, you need to get it ready for the course. Make sure you have a fast, reliable internet connection before you start.

Note: Much of this step involves setting up git, which is great tool for collaborative development and version management. We use git (behind the scene) to keep your VM up to date with the myriad of tools and data that we will use in this course. While we don’t require that you know git, we encourage you to explore it further because it can be very useful for your team project.

Follow these steps carefully:

1. Point your Web browser to the Duke gitlab website, and sign in using Shibboleth (with your Duke netid). Once you are in, click on the profile drop-down on the upper-right corner, and select “Settings” and then “SSH Keys.” A form for add a new SSH key will open up waiting for you to fill out; we will come to back to this.

2. Get a shell on your VM, and type in these commands:
wget -N http://www.cs.duke.edu/courses/fall17/compsci316/init.sh
bash init.sh
Follow the instructions. You will be asked to copy and paste your public key to the Duke gitlab website, and don’t press [ENTER] until you’ve successfully registered your public key! Make sure you copy the entire public key (which is a single line of text that starts with ssh-rsa and ends with @duke.edu, and wraps to form multiple lines). Switch back to your Web browser, paste the copied output into the text box for “Key,” enter a title for your key (anything is fine), and then submit the form. After a short while, you should see confirmation that your key has been added (if not, you will have to try adding the key again before proceeding further). At this point, switch back to your VM shell and hit [ENTER] to continue.

Note: When running init.sh, if you type something wrong and find that your [BACKSPACE]/[DELETE] key doesn’t work, just hit [CTRL]-c and re-run bash init.sh when you are back at the shell prompt.

Note: Even though the public key wraps to multiple lines when displayed, it should be copied and pasted as a single line. If for some reason it becomes multiple lines in the text box that you copied into, you just carefully delete the line breaks manually.

Note: When running init.sh, you might encounter a warning saying that the authenticity of host ‘gitlab.oit.duke.edu (…)’ can’t be established; it’s okay—just type yes to continue.

3. If all goes well, you will notice git pulling files from the course repository. Once it’s done, issue the following command in your VM shell:
/opt/dbcourse/sync.sh
This command will likely take quite a while as it installs a lot of tools necessary for the course. Throughout the course, you will need to re-run this command every now and then to keep your VM updated; we will remind you when it is necessary.

4. Reboot your VM, by following instructions from Creating and Running VM under Help.