You are here: Home / Past Courses / Fall 2012 - ECPE 170 / Tutorials / Virtual Machine Setup

Virtual Machine Setup


All labs and programming projects in this course will be done on Linux, in order to prepare you for future CS courses (and employers) that use a diversity of computing systems. Your first assignment in class is to build your own Linux system. We will do this together in class before the first lab. There are two options available to you:

  1. Run a Linux virtual machine on your personal computer by using software like VMWare Player (PC-Free), VMWare Fusion (MAC-$$, but free to Pacific students), or VirtualBox (PC or Mac, and free!)
    1. Requires a computer with at least 3GB of RAM (to be comfortable), and 20+GB of disk space
  2. Dual-boot your personal computer (Linux + your existing operating system)
    1. Requires a less capable computer than the virtual machine option, because only one operating system will be active at a time
  3. No laptop / no computer? Contact the instructor for alternate methods to complete ECPE 170


There are many different variants of Linux available, called "distributions". Examples include "RedHat", "Ubuntu", "Debian", "Mint", "openSUSE", and many others. While the core operating system functionality (the "kernel") remains the same, each distribution bundles the kernel with a different mix of software.

The chosen Linux distribution for ECPE 170 is:  Ubuntu 12.04 Long-Term Support (LTS) edition, released April 2012
(pick the 64-bit version by default, unless you know you only have a old 32-bit processor)

Alternate Linux distribution for older computer systems: Xubuntu 12.04 Long-Term Support (LTS) edition

Do you have a different favorite Linux distribution? All of the projects use an extremely common set of tools, and thus should work across any and all Linux distributions of a recent vintage. You are more than welcome to use any distribution you see fit, but be warned that you are responsible for fixing any problems that arise!


OS Installation

If you already have a functioning Linux distribution installed on your laptop, then your homework is complete. If not, read on to install VirtualBox with Ubuntu.

VirtualBox is a virtual machine manager that makes it possible for you to run multiple operating systems on your computer at the same time.

  • Download the VirtualBox installer for your Platform (Windows/Mac/Linux)
  • If you already have VMWare Fusion (Mac) or VMWare Workstation, feel free to use that.

Ubuntu is a popular Linux distribution.

  • Download the .iso (disk image) file containing the installer for Ubuntu Linux, version 12.04, 64-bit edition


Step 1: Install VirtualBox

Step 2: Install Ubuntu Linux into VirtualBox

  • Create a new virtual machine that has been allocated 2GB of RAM, 20GB of disk space, and 2 CPU cores.
  • Point VirtualBox to the installer .iso file for Linux
  • Let the installer run!


The Ubuntu installer is very simple. Here are some key screen snapshots as I worked my way through the installer on my laptop. (Using VMWare Fusion on Mac)


Application Installation

In Ubuntu, login and launch the command prompt (aka Terminal). The keyboard shortcut is <CTRL><ALT><T>. Or, you can search for "Terminal" by clicking on the Dash button in the upper-left corner (i.e., the Ubuntu equivalent of the Windows "start" button).

For the rest of this course, commands to enter at the terminal are going to be given in the following format:

unix>  This is the command that you should enter

The "unix>" part of the line should not be typed in, and it will not look the same on your computer. Rather, it might look something like this:  "username@computername:/current-directory$", i.e. a combination of your username, computer name, and the current directory you are in.  Thus, it will be constantly changing as you work!  To simplify tutorials, this is written as "unix>"



The following commands refer to installing software on the computer.  Let's break these commands apart:

  • sudo:  sudo allows you (a regular user) to run a command as an Administrative ("root") user by typing your password. Everything that comes after sudo is the command to run as an Administrative user. Administrative access is required to install software.
  • apt-get:  apt-get is a utility that can add or remove software programs.  Anything that comes after apt-get changes the behavior of this utility: Are we installing or removing software? What specific software?


If you are using VirtualBox, install the "guest utilities" drivers to improve the performance and integration of your new virtual machine.

unix>  sudo apt-get install dkms virtualbox-ose-guest-utils virtualbox-guest-additions-iso
(Enter your password so that sudo can run the command as Administrator)
(Type Y for YES when prompted to begin installation)
unix> sudo reboot 

If you are using VMWare Fusion or VMWare Workstation instead, install a different set of drivers to improve performance and integration.

unix>  sudo apt-get install open-vm-tools open-vm-dkms
(Enter your password so that sudo can run the command as Administrator) 
(Type Y for YES when prompted to begin installation)
unix> sudo reboot

Note: I've had problems with these "open-vm" tools not fully supporting nice features, like copy-and-paste support between guests. See me if you're using VMWare Fusion and want to manually install the standard VMWare tools.

If you are dual booting your computer, you don't need to install any of the special virtualization drivers. Proceed to the next step.


Login and launch the command prompt again via CTRL-ALT-T.

Update all programs on the system to the latest versions. The 'update' commands gets the list of latest programs, and the 'upgrade' command downloads and installs them. There may be a lot of files to download!

unix>  sudo apt-get update
(Enter your password so that sudo can run the command as Administrator)
unix>  sudo apt-get upgrade 
(Type Y for YES when prompted to begin installation) 

As long as we have the command prompt open, go ahead and install some software that we will use later in the semester.

  • mercurial is a version control system
  • strace is a utility that intercepts and logs calls that applications make into the operating system
  • valgrind is a utility that monitors program memory usage and looks for leaks and other bugs
  • kcachegrind is a GUI display utility for valgrind traces
  • linux-tools includes the perf utility that monitors performance counters in the processor
  • ttf-mscorefonts-installer includes some Microsoft fonts frequently used
  • python-matplotlib installs a Python-based math / graphing engine
  • ghex is a file viewer (at the byte level)
  • iotop is a monitor for disk activity
  • gedit is a text editor. It comes with Ubuntu, but I include it here for anyone running a different Linux distribution.
  • libreoffice is a Office suite (similar to Microsoft office).  It comes with Ubuntu, but I include it here for anyone running a different Linux distribution.
unix>  sudo apt-get install mercurial strace valgrind kcachegrind linux-tools ttf-mscorefonts-installer python-matplotlib ghex iotop gedit libreoffice

Note: For the font package, use the <TAB> key and <ARROW> keys to select between the various options on the text-based installer.


Your virtual machine should now be ready for use. Enjoy!