If you choose not to use Docker and you don’t have access to a Linux host, you may want to set up a virtual machine solution, like VMware Workstation, VMware Fusion, or VirtualBox, that will allow you to run a virtual graphical Linux host on your existing computer. Compared with Docker, virtual machine solutions are heavier weight and take more space on your machine, but they offer a full graphical Linux desktop environment, which can be fun.
VM setup requires that you:
- Choose and install virtual machine monitor software (e.g., VMware or VirtualBox).
- Download a base Linux distribution (e.g., Ubuntu 20.04.1 LTS).
- Create a virtual machine from that base Linux distribution.
- Boot that virtual machine and install software needed for CS 61.
Install a virtual machine monitor
A virtual machine monitor, or VMM, is a piece of software that allows you to run another operating system “virtually,” inside your base operating system. For example, you can run Linux inside Windows.
We have had good experiences with a commercial VMM called VMware. VMware’s Mac OS X product is called VMware Fusion, and its Windows product is called VMware Workstation. These products are not free, but you can get an academic license to use one for the duration of the class. You can also use a freely-available VMM, such as Oracle’s VirtualBox.
To obtain VMware:
Fill out this Google form with your name, e-mail, HUID, etc, requesting the latest version of VMware for your computer platform (VMware Fusion for Mac OS X, VMware Workstation for Windows, or (rarely) VMware Workstation for Linux). You will receive an account at the VMware Software Center once your request is approved. This step is manual and it may take up to one business day for you to receive a response.
Your account at the VMware Software Center will have user name and initial email address both set to your Harvard email address.
The VMware Software Center is set up like a store. On the “store front” page, select the latest version of the VMware product you need for your platform (Fusion or Workstation for Windows). If you see both a free and a non-free offering of the product, choose the free one.
Click the Add to Cart button, then proceed through the check-out process until you reach a screen with a Start Download button. Click the Start Download button to download the installer.
On the store front page, click on Your Account/Orders under the Hello, <your email> menu. Click on View Details to see your Serial Number or Product Key. You will need that information to run VMware.
If you’re installing Fusion:
Click on the file you downloaded to mount the VMware Fusion icon on your desktop.
Click on the VMware Fusion (or VMware Fusion.app) icon in the new window, click Open if prompted, and type your password if prompted. Follow the instructions to install Fusion. When prompted for a license key, use the serial number generated for you by the VMware Software Center.
If you’re installing Workstation for Windows:
- Click on the file you downloaded and launch VMware Workstation’s installer. If you are asked whether to allow the installer to make changes to your computer, enter your password, and click Yes.
- A window entitled Welcome to the VMware Workstation Pro Setup Wizard should appear. Click Next.
- When prompted with a license agreement, select I accept the terms in the license agreement, then click Next.
- You'll next come to a Custom Setup window. You need not change the Install Location. You'll probably want to select Enhanced Keyboard Driver, and then select Next.
- On the next screen, User Experience Settings uncheck the Help improve VMware Workstation Pro box and click Next.
- When prompted about Shortcuts, leave both boxes checked and click Next.
- You'll now come to the Ready to install VMware Workstation Pro screen; select Install. It will take a minute or two for the installation.
- When you come to the Completed the VMware Workstation Pro Setup Wizard screen, click on License, and paste the license key that you got from the VMware store. Then click Finish.
Download a base Linux distribution
We recommend the latest Ubuntu LTS release or later, such as Ubuntu 20.04.1 LTS (Focal Fossa) or even the latest beta release of Ubuntu 21.04. You can download Ubuntu here. Note that Ubuntu is free and you don't need to make a donation. This is a large download.
Create a virtual machine
Launch your VMware product.
Create a new virtual machine (for instance, with File > New or File > New > Virtual machine).
Select “Install from disc or image” and use the Ubuntu
.isofile you downloaded.
Use Easy Install to set a display name, account name (username), and password like you would on any computer. Don’t forget your password!
You may want to Customize Settings to choose the location of your virtual machine and to allocate it enough memory. You want at least 2 GiB (2048 MiB) of memory and 2 processor cores.
Windows note: Do not store your virtual machine in your OneDrive! Students have experienced serious problems with virtual machines that were stored in OneDrive.
Power on the virtual machine and go!
Install CS 61 software
We will be using the GNU C++ compiler (g++) for our C++ projects. The C++ compiler is not installed by default. Here is how to install it in your VM:
$ sudo apt update
$ sudo apt install g++
This will install the GNU C++ compiler,
g++, to the system. Once done,
verify that you've got the compiler correctly installed by running
$ g++ --version
You will see output indicating the correct version of the C++ compiler is now installed. We are hoping your compiler will be version 9 or above.
Then run the following command to install tools we will be using throughout the course:
$ sudo apt update
$ sudo apt install git kcachegrind linux-tools-generic qemu
When prompted, type y and hit Enter to approve the tool installations, and then you're ready to hack!