Virtual Box Installation and Setup

This guide walks through the process of setting up VirtualBox for CS 5007.

Step 0: What is VirtualBox? Why do I need to do this?

All the students in this class have laptops and/or computers, but not everyone has the same setup. We use what's called a "Virtual Machine" to ensure that everyone has the same computing experience, and that it matches that of a Linux machine that has the capabilities we need for the course.

With these virtual machine instructions, you can all have the same experience on your own machine.

Virtual machines (https://en.wikipedia.org/wiki/Virtual_machine) are emulated computer instances running inside a special program you install on your desktop or laptop computer (which we call the host machine). The virtual machine can run a completely different operating system than its host - for example, you could run a Linux or a Windows 10 virtual machine on your Macintosh laptop, or a Linux virtual machine on your Windows machine.

How Does It Work?

Virtual machines run inside some other program. There are numerous applications, on most platforms, that fulfill this need. The instructions here are for VirtualBox. We'll evaluate your assignments and provide code using VirtualBox, but other options are available-- in particular, VMWare is a good option if VirtualBox is not working for you.

If you have any issues with installing and running VirtualBox, reach out to course staff for help.

Step 1: Download Ubuntu

Ubuntu Download

Step 2: Download VirtualBox

VirtualBox download

Step 3: Create a new box for this class

Step 4: Set up the new box

Now,
  1. Click the little button (upper left hand corner) and search for “terminal” to launch the terminal.
  2. At the command line, enter the following commands to install the important tools:
    sudo apt-get update
    sudo apt-get install vim build-essential 
    sudo apt-get install emacs
    sudo apt-get install openssh-server
    sudo apt-get install git
    sudo apt-get install valgrind
    


  3. Enable Copy/Paste from the host machine (your laptop) and the guest machine (the virtual machine you just created):
    • Shutdown your machine with Cmd + Q or Ctrl + Q (quit).
    • (You can choose "Save Machine State")
    • In the VirtualBox console, right-click your virtual machine and select Settings
    • Select General at the top, and then the Advanced tab.
    • Where is says "Shared Clipboard", select "Bidirectional", then click okay.
  4. Start the virtual machine.
    • When it starts, go to the Devices menu.
    • Select "Insert Guest Additions CD..."
    • Follow the instructions
  5. Restart the machine
    • To paste into ubuntu, use Ctrl + Shift + V
    • To paste into Emacs use Ctrl + y (to "yank" stuff from the clipboard).
    • To copy in Ubuntu, use Ctrl + Shift + C.

Step 5: Run some code to check it all out

Now, you can try re-creating HelloWorld from class to ensure everything works.

Step 6: [Optional] Run VirtualBox in headless mode and ssh into it

The VirtualBox UI can be pretty slow and cumbersome. You can use the VirtualBox OS by running it in headless mode, sshing into it, and working on the command line.

Links to help:

Last updated: 5 July 2018