CSCI-UA.0480-008: Lab setup and tools

Overview

You will need three pieces of infrastructure for this course:

This page walks you through the process of setting each of them up. (You will perform these steps as part of lab 0.)

Note on your working environment

CIMS account

Some of our labs will use machines administered by CIMS (short for Courant Institute of Mathematical Sciences, which is the home of the CS department). Thus, Step 1 is to make sure that you have a CIMS account. Most of you already do, thanks to the CIMS sysadmins, but check which of the following cases covers your situation:

This account is independent of your NYU NetID/home account. This account will be valid during the semester and will give you access to all of CIMS's computing resources.

Step 2 is to use your account. The two options are described below.

Computer lab

You can use the physics desktop machines in the Computer Labs in Rooms 229 and 230 Warren Weaver Hall. You can find more information about these labs here. You will want the Linux machines. Type your CIMS username and password to login.

Remote Access

If you are not on campus, then you can use ssh to gain access to both the desktops and a collection of servers that CIMS maintains. We describe the steps below. At a high level, you will be logging into a machine called access.cims.nyu.edu, and from there you will login to the CIMS machine of your choice. Please do not skip that second part and do your work on access.cims.nyu.edu; this sort of behavior is viewed as antisocial.

Follow these steps:
  1. Gain access to the CIMS machines through ssh. The Secure Shell (SSH) establishes an authenticated, encrypted session with a designated machine. You probably want to become comfortable with ssh, if you are not already. A basic guide for interacting with ssh is available below.

    The first time that you attempt to ssh to any new remote host, you can usually say "yes" to the following warning message (but if you are worried, you can check the claimed key fingerprint against the expected fingerprint, if you have it):

    $ ssh -X [username]@192.168.56.101
    The authenticity of host '192.168.56.101 (192.168.56.101)' can't be established.
    ECDSA key fingerprint is SHA256:t4YwH+injA3LLJsDPIOrclFGf3NIz1isMvahvfiZnys.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.56.101' (ECDSA) to the list of known hosts.
    [username]@192.168.56.101's password:
    ....
    

    For all users, if you have successfully logged in, you will see a banner like this:

      ############################################################################
      #                                                                          #
      #    CIMS Access Server                                                    #
      #                                                                          #
      #    ** Unauthorized access is prohibited by law! **                       #
      #                                                                          #
      #    Please do not run CPU-intensive jobs on this server.  For             #
      #    information regarding appropriate systems on which to run such        #
      #    processes, see:                                                       #
      #                                                                          #
      #           http://cims.nyu.edu/u/computeservers                           #
      #                                                                          #
      #    Users requiring a Solaris SPARC environment can login to              #
      #    crunchy12.cims.nyu.edu                                                #
      #                                                                          #
      #    If you have any questions, please send mail to:                       #
      #            helpdesk@cims.nyu.edu                                         #
      #                                                                          #
      ############################################################################
    
    Consult this list to choose a server. From access.cims.nyu.edu, type the following command:
    $ ssh -X [username]@[server].cims.nyu.edu
  2. Set up "ssh keys", which will remove some of the hassle of typing your password every time you ssh to a machine. A brief tutorial for the OS X / Linux uses is given below:

The virtual devbox

Much of what we will do in this class is hardware-specific. One way to ensure that we are all using a uniform platform is for us to use identically configured virtual machines. You can think of a virtual machine as a way to create an encapsulated machine (in our case, an Ubuntu server running on an i686 machine) on top of another operating system (the one that controls your laptop or desktop).

To get our virtual devbox running, do the following:

  1. Download and install VirtualBox on your computer of choice. (We used version 5.0.14 to set up everything.)
  2. Download the virtual devbox image to your computer. The file is roughly one gigabyte, so the initial download may take some time.
  3. Set up a "host-only" network adapter on VirtualBox
  4. Using VirtualBox, import the image you just saved ("File" -> "Import Appliance..."). Leave all of the settings at their default values. This, too, may take some time.
  5. Using VirtualBox, start up the virtual machine by selecting it from the menu and clicking the green "Start" arrow.

On approximately one-quarter of the physical machines we tested the virtual box on (all natively running Linux), the boot process appeared to hang. You can overcome this issue by pressing [Alt]+[F2] a few seconds after boot. This switches to tty2, the second input terminal (tty is short for teletypewriter), and seems to bypass the error.

Our virtual machine contains an installation of Ubuntu 14.04 Linux. The following accounts have been created on the VM.

Username Password Purpose
root cs480 Use this account when you need to install new software packages using apt-get install pkgname
httpd cs480 Use this account for everything else (including your dev work).

You can access the virtual machine directly by using its console or by using ssh to log into the box over the (virtual) network. You'll need to use ssh at some point either way, so familiarize yourself with the following instructions now. Reread this for a reference on ssh.

To determine the virtual machine's IP address (hostname) for the ssh command, you can log in as the root user on the console and run:

$ /sbin/ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:19:99:1a  
          inet addr:192.168.56.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2604:2000:1303:80c1:9de1:e218:838a:c3b5/64 Scope:Global
          inet6 addr: fd59:5f87:5403:0:a00:27ff:fe19:991a/64 Scope:Global
          inet6 addr: fd59:5f87:5403:0:9de1:e218:838a:c3b5/64 Scope:Global
          inet6 addr: 2604:2000:1303:80c1:a00:27ff:fe19:991a/64 Scope:Global
          inet6 addr: fe80::a00:27ff:fe19:991a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:112 errors:0 dropped:0 overruns:0 frame:0
          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14540 (14.5 KB)  TX bytes:11235 (11.2 KB)
$ 

For example, to ssh onto this machine from an OS X/Linux machine, do:

$ ssh -X [username]@192.168.56.101

Github account

If you do not already have an account on github, sign up for one here. Feel free to select the "Free yearly" plan.

We highly suggest using ssh keys in combination with git. To set this up, see the tutorial here.

You will submit your github user information to us in the last part of lab 0.

Working environment

It is often helpful to have multiple terminals open on one machine when you are coding / testing a program. For your local machine, you can open multiple terminal windows, but for a remote host, you'll have to open multiple ssh sessions. Doing this will also often allow you to copy/paste directly to the remote machine, change the size of your terminal, and generally customize what you see.

It may be most convenient to access the virtual machine via ssh too. That is, the local virtual machine should be regarded as a server, and you will ssh into that "machine", as described above.


Last updated: 2016-04-15 16:24:02 -0400 [validate xhtml]