Remote coding

All of the labs can be completed using the lab computers in King 137.

Additionally, there is a virtual machine mcnulty (mcnulty.cs.oberlin.edu) that you can connect to remotely. This instructions for connecting depend on if you are connecting from on campus or off campus.

In a terminal, you can ssh to mcnulty.cs.oberlin.edu. This gives you a shell on the virtual machine. You will have the same home directory as the lab machines. Any changes you make in the VM will be reflected in the lab machines, and vice versa.

You can also use Visual Studio Code to connect to mcnulty. This also uses SSH. This lets you program remotely using the standard VS Code interface. I find it pretty convenient. You can also access the shell on the remote machine using VS Code’s Terminal window as usual.

On campus

From on campus, you can ssh to mcnulty entering the following command into a terminal. (The $ indicates the prompt; don’t type it yourself.)

$ ssh username@mcnulty.cs.oberlin.edu

where username is the username you use to log into the lab computers.

Off campus

From off campus, the mcnulty VM is not reachable. You need to tell SSH to “proxy jump” through occs.cs.oberlin.edu. Fortunately, this isn’t much more difficult. You just need to pass an option to ssh:

$ ssh -J username@occs.cs.oberlin.edu username@mcnulty.cs.oberlin.edu

Visual Studio Code

To connect to mcnulty using VS Code, open a new window File > New Window and in the welcome screen of the new window, click the Connect to… link. Select the option Connect to Host… Remote-SSH.

The first time you do this, you’ll have to enter the SSH connection details by clicking + Add new SSH Host….

Then you need to enter the full ssh command (either the on-campus command or the off-campus command from above).

VS Code will then ask which ssh_config file to update and gives several options. On macOS and Linux, you want the one in your home directory that’s in .ssh/config.

Once you’ve done this, click on the Connect to… link and then Connect to Host… Remote-SSH again. Select the host you just configured.

At this point it will ask you to enter the password you use to log in to the lab machines. If you are off campus, you’ll have to enter the password twice. Once for occs, and once for mcnulty.

The documentation for using SSH with VS Code is available here.

Tip

The Visual Studio Code extensions you have installed locally, such as rust-analyzer, may not be installed on the remote machine. If this is the case, then after connecting to the remote machine, you can install the extensions as normal (click on the 4 boxes icon, select the extension you want, and then click Install in SSH: mcnulty).