Go to https://www.virtualbox.org/wiki/Downloads and download VirtualBox for your computer. Also download the VirtualBox Extension Pack. Install VirtualBox, then the Extension Pack.
Go to http://www.ubuntu.com/download/desktop and download Ubuntu; I recommend that you download version 12.04, 64 bit, which will match the version in the lab.
Start VirtualBox, and click on the "New" icon.
Enter "Ubuntu 64" in the box marked "Name". The version setting should automatically become "Ubuntu (64 bit)". Click "Next".
If the version is "Ubuntu" and "Ubuntu (64 bit)" is not available on the menu, then continuing to install Ubuntu will fail with a message like "This kernel requires an x86-64 CPU, but only detected an i686 CPU.". There are two ways to fix this.
One is to change a setting in your computer's BIOS. This typically involves pressing a key when your computer first starts to boot up; unfortunately the key varies by computer: it could be the enter key, an F key like F10 or F12, or some other key. Some computers will tell you which key to press during the boot process, some won't, in which case you can try google. Once into the BIOS setup, you need to find a setting to turn on "Virtualization support". Again, there is not much consistency among computers about where this is or exactly what it is called. Now when you start VirtualBox, before trying again to install Ubuntu, click on the "General" heading in the VBox window and make sure the version seclected is "Ubuntu (64 bit)".
Method two is to download the 32-bit version of Ubuntu and install it. It is unlikely you will notice much difference for the purposes of this class.
Choose the memory size, depending on your system memory. Keep the slider in the green range; I recommend at least 1024 MB. Click "Next".
Choose "Create a virtual hard drive now"; click "Create".
Choose "VDI"; click "Next".
Choose "Dynamically allocated; click "Next".
Choose at least 8 GB for the disk size; I recommend 16 GB. Click "Create".
In the main window, make sure "Ubuntu 64" is highlighted, and click "Storage". Under "Controller: IDE" click the CD icon marked "Empty". At the far right of the window, click the CD icon and choose "Choose a virtual CD...". Find the downloaded Ubuntu ISO file and select it. It should now appear beside the CD icon in the Storage window. Click "OK".
In the main VirtualBox window, click "Start" (the large green arrow). Follow directions to install Ubuntu. After installation is complete, you will be told to restart the virtual machine, first by clicking a button, then you should be told to press enter. If this all happens properly, the Ubuntu CD image should be detached, so that a reboot of the virtual machine will use the newly installed Ubuntu instead of the CD. If the restart puts you right back in the install CD, do this: From the "Machine" menu, choose "Close" and then choose "Power down the machine". In the main VBox window, click on "Storage", then click to highlight the Ubuntu CD, then from the menu at the upper right (with a CD icon) choose "Remove disk from virtual drive". Finally, click OK and start the virtual machine.
After installation is finished, and you are logged in to your virtual machine, choose "Install Guest Additions" from the "Devices" menu, and follow instructions. When complete, you may right-click the CD icon in the dock and choose "eject".
In a terminal window, give this command:
sudo apt-get install emacs g++
You will be asked to enter your password.
This will install the emacs text editor and the c++ compiler.