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 - CentOS 8, as of Autumn Quarter 2020 - 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. There are numerous applications, on most platforms, that fulfill this need. We offer access to download VMware Workstation (for Windows) or VMware Fusion (for Macintosh) free of charge to students enrolled in CSE courses that require the software. There are many others - Virtualbox, Parallels, KVM, and Docker, to name a few - but for the purposes of this introductory document, we’ll assume you are using one of the VMWare products.
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. CSE Majors and non-majors enrolled in CSE courses requiring the VM should already have access to CSE's VMWare Academic Program site, where you can download VMWare products for free. If you are not able to log in, please request an account by emailing support@cs, including your UW NetID username and detailing why you need access. When you have that, you can download the software for your computer - VMware Workstation Player (version 16) for the Windows platform, or VMware Fusion (version 12) for the Macintosh - and install it. (Note to Windows users: you do not need VMWare Workstation to run an existing VM; VMWare Workstation Player is sufficient.)
- Important Information for Students with a new "M1" Apple Device: VMWare Fusion is not yet supported on the new M1 chip.
- 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 six new files. You only need to download one of these ZIP or TGZ files.
- 21wi VM: ZIP MD5:
069c558493c577f5997745e1e2a9a8d1or TGZ MD5:
- 21sp VM: ZIP MD5:
8d90bfe5a4a61077404a6cf61ac30da2or TGZ MD5:
- 21wi VM: ZIP MD5:
- Important Information for Students Using MacOS "Catalina":
- 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.
- 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, "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 ~/udrivewhich creates a folder in your VM's home directory called "udrive." You only need to do this once.
sudo yum install cifs-utilsto 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 CentOS 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.
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 firstname.lastname@example.org and we’ll be happy to help.