Installation Instructions: Go Virtual Machine
Programming Language Paradigms

Requirements

To install and configure the Go virtual machine for PLP, you will need:

Installing VirtualBox

  1. Go to the downloads page for VirtualBox.
  2. Select and save the binary installer for your platform (direct links for Windows, Mac). Note: The installer should be around 75MB for most platforms. These files are hosted off campus. We are not using VirtualBox Open Source Edition.
  3. Run the installer, accepting all default installation options.
    1. If you are on Windows, there will be a warning about installing network interfaces; you must accept this warning to install, and you will be temporarily disconnected from the network during the process.
    2. If you are on Windows Vista or Seven, you will likely also encounter popups from UAC about virtual device drivers; accept them all. (I got four warnings on a vanilla Seven host.)

Installing the Ubuntu appliance

  1. Download the two files that are necessary to build the Go virtual machine (both hosted on campus):
    1. The virtual appliance file, which contains VirtualBox settings and information necessary to create the VM (about 13K)
    2. The virtual disk file, which acts as the hard drive for the virtual machine (about 1.2G)
    Be sure to download these two files to the same directory, and do not change the file names.
  2. Open VirtualBox
  3. Click File → Import Appliance... to open the Appliance Import Wizard
  4. On the first page, click Choose..., select the PLP-Ubuntu-Go.ovf file downloaded above, and click Next
  5. On the next page, simply click Finish
    1. VirtualBox will import the plp-ubuntu-go.vmdk disk file into its installation directory. Just wait for this process to finish.
  6. The virtual machine should now be ready to run. As downloaded, the VM contains:
    1. A 32-bit install of Ubuntu 10.10 Maverick Meerkat (Note: very few settings have been changed, so performing updates will count against your bandwidth)
    2. VirtualBox Guest Additions for Ubuntu
    3. The build-essential package and all its dependencies, for a complete C environment
    4. Subversion and the Linux GUI client RapidSVN
    5. Mercurial, a distributed source control system
    6. gVim and emacs, a pair of graphical text editors
    7. And of course Go itself, in the ~/go directory
    Your shortname for the installation is gouser and the password (for sudo purposes) is gopass.
  7. Once the appliance is fully imported, launch the virtual machine by clicking Start

Hello, Go

A basic "Hello, World" program has been provided inside the Documents folder in your home directory. This section walks you through compiling and running that file.

  1. Open a Terminal window from the console icon in the taskbar.
  2. Navigate to your Documents folder: cd Documents
  3. Compile, link, and run the Go source file (yes, compile and link are two separate steps):
    $ 8g hello.go 
    $ 8l hello.8 
    $ ./8.out hello, world 

Machine Configuration

At this point, your VM should be ready to Go. However, it will be more convenient if you have network access from your VM. Follow these steps to set that up: