Setting Up Your Virtual Machine

In EECS 70, we will all be using the same Virtual Machine to complete the virtual labs. The course staff have configured a Virtual Machine Image with a recent version of Ubuntu Linux, Python 2.7, and several libraries we'll be using throughout the class.

Setup Instructions

You only have to do this once. We recommend that you start as soon as possible and ask any questions you may have on Piazza.

  1. Download and install the latest version of VirtualBox on your host computer, which can be any Intel-based Mac, Windows PC, or Linux box.

  2. Download the VirtualBox Extension Pack for your VirtualBox's version and install it by double clicking on the downloaded file. This file is the same for all supported platforms.

  3. Download the VM Image (~4GB).

  4. Run VirtualBox and click File > Import Appliance (or Ctrl + I). Then select the image that you just downloaded (eecs70.ova) and click OK.

  5. Click Next, then Import. The Virtual Image is now being imported, and it will take some time.

  6. When VirtualBox finishes Importing, select the VM (which should be in Powered Off mode), and click on Start (the green arrow button).

  7. Wait for the VM to boot up and enter the password as shown on the wallpaper. You should now be able to log in to the official EECS 70 VM. Please ask on Piazza if you have any questions up to this checkpoint.

  8. Make sure you have network access by opening the Firefox browser (icon located along left screen edge when VM is running) and visiting a popular site such as Google.com. Here is troubleshooting information if you have networking issues.

  9. Highly recommended: enable Shared Folders and Copy/Paste, which allows you to view and edit files residing in the VM image using an editor on your host computer and to copy and paste text between the VM and your host computer:

This will allow you to do copy and paste between your host computer and the virtual machine. However, if you're copying from or pasting to a terminal window within the VM then you should use Ctrl+Shift-C, Ctrl+Shift-V instead of the more usual Ctrl-C and Ctrl-V.

Working on the Virtual Labs

  1. Start up the machine and enter the password as seen on the screen.
  2. Download the assignment notebook from the course webpage or on Piazza.
  3. Fill in the required functions.
  4. If IPython Notebook is still running, right click inside the terminal session and select "Open Tab". Switch to this new tab, and convert the notebook to pdf format using the command:

ipython nbconvert FILENAME.ipynb --to latex --post PDF --SphinxTransformer.author='YOUR NAME HERE'

  1. You can check out what the pdf looks like inside the VM with the command evince FILENAME.pdf.
  2. Email the pdf to yourself, or Dropbox/Github/scp/etc. it back to your host machine for submission. Please do NOT make your code public under any circumstances.
  3. When you're ready to quit, select Close from the VirtualBox Machine menu. You have three choices of what to do with your VM state.

OPTIONAL: Don't like working in the VM?

Note: The instructions below are best served for Mac or Linux users. If you use Windows, you are encouraged to work inside the VM, or you may want to consult Google for similar instructions on Windows.

Good news -- you can still work on your local machine using your own browser! Follow the instructions below.

Setting up SSH

  1. Select your VM inside VirtualBox Manager.

  2. Go to Settings > Network > Adapter 1 > Port Forwarding.

  3. Add a new rule with "name => ssh, protocol => TCP, Host Port => 3022, Guest Port => 22", and everything else BLANK.

  4. INSIDE your VM, install the ssh server with sudo apt-get install openssh-server. If it's already installed, that's fine.

  5. SSH Command: ssh -p 3022 eecs70@127.0.0.1

SCP command: scp -P 3022 eecs70@127.0.0.1:~/VM_DIRECTORY_NAME LOCAL_DIRECTORY_NAME

  1. Enter the same login password when prompted

  2. Optionally, you can look into SSH-ing without a password. There are many tutorials on the web, one of which can be found here.

Accessing notebook from host system

  1. Add another rule to Port Forwarding with "name => ipython, protocol => TCP, Host Port => 8888, Guest Port => 8888", and everything else BLANK.

To help double check that you get everything correctly, here's a screenshot of what you suppose to see after adding the above rule:

  1. To start the notebook, run ipython notebook --no-browser --ip='0.0.0.0' instead since the guest system won't expose 127.0.0.1 to other machine in the LAN.

  2. Open localhost:8888 on your host browser, you will see the notebook page. Congrats, you can now work in your local browser!

SSH Config File

If the ssh command is too long to type, put everything in a config file.

  1. The config file is ~/.ssh/config, if it is not there, just create one.

  2. Put the ssh host in the config file in the following format, notice the blank before User, Hostname, Port is a tab:

Host vm70
    User eecs70
    Hostname 127.0.0.1
    Port 3022
  1. Just type ssh vm70 to ssh into the VM. You now have a super efficient (and a bit overkill) setup to complete the lab! Keep these configurations and instructions for your upper division classes.

Frequently-asked Questions

Q: I have an error installing Virtual Box / I can't get my VM to boot.

A: Sorry, but this is out of our reach. Your best bet is to consult Google.

Q: I'm following the instructions, but I get an error at step X. Help!

A: In this case, please also try to Google first. Chances are the problem has been solved (many times) in the past. If you find a fix, please post it on Piazza and share it with everyone. You are a wonderful human being for helping your classmates and instructors.

If you can't figure out what is going on, post on Piazza and make sure to describe the error in detail.

Q: How do I copy the lab and/or writeup back to my local machine for submission?

A: There are many ways. An easy solution would be to email it to yourself or upload it somewhere (Dropbox, Github, etc.) but please do NOT make it public. If you want, you can set up SSH/SCP (as seen in the Setting up SSH section), and scp your files back and forth.

Q: Ubuntu is prompting me to update or install a new package. What should I do?

A: If Ubuntu is prompting you to upgrade to its latest version (14.04 as of this writing), do NOT do it. Chances are upgrading will mess up a few different packages and may cause you problems completing the lab.

However, if Ubuntu is prompting you to update a few software packages (Firefox, etc.), then it doesn't matter if you do it or not. If you want to play it safe, don't update anything and just go with what we originally gave you. We will let you know via Piazza if there is a need to update any package.

Q: I think I found a better way to do step X / a typo in the instructions

A: Please let us know ASAP!

Acknowledgments

Much of the instructions above are borrowed from CS 169 and CS 194-16.

We would also like to thank Yan Zhao, Victor Lymar, and Sridatta Thatipamala, all CS 194-16 students in Spring 2014, for sharing the instructions on working on the host machine.