The CSE Lab prepares a virtual machine image - a "home VM" - that approximates the computing experience of an instructional Linux box at school that you can run on your desktop or laptop wherever you are. This document explains how this works, and what you need to do in order to use this software.
What’s a "Linux Home VM" and why do I want it?
Virtual machines - see https://en.wikipedia.org/wiki/Virtual_machine - are emulated computer instances running inside a special program you install on your desktop or laptop computer. The virtual machine can run a completely different operating system than its host - for example, you could run a Linux or a Windows 10 virtual machine on your Macintosh laptop, or a Linux virtual machine on your Windows machine.
A number of our courses have programming projects that require the use of a Linux host to complete. A virtual machine affords you the option for working on these projects on your own device, anywhere in the world.
The "Linux Home VM" we prepare runs the same underlying operating system - Rocky Linux 9, as of Autumn Quarter 2022 - and nearly the same software packages as are installed on our instructional Linux hosts (ie. the 'attus') on campus, with a few exceptions for licensing reasons.
How Does It Work?
Virtual machines run inside some other program, which runs on the host computer (your laptop or desktop). This document assumes you will use VMware Workstation (for Windows) or VMware Fusion (for Macintosh), both of which are free of charge to students enrolled in CSE courses that require the software.
**Please note:** There have been recent and significant changes to the VMware Academic Software Licensing Program (VMAP). The CS Lab now also offers new options for "Non-majors Attu" access in certain courses. If you or your course previously required VMware products OR will require "Non-major Attu" access, please see email on changes to VM program.
OK, You’ve sold me. How do I do this?
Four steps: get the software and install it, get the VM and unpack it, start up the VM, and personalize it.
- Install the emulator software. See the VMware section of this document for download links.
- Download our "Linux Home VM" image. This is a large (about 8.0GB) gzipped TAR file or ZIP file that, once downloaded and unpacked, has all of the files necessary to run our “home VM.” Create a new folder and put the TAR or ZIP file inside it, and then move into that folder and unpack it. You’ll have five new files. You only need to download one of these ZIP or TGZ files.
- Note: If you are authorized to retrieve this software and are encountering connectivity issues in retrieving it, please contact CSE Support for assistance.
- If you are using MacOS Catalina,
- Important Information for Students Using MacOS "Catalina" or "Monterey":
- Please uncheck "VMware Fusion" in System Preferences -> Security & Privacy -> Privacy -> Accessibility, following the discussion found at this link.
- There will be a delay during the setup of your VM after entering your credentials (after step 5 below). This is expected behavior, and subsequent reboots of the VM will happen without this delay.
- Set the OS and OS version by right-clicking on the VM name in the "Virtual Machine" menu in VMware Fusion, and selecting "Settings --> General". Select "Linux" for the OS and "Rocky Linux 64-bit" from the "OS" option menu.
- Start the "Linux Home VM" instance. Start the VMware product you installed in step 1, and select "Open a Virtual Machine" from the "File" menu. Select the file that ends in ".vmx" in the folder you created in step 2. Select "Run" from the "Virtual Machine" menu, and when you are asked if you moved or copied the file, answer "Yes, I copied it." If you see a dialog box that reports "Cannot connect to the virtual device ide1:0 because no corresponding device is available on the host." you may safely answer "No" to this dialog and you won't see it again.
Personalize your VM instance. When the VM has launched, select the "A. Happy User" button in the center of the screen. There’s no password associated with that account; it’s there solely to get you started. Once you are logged in, click on "Activities" in the upper left corner of the screen, then "Show Applications" - the bottom-most menu item (a 3 by 3 grid of dots) - then select the "CSE User Setup" icon. Make sure that "All" and not "Frequent" is selected at the bottom of the screen, so you can see all of the applications. The "CSE User Setup" icon looks like a Terminal window and it's in the top row.
You will first be asked for a password for the "root" account on the VM. You’re going to want to remember this password, as you will be required to type it in whenever you perform maintenance on the VM. (On Unix systems, when you're asked to enter a password in a Terminal window, the cursor won't move. This is by design.)
Next, you will set up your user account on the VM. If you’re a CSE student, use your CSE username, and select a password for this account. (This will not change your CSE password anywhere else, it’s just for the VM.) If you are not a CSE student, you can use any username and password you’d like.
After setting up your user account, the VM will reboot, and from this point on, use the username and password you just set up to log into the VM.
Tips and Tricks
Files can be moved onto or off of the VM with one of the following programs running on the VM: "scp" or "rcp" or "sftp."
If you have a CSENetID account, your CSE home directory can be mounted on the VM with these instructions:
- In your VM, in a terminal (shell) window, type this command:
cd; mkdir csehomedirwhich creates a folder in your VM's home directory called "csehomedir." You only need to do this once.
- In your VM, in a terminal (shell) window, type this command:
sshfs attu.cs.washington.edu: ~/csehomedirto establish a connection between your VM and your CSE home directory on "attu.cs.washington.edu." This does assume that your VM is running on a host with network connectivity.
- If you then type
cd csehomedirinto the terminal window, you should see your CSE home directory, and can use "mv" and "cp" to transfer files back and forth.
- If you want to disconnect "csehomedir" you should make sure you are not in that directory on your VM - type
cd; fusermount -u ~/csehomedir.
If you'd like to mount your UW ("U: drive") home directory, there are two methods. You'll be asked for your UWNetID credentials during either process.
(1) You can mount the U drive as a file system. Note that this method will only work if you are connected to a UW network or are using the Husky OnNet client.
cd; mkdir ~/udrive which creates a folder in your VM's home directory called "udrive." You only need to do this once.
sudo yum install cifs-utils to install that Linux packages. You only need to this once.
grp=`id -gn`; sudo mount.cifs //udrive.uw.edu/udrive ~/udrive -o domain=NETID,uid=$USER,gid=$grp.
cd; sudo umount ~/udrive.
(2) You can use SFTP.
The SFTP client is installed by default on the VM and provides an FTP-like
get/put command interface to file transfer. To make a connection use the following command:
You will be prompted for your UWNetID password. See the sftp manual page for further instructions.
Updating the VM
Keeping your VM’s software packages up to date is your responsibility. This is a Rocky Linux operating system, and the appropriate command to update all installed packages is
sudo yum clean metadata; sudo yum update. You’ll be asked for your password (the one you set when you established your user account on the VM) before this command will run.
NOTE: If you're having trouble running those commands successfully, run this command first (and you only need to run it once, to enable this repository):
sudo yum-config-manager --enable devel.
If you want to install a package, and know its name, you can type
sudo yum install PACKAGENAME and it will be installed.
Connecting to CSE Hosts
If you have a CSENetID, you can connect to CSE Linux hosts via "ssh" from within the VM, by first typing this command in a terminal window -
kinit - to obtain Kerberos credentials, and then
ssh attu.cs.washington.edu and, once the connection is established, typing in your Kerberos password at the prompt. To obtain a connection with X11 forwarding type
ssh -Y attu.cs.washington.edu.
Recovering A Broken VM
If you find that your virtual machine's configuration has become unstable, you can attempt to recover your VM home directory and environment by following these steps.
- Shut down the VM, and quit the VMware program (Fusion or Workstation).
- Navigate to the folder on your computer where the VM files were originally unpacked, from the TAR or ZIP file.
- Copy the file that ends in "-homes.vmdk" (example: "homevm-autumn18-homes.vmdk") to a safe location.
- Delete the containing folder.
- Download the VM image file again, and unpack the TAR or ZIP file.
- Replace the file in that new folder that ends in "-homes.vmdk" with the file you previously saved.
- Set up the VM again, starting with step #3 - "Start the 'Linux Home VM' instance."
The file that ends in "-homes.vmdk" is the disk partition that contains your VM's home directory.
If you have questions about how any of this works, or suggestions for software we should add to the VM for future quarters, or think you’ve encountered a bug that you’d like us to fix, send us e-mail at email@example.com and we’ll be happy to help.