VM and Development Environment Setup
Our first lab assignment involves setting up several of the tools we’ll use throughout the semester. You must complete each part of this assignment individually, but you’ll work in groups to ensure everyone completes the entire lab. Try to stay synchronized with your teammates as you work through each step.
- Follow the VM Setup Guide to create a Linux virtual machine (VM) that you will use throughout the semester to develop programs and submit assignments.
- As you work through the guide, note any new commands or concepts that you haven’t heard of before (in a plain text file is fine). It may all be completely new depending on your past experience.
- Meet with your teammates to make sure everyone’s VM is working correctly, including using
ssh
to reach the VMs from gojira. - Follow the SSH Guide to create
ssh
keys and streamline access to your VM. When you are done, you should be able to typessh VMNAME
to instantly log into your VM from the terminal. - Regroup to review each team member’s list of new commands or concepts. Choose your favorite as a group to do a deep dive explaining what it is and how it works.
- You must “claim” your concept by announcing what it is on Campuswire. No two groups can present the same concept, so get this done as early as you can!
- Finally, you’ll write your very first Linux utility: an
about
command! Check out the next section for the details.
After all these steps are complete, you’re done with the lab! See grading information at the bottom of this page.
The ‘About’ Utility
The first C program you’ll write will help the course staff get to know you a bit better. Here’s a demonstration of how it will work:
$ ./about
Hello World!
------------
Author: Matthew Malensek
USF Username: mmalensek
Preferred Name: Matthew
Pronouns: he/him/his
About me:
I am originally from Glenwood Springs, Colorado, a town with more
bears than people (that's not actually true, don't Google it). In
my free time, I like to drink coffee and listen to music.
In class, I enjoy making bad jokes. FYI: they don't get any better
as the semester goes on.
I hope to do everything in my power to make this a great semester
for you! Please reach out if you need anything at any time.
NOTE: The only required information shown above is your name and USF username. If you don’t want to fill out more information, you don’t have to.
NOTE: The program needs to run on your VM!
To give you a hint on how to do this, here’s a classic ‘hello world’ program in C:
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
Make a new directory to work in with the mkdir
command, cd
to it and store the example as about.c
.
To run it, you need to compile it first:
$ cc about.c -o about
$ ./about
Hello World!
Typing all that out is a lot of work, though, so we should create a Makefile
to build the program. Here’s an example, you can put this in a file named Makefile
:
# This will compile about.c and name the output binary 'about'
# You should figure out **why** it does that, though...
about: about.c
$(CC) -Wall $^ -o $@
install: about
# TODO: figure out how to use the 'install' command to copy 'about' into
# the /usr/local/bin directory. The user should be able to type
# 'sudo make install' to install your program!
Once you’ve finished the about
program and make install
works (confirm by running about
without ./
in front of it) you are done!
If you are done early and need more to do, write a Rust version of the about
utility!
Grading and Submission
Once you are finished with the lab, you will need to create a git
repository for your lab assignments. Head to this link to create it. Follow the instructions on the git reference page to check out the repository on your VM, create a directory for this lab inside it (cd labs-username
, mkdir lab1
), and then check in:
* Your lab notes (what concepts / commands / etc. you found interesting or were new)
* The source code for your about
utility as well as its Makefile
To receive 80% credit:
- Set up your VM and
ssh
keys- You can test this by running
ssh VMNAME uptime
from your development machine. It should connect to the VM and run theuptime
command, showing how long the machine has been running.
- You can test this by running
- Show the course staff that all the members of your group have finished the setup as well.
To receive 90% credit:
- Complete all previous requirements
- Implement the
about
utility- Similarly to above, you can test this by running
ssh VMNAME about
from your development machine.
- Similarly to above, you can test this by running
To receive full credit for this lab:
- Complete all previous requirements
- Help present your group’s deep dive on the concept you chose in class. You must be in attendance to do this.