Setting up Virtual Box

Adapted from material by David Chiu.

C is highly dependent on the compute environment on which it compiles and executes. This is everybody's worst nightmare: turning in an assignment you spent hours on, only to have it not compile or execute on your instructor's machine. In fact, having a common runtime environment was what made Java so successful when it was introduced in the mid-90s.

In this section, we will install Ubuntu Linux on a virtual machine so that every student will have a common environment. Important: all programming assignments should be written and submitted from this virtual machine.

  1. Download and install Oracle VirtualBox. Note: the current version at the time of writing is version 6.0.

  2. Download the following VirtualBox image:

  3. Open up VirtualBox. Then click on the File > Import Appliance... menu. Browse and find the develop-end-ubuntu.ova file you just downloaded, then click Continue.

  4. This brings up the Appliance Settings window. Important: Do not click to enable "Reinitialize the MAC address of all network cards." Click Import. This will take a little bit of time to finish.



  5. Highlight develop-end-ubuntu from the side menu, and click on Settings. From the Settings menu, navigate to Ports. Make sure that Enable Serial Port and is checked. IMPORTANT: Do not check Connect to Existing Pipe/Socket. Under Path/adress:

    • If you're on a Linux or Mac: type in /tmp/xinu_serial
    • If you're on Windows: type in \\.\pipe\xinu_com1


    Click OK to exit Settings.

  6. Double-click on develop-end-ubuntu. This will start a virtual machine (VM) running Ubuntu Linux 16.06. Think of a VM as being a program on your machine that can run a separate isolated instance of another operating system! This VM serves several important purposes for this class and for your education:

    1. You will become familiar with using Linux.
    2. You will program all your C homeworks and projects on this VM.

  7. Important for Windows Users: There is a known issue on some Windows machines that does not allow the VM to boot up or import properly. The error you receive from VirtualBox reads, "VT-X is not enabled in BIOS" or something to the effect of "virtualization is disabled". If you are experiencing this, then you need to enable virtualization in your BIOS, which is possible upon a reboot of your computer. I can help you with this, or you can Google how.

  8. Important for newer Macs with Retina display: Some people have reported sluggishness of the virtual machine, to a point where it becomes unusable. One possible solution is to go to the App Store and download ResolutionTab. Once installed, it puts a new icon on your top menu. Select a lower resolution that is NOT HiDPI.

  9. Once the develop-end-ubuntu starts up, you can login with the following credentials:

    • Username: xinu
    • Password: xinurocks
    • Note: This user has sudo access.
    After you log in, make sure you have network access to the outside world. You can open the Firefox browser from the sidebar menu. If you don't have access, let us know.


  10. You can test out a couple nice features. They've been finicky in the past though, but are huge time-savers if you get them to work.

    • Shared clipboard: Click on the Devices menu and select Shared Clipboard. Then select bi-directional. Test this out. It will save you hours of time in this course. Copy some text from your host machine, then try pasting it into this VM, and then vice-versa.
    • Drag and Drop: Click on the Devices menu and select Drag and Drop. Then select bi-directional. This has been finnicky in the past, but mostly works. Pick a file from your host machine and drag it anywhere on your VM. The file ends up in a cryptically-named folder inside "/tmp/VirtualBox Dropped Files" directory.