Setting up a development environment

This guide will help you get set up using the COMP3301 virtual image inside VMware Player, which you will use for assignments 2 and 3 and their associated practicals.


Set up the basic image

First, you must download the image off the EAIT labs network. There are two ways to do this, as shown on the Resources page (if you are on your own computer, you must use SCP to copy it). Download and extract it to a USB HDD or your own computer - do not put it on your student drive or the local labs computers!

If you are on your own computer, you must now install VMware Player (if you don't already have it). Again, follow the instructions on the Resources page. If you are using the EAIT labs computers, they already have it installed.

Once installed, open VMware Player and browse for the COMP3301-VM.vmx file to add the existing machine and start it. Once the machine has started, you can log in to the machine using the username and password comp3301.


Please note that marking of assignments 2 and 3 will take place on a clean image that is provided on the course website, so we highly recommend you do not update any packages or the kernel on your development machine! Do so at your own risk!


Virtual machine networking

You may notice that networking does not initially work in the virtual machine. Try and look around the system and find out why this is the case. Hint: try using tools such as ping, ifconfig, etc. Once you have figured out what the problem is, follow the instructions on the Resources page to fix this.


Subversion checkout

Before starting on any assignments, it is recommended you checkout and set up your Subversion repository. A Subversion cheat sheet is available for your reference.

Check out a working copy of your repository and create a tracked directory test. In it, create a simple Hello, world program with a Makefile that will build it. Confirm that it compiles and runs with no warnings or errors (you should always compile with the -Wall compile flag to gcc). Make sure you commit any .c files and your Makefile to the test directory.

Try checking out a fresh copy of your repository in another directory and confirm your test program still works. If it doesn't, maybe you forgot to commit part of your source?

Now, create a tracked directory called a0 in the root of your repository. This is where you will keep your assignment 0 source code files. Try checking out the directory specified in the assignment 0 specification (substituting your own student number) to make sure you've placed the a0 subdirectory in the correct location. You may lose marks on assignments if you don't use the expected directory structure.


SSH access to the virtual machine

You've probably noticed how cumbersome it is to do development directly in the virtual machine console in VMware player. We recommend you SSH in to your virtual machine from the host using PuTTY (on Windows) or ssh(1) (on Linux/Mac). You should be familiar with using SSH from previous courses. Find out the IP address of the virtual machine (hint: the interface should be called eth0) and try and connect to it from your host machine.


Recommended editors

We highly recommend using a Unix editor such as vim to develop your assignments. It can be set up with syntax highlighting and auto-indenting to make following the style guide trivial. Try setting up a basic .vimrc that switches syntax highlighting and auto-indenting on.

Please do not check in any code with Windows line endings, it makes our jobs as markers more difficult as we have to convert your code to Unix line feeds before we can look at your code! Think of the people who are awarding you marks before using a Windows editor!