A virtual machine (VM) is in some ways a simulation of a physical machine. You will need special software to run a VM on your personal computer. To run a VM, you can use either VMware Player (VMware Fusion on Mac) or Virtual Box, although we suggest the former.
Please follow the instructions for your platform.
Go to http://www.vmware.com/products/player/ and click on 'Download'. Follow the instructions to register with VMware, activate your account, and bring up the download page. Click on the 'Download' button that corresponds to 'VMware Player 3.1.3 for 32-bit and 64-bit Windows'. When the download completes, run the executable, and follow instructions to install VMware Player on your machine. Restart Windows to complete the installation, as instructed.
Proceed to downloading the VM.
Go to
http://www.vmware.com/products/player/ and click on 'Download'. Follow the
instructions to register with VMware, activate your account, and bring up the
download page. Click on the 'Download' button that corresponds to 'VMware Player
3.1.3 for 32-bit Linux' or 'VMware Player 3.1.3 for 64-bit Linux', depending on which
version of version of Linux you're running. When the download completes, open up
a command prompt and cd to the directory containing the downloaded
bundle. This bundle is actually a bash script, so you can execute it by running
sudo bash VMware-Player-3.1.3-324285.i386.bundle
Note that you will need root access to complete the installation.
Follow instructions to complete the installation of VMware Player on your machine.
Proceed to downloading the VM.
VMware Player is not available for Mac OS X. Instead, VMware Fusion can be used to run VMs on a Mac. Although Fusion is not free software, you can get a free copy you can use for the course. Follow these directions:
Note that at the end of the download (on your order summary page) you will get a serial number that you will need to enter after installation.
Proceed to downloading the VM.
If you're set on avoiding VMware products, you can try VirtualBox. We aren't as familiar with it, so you'll pretty much be on your own. You can download VirtualBox binaries here.
Once you are done installing VirtualBox, follow the steps below to boot up your virtual machine. These steps are only tested to work on Mac.
Now that you've installed software that can run VMs, you need an actual VM to run. As such, you need to download the VM from the course page. Note that the downloaded file is actually an archive (.zip) file, so you will need to unzip this file to extract the VM materials from it. This should be straightforward on Mac, Linux, and Windows machines. Unzipping the file should yield a directory containing the VM. Make sure this directory is placed in a safe place on your computer (where you would not accidentally delete it). You are now ready to boot up the VM.
Run VMware Player. If your computer is running Windows, the installer will have placed a shortcut either on your Desktop or in the Programs menu. If your computer is running Ubuntu, then the installer will have placed a shortcut under Applications->System Tools. Accept the EULA (you have no choice — bwahaha). When VMware Player comes up, click on 'Open a Virtual Machine'. Navigate to the directory ("CS110-Ubuntu") that contains the VM and select the .vmx file in that directory. Lastly, click on "Play virtual machine". Your VM should now boot into Ubuntu (a distribution of Linux). The default username in this installation of Ubuntu is 'cs110'.
You are almost there! You just need to get the starter code onto your VM so you can actually work on the assignments.
In previous quarters, we recommended that students link their AFS directory
to the VM. (If you've never heard of AFS, we're referring
to the networked filesystem on which your Stanford home directory and the
/usr/class/cs110 directory, among other things, are stored. Don't
worry about the details.) Many students have experienced poor performance using
AFS inside the VM. We haven't been able to diagnose or fix these problems, so
we now recommend that you avoid AFS altogether.
To develop locally, you'll need to download the starter code to your VM. To properly run and test your code, you'll also need to download the test disks for each assignment (except assignment 2, which has no test disks). These instructions were written for assignment 1, but they should apply equally well to the other assignments.
To get the starter code, you'll have to download the appropriate archive from the course website. Each assignment's archive can be found in that assignment's directory:
/usr/class/cs110/assn[#]/assn[#].tar.gz
Perform the following actions in a terminal in the VM.
cd to a directory where you'd like to store the
CS110 assignments (e.g., ~/cs110). archive:
wget http://www.stanford.edu/class/cs110/assn1/assn1.tar.gz tar -xzf assn1.tar.gzTo be able to run and test your code on the VM, you'll have to copy the
testdisks folder over to the VM. The test disks for each assignment
can be found in that assignment's directory:
/usr/class/cs110/assn[#]/testdisks.tar.gz
Perform the following actions in a terminal in the VM.
cd to the assignment directory (e.g., readfiles
for assignment 1).testdisks archive (Note that the assignments do
not all use the same test disks. Make sure you use the assignment 1 test disks
when working on assignment 1, and so on.):
wget http://www.stanford.edu/class/cs110/assn1/testdisks.tar.gz tar -xzf
testdisks.tar.gzYou have successfully configured your own VM that you can use for all of the assignments in this class. Note that, in contrast to developing on the cluster machines, your materials are stored locally on the VM. Although you're not relying on network connectivity and can work on the assignments offline, you're also left to your own devices with respect to data availability and backup. If you're not regularly backing up your machine's hard drive, we at least recommend periodically saving your code somewhere (copied to one of the cluster machines, a flash drive, etc.). We won't have mercy for accidental deletion of your source code.
To submit from the VM, you'll have to make a tarball (a .tar.gz archive) with all your work. Since this can get complicated, we put together a script to take care of this work for you. Here's how to submit from the VM:
cd to the assignment directory (e.g., readfiles
for assignment 1).wget
http://www.stanford.edu/class/cs110/scripts/make_tarball.shchmod +x
./make_tarball.sh./make_tarball.sh
numnum is the assignment
number (1 through 4).
make_tarball.sh
script and not the tarball that you originally downloaded when you
started the assignment.You can check the status of all submissions you have made this quarter on this page.