Exercises #
Exercises are due (mostly) every Friday night at 11:59pm, Raleigh time (+48h without penalty and open Gradescope submission). Unless noted otherwise, you should submit two files to Gradescope:
- A PDF of your lab report (not available for all exercises)
- The
.labfile
We will primarily be looking at the lab reports. However, Labtainers has rudimentary auto-grading for of the .lab files for some exercises, and we will incorporate the results of the auto-grading. Hint: look into Labtainer’s checkwork command.
Getting Lab Reports #
For the exercise labtainers that include a lab report PDF, it usually should end up being created somewhere in your student working area (maybe in a docs folder).
If you already closed and deleted your session before grabbing the report, you can still get the PDF from the .lab file:
- Change the name ending of the .lab file to .zip and unzip it.
- Look for the docs.zip and extract it again.
- There should be a PDF of your lab report (usually with the name of the exercise, i.e.
symkey.pdfor similar).
For getting the lab report out of your VM, there are a number of options that might depend on how you run the VM:
- A common approach is to use the VM’s Firefox browser to email yourself the files
- VirtualBox and other hypervisors have “shared folder” or “file drag-and-drop” features to move files.
- Usually needs to be enabled in the general hypervisor’s or VM’s settings.
- Might ask for a password to create the folder, the default “student” VM password is “password123”
- UTM Documentation for folder sharing: https://docs.getutm.app/guest-support/linux/
- For VMs on the local network with SSH Access:
- Find VM’s IP (e.g., with
ip addr show) - And then from the host
scp -P 22 student@[VM-IP]:/home/student/labtainer_xxx/[file] .
- Find VM’s IP (e.g., with
Optional Opinion Questions: Some of the labtainers with lab reports also include some optional feedback/opinion questions like “Did you like this exercise” or “Did you run into problems”. These are entirely optional and not graded, in case of problems prefer using the Ed Discussion or email.
Setup #
Plan some time for getting the Labtainers environment setup if you are unfamiliar with it:
- Read through the Labtainers website
- Read and familiarize yourself with the Student Guide
- Set up your local virtual machine.
Issues: If you run into trouble, see the troubleshooting section below.
Note: If you are using an M-series Mac, some students have had luck using UTM as a virtual machine environment; however, for others the performance is extremely poor. As an alternative to running the labtainer locally, see the instructions below for using NC State’s Virtual Computing Lab (VCL) environment.
General exercises consideration unless noted otherwise on the specific exercises:
E01 Exercise 1 #
| Assignment | Exercise 01 E01 |
| Due | Fri, Sep 4 - 11:59pm (Raleigh time) (+48h without penalty) |
| Submission | via Gradescope (first-time access through Moodle sidebar) |
| Points | 50 |
| Format | PDF of lab report + .lab file |
For this week, you will be completing the symkey Labtainers exercise on “Exploring Symmetric Key Encryption Modes.” Specifically, you will see how ECB leaves patterns in the ciphertext, just as we saw during the lecture.
Starting the lab:
- In the Labtainers terminal,
cd labtainer/labtainer-student labtainer symkeylab
Submission: For this task, submit the lab report PDF via Gradescope and the .lab file via Moodle.
E01 Troubleshooting #
Black Images: If you encounter fully black images, you might have mistyped the output filename in the openssl command (e.g., -out nps-logo-mod.bmp instead of -out nps-logo_mod.bmp), which causes the subsequent dd command to overwrite the image with only the 54-byte header.
E02 Exercise 2 #
| Assignment | Exercise 02 E02 |
| Due | Fri, Sep 11 - 11:59pm (Raleigh time) (+48h without penalty) |
| Submission | via Gradescope (first-time access through Moodle sidebar) |
| Points | 50 |
| Format | PDF of lab report + .lab file |
For this week, you will be completing the macs-hash Labtainers exercise on “Exploring MACs and Hash Functions.” Specifically, you will investigate finding collisions in hash functions.
Starting the lab:
- In the Labtainers terminal,
cd labtainer/labtainer-students labtainer macs-hash
Submission: For this task, submit the lab report PDF via Gradescope and the .lab file via Moodle.
E02 Troubleshooting #
Cant access website: If you can’t get the floppy57.fs and hash file through the local website in labtainer (DNS issues or similar), you can also grab them directly from the labtainer repo here: https://github.com/mfthomps/Labtainers/tree/master/labs/macs-hash/macs-hash/_system/var/www
E0X Exercise X #
There will be eight exercises total. I will add exercises as the course progresses
Troubleshooting #
General: Labtainer Troubleshooting
Password Required: The default password of the “student” VM should be “password123”
Display Error: If you encounter a display error while trying to run a graphical application (e.g., Firefox):
- Try executing the following command:
export DISPLAY=:0before running the graphical application command, i.e.:1 2export DISPLAY=:0 ./start_firefox &
Display Error VCL: If DISPLAY=:0 did not help and/or you are using VCL, try export DISPLAY=:10.0 (note the different number) before running the command
- Check the return of
ls -l /tmp/.X11-unix. If it is empty, you may need to restart the VM.
Lab file to big for Gradescope: In some rare cases (I assume it might be connected to letting the labtainer sessions run for multiple days on e.g., VCL) the lab file might bloat to hundreds of MB, above the Gradescope submission limit. In that case, you could share it with me via Google Drive or just extract the lab report PDF and upload that (please send me a short email so I can keep track).
VCL Labtainers Setup #
For with an M-series Mac or other systems that are struggling to run the VM locally, we have created a Labtainer VM image (CSC474-Labtainer) available via the NCSU Virtual Computing Lab (VCL).
You can reserve a VM by:
- Navigate to vcl.ncsu.edu and clicking on “Make a Reservation” in the header bar.
- After you log in, click on “New Reservation.”
- In the resulting popup window, select the
CSC474-Labtainerimage as the environment and increase the duration of the reservation (see warning above). - Then click on “Create Reservation.” It may take a few minutes for the machine to be created.
- Once the machine is ready, a “Connect!” button will appear next to the reservation. Click on it and note down the IP address of the machine. Alternatively, download the RDP file.
- Use an RDP client such as Remote Desktop Connection on Windows or Microsoft Remote Desktop on macOS (available for free on the Mac App Store) to connect to the VM.
- To start the labtainer terminal environment, launch “Labtainer Terminal” on the desktop.
Make sure you save your work after you finish the lab. The VM will be wiped clean once the reservation time expires or you delete the reservation. You can use the web browser on the VM to upload the .lab file or use SFTP or SCP to download the file to your local machine.
Desktop performance will depend on your network connection and the resolution of the remote virtual display. Performance will generally be best on the NCSU campus but the VM can be accessed anywhere with an internet connection.
Display not found: If you encounter an error (“display :0 not found” or similar) while running a graphical application on VCL:
- Try executing
export DISPLAY=:10.0before running the command to set the display to the correct value for the VCL network environment.