Lab 0: Set up working environment
We will write, build and run C programs via the terminal on Linux machines.
If you are not familiar with Linux/UNIX or termnial, here is a good online tutorial:
UNIX Tutorial for Beginners
- Connecting Remotely
You should make efforts to attend the discussion sessions, but if you are unable to attend you can connect to our machines remotely. We have two Linux servers that are accessible outside of the BU network: csa2.bu.edu and csa3.bu.edu. These two machines are similar to the Linux machines provided in the undergraduate lab. You can connect to them using SSH. A detailed SSH tutorial to make your life easy.
- Connecting from Mac OSX
Open Terminal.app command, and type in the ssh command:
$ ssh {kerberos_username}@csa2.bu.edu
- Connecting from Windows
The PuTTY application is used to connect to a server via SSH (Download and install PuTTy.) Enter csa2.bu.edu or csa3.bu.edu into the server field and your kerberos username in the user field, and connect.
- Working on your home computer
If you love your Windows or MAC so much, you are free to use your own coding environment. However, it is better to test your code on one of BU's Linux machines to make sure it can run correctly on our grading machines before you submit your code.
- Working Directly on Windows
You can install Cygwin, which provides common shell and GCC tools that you'd find on the BU Linux systems. Make sure the following packages are checked and installed: gcc4, make, man, curl, openssh, rsync. Here is a Cygwin tutorial.
- Working Directly on MAC
Since OSX is based on Unix, the OSX terminal should recognize most of the same commands as the Linux server. However, some additional programs we'll use (like GCC and Make) will need to be installed onto your machine via Command Line Tools for Xcode (AppleID required). The command line tools are just as good as Xcode for programming C and take up far less disk-space, so get those unless you already have Xcode installed. If you installed Xcode from the App Store, the Command Line Tools are an optional installation. You'll need to enable them under Preferences > Downloads.
-
Working on a virtual Linux OS (Recommended)
You can download and install VirtualBox for free from here. VirtualBox enables an OS (guest OS) to run inside
another OS (host OS). VirtualBox is installable in different host
OSs including Windows, OS X. Download and install the latest VirtualBox for your own laptop's OS.
Then, you can download our pre-installed Ubuntu 16.04 (it is a distribution of Linux) for VirtualBox from
here.
You can then go to File-> Import Appliance->Select the downloaded Linux32-Ubuntu16-CS210.ova file. Your virtual Ubuntu 16.04 should be ready in VirtualBox.
You can follow the link to share a folder
between your virtual Ubuntu 16.04 and host laptop's OS (Windows or macOS). Sharing a folder lets you use the same files between your laptop's OS
and the guest Ubuntu 16.04.
You can also use any other Linux distribution, instead of Ubuntu.
- Transferring your files to a Linux machine
Similar to SSH, there are a command-line tools for directly uploading files and directories via the terminal: Secure Copy (scp), rsync.
...and if all else fails, email the source files to yourself.
Most credit goes to Zhuoqun (Tom) Cheng, Jim Cadden and the authors of CS111 labs for organizing the material.
Edited and prepared for the class by Sasan, Rich and Soham.