CPSC 124 Introduction to Programming Spring 2024

Using the Linux Virtual Desktop

The Linux Virtual Desktop Interface (VDI) allows you to access a Linux desktop, similar to what you would see if you were sitting in front of one of the Rosenberg 009 or Lansing 310 computers, through a web browser. This lets you work on your programs from anywhere, on or off campus, without having to install anything your own computer.

CPSC 124 is one of two courses piloting this system this semester. This means that there may be wrinkles - please let me know if you encounter problems! This will help the CS department and IT improve the system so it can be used more widely in the future.

Connecting to a Linux Virtual Desktop

See the instructions here. Note that the username and password that you use here are your HWS network credentials, not your CS Linux account.

If you are not on campus, you will first need to set up (one time) and run (every time you want to connect to a campus resource) VPN so that you can connect to the HWS network. See the following links for more information:

Navigating the Ubuntu Desktop

The desktop you see after logging in to the VDI looks different from what you see in the Rosenberg 009 and Lansing 310 labs - the VDI uses Ubuntu Linux, while Linux Mint is installed in the labs. These are two different distributions of Linux; both have the same core operating system underneath, but are packaged differently and, most obviously, have different desktops.


With the Ubuntu desktop, the Applications menu and launcher icons are found on the left side of the window rather than at the bottom. Click the Firefox icon to launch the Firefox web browser, the Files icon to launch the file manager, and the Applications menu icon to access other software.

When you are done working with Linux, log out by clicking on the little power switch icon in the upper right corner of the desktop - choose Power Off/Log Out and then Log Out.

Managing Files

You can use the file manager to work with directories and files; it looks little different from what you see in the lab, but it works similarly.

There is, however, a very important point - the VDI is a separate system from the lab Linux machines. This has two important consequences: the home directory that you see when you log in to the VDI is not the same as when you log in on one of the lab machines, and you can't use the file manager to access the files in your CS account or /classes/cs124.

As a result, you'll need to transfer files back and forth between your CS account and the VDI as you switch between the different environments. It is recommended that you treat your CS account as the primary version, so that you copy files from your CS account when you log in to the VDI and copy them back when you finish a session.

FileZilla is an application that lets you copy files between different computes. To start FileZilla, click on the Applications menu and then locate and click on the FileZilla icon . Next, fill in the Host and Port boxes as shown below, enter your CS account username and password in the Username and Password boxes, and then click Quickconnect.


Once connected, you'll see something like the following:


The left side of the view, labeled "Local site", shows you the local filesystem (in this case, the VDI filesystem). The current directory's path is shown after the "Local site" label (my home directory, /home/bridgeman, in the example). Below that is a hierarchial view of the local filesystem, and below that is a listing of the current directory's contents. Both the filesystem and directory listing are navigable; to go up one level in the directory listing, click on the folder labeled .. (two dots, at the top of the listing).

The right side of the view, labeled "Remote site", shows a similar view of the filesystem on the system you connected to (in this case, math.hws.edu - your CS account).

To transfer files or directories between systems, navigate to where you want the files/directory to go on the system you want to copy to, then navigate to where the files/directory are that you want to copy on the other system, and drag from one to the other. The first time you copy from your CS account to the VDI environment, copy your entire ~/cs124 directory; after that, copy just the folder for the lab or project you are working on.

You can also access /classes/cs124 - just navigate the "Remote site" side to /classes/cs124 instead of your home directory. This allows you get provided code and to hand in directly from the VDI, though you are strongly encouraged to make sure you also keep a copy of your files in your CS account.

If you forget to copy your files from the VDI back to your CS account and are in the lab, you can connect to the VDI from the lab, use FileZilla to copy your files, and then close the VDI. (Please do not routinely work in the VDI when you are in the lab - there is a limited pool of licenses and it is not intended for the entire class to be using it at the same time.)

VS Code

To start VS Code, click on the Applications menu and then locate and click on the Visual Studio Code icon .

Because the VDI and lab computers are separate systems, you will need to repeat any VS Code configuration you do in one system on the other. The Red Hat Java Language Support extension is already installed so you don't need to do that, but you will need to set the four settings described in lab 2.

Don't forget to go to the File menu and do Open Folder... to open your cs124 folder rather than opening individual files, and then you should be good to go. (If you don't have a cs124 folder in the VDI, copy it from your CS account.)