This page does not represent the most current semester of this course; it is present merely as an archive.
We were assured the systems would work so that ssh
to portal
would solve all our future needs. Reports from early labs suggest that is not the case. Hence, this lab is designed to make sure each of you have an alternative setup you could use.
You are encouraged to do this lab on your own at home, then just quickly check it off with a TA. Once you finish, there is no need to remain in lab.
To complete this lab, do both of the following:
ssh
and module load
to follow the instructions in the section Show at least this below on portal.cs.virginia.edu
.Make and enter a directory named tools_test
Create a file there1 named hello.c
which contains the following C code.
#include <stdio.h>
int main() {
("This file shows your C toolchain is working");
puts}
We will explain this code later, but want to make sure you have C working first.
Run the following and show the output to a TA. Several of these commands will display things, and the last two (run
and quit
) will have a different-looking prompt than the others. Both ./a.out
and run
should have, as part of their output, “This file shows your C toolchain is working”.
pwd
clang hello.c
./a.out
lldb a.out
run
quit
portal
You’ve seen how to ssh
into portal.cs.virginia.edu
before. Some things you should know for this:
The CS servers hide most programs until you ask for them. You ask for them by running module load
and then the module you want to access the programs inside of. The modules we’ll need in this class are
module load clang-llvm
module load nano
(or module load emacs
if you prefer emacs
, or no module needed if you prefer vim
)Other than loading these modules after you ssh
in to portal
(each time you ssh
into portal), you should be able to use the skills you learned in Lab 00 and Lab 01 to complete the Show at least this material.
A virtual machine is a program that pretends to be an entire computer, so you can run a different operating system inside your current operating system. We recommend using this to get Linux running inside your MacOS or Windows environment.
Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads
Download our (1.8 GB) VirtualBox OVA file either from UVA Box or from Collab (we have two copies available, either one is fine)
If you are running Windows,
Disable Windows Hyper-V (an alternative virtualization layer which is incompatible with VirtalBox) by running the following from powershell:
bcdedit /set hypervisorlaunchtype off
… and then restarting your computer
You can re-enable Hyper-V by running the following from powershell; note though that VirtualBox requires it to be disabled, so don’t do this if you still need VirtalBox:
bcdedit /set hypervisorlaunchtype on
… and then restarting your computer
Run VirtualBox, and within it initialize your virtual machine as follows
To run your virtual machine,
Note: you may have to enable virtualization in your BIOS to get VirtualBox to work. You likely have this enabled by default; if not, the TAs will help you do so in lab.
If you run a mostly POSIX-compliant operating system (Linux, FreeBSD, OpenBSD, AIX, Solaris, and almost all the others with one notable exceptions), you can probably get clang
, git
, and lldb
to work with no extra effort.
As a special case, macOS is POSIX-compliant but by default does not include most of the tools we’ll need, has a slightly different take on some parts of C than normal, and often has commands hidden under non-standard names or the like. If you install clang
and lldb
through the macOS developer tools, you can probably use your macOS machine directly with no virtual machine. You are welcome to do this, but note that we may not be able to help if something goes wrong.
If you run Windows, there’s a thing called the Linux Subsystem for Windows which can let you make windows (almost) act like a POSIX-compliant OS. You are welcome to do this, but note that we may not be able to help if something goes wrong.