Written by Chris Gregg, Julie Zelenski and others, with modifications by Nick Troccoli and Lisa Yan
You will complete all the assignments for CS107 on the myth cluster, which is a set of computers in Gates B08 running Linux (Ubuntu 14) and have various open source tools installed (gcc, gdb, etc.) that we will use. These systems are networked and use a common set of accounts (your SUNet id/password) and have a shared AFS filesystem. There are 30 or so machines in the cluster, individually named myth1, myth2, and so on. No matter which myth you log into, you'll have access to the same installed software, your home directory, and all your files.
The first step is to set up your own computer to log in to myth remotely. Logging in through a command called ssh will allow you to work on the myth computers in a way that is indistinguishable from being physically in the Gates B08 room. While some version of ssh is available on all kinds of computers, the exact details of this step will be different depending on what kind of computer you have.
Mac
Click here for a walkthrough video.
All Macs have a built-in Terminal program, since like Myth machines they are also built on top of Unix. You can find the Terminal program by searching for it via the magnifying-glass in the top-right corner of your desktop, or by opening the Applications folder and going into Utilities.
When you open Terminal, initially you'll be seeing the files and programs of your own computer, just through the lens of Terminal instead of Finder. We'll need to configure one Emacs setting (a one-time change) before logging in to myth: in the top menu bar, click Terminal -> Preferences -> Profiles -> Keyboard -> "Use Option as Meta Key". This means the "Option" key on your keyboard will act as the "Meta" key for Emacs, instead of the Escape key. Take a look at our Emacs guide for more information about Emacs.
Now that you're all configured, use the ssh command to connect to the myth machines. Just be sure to keep track in your own mind of whether you're on myth or your own computer at any given moment! The command you want to type is:
ssh [sunet]@myth.stanford.edu
where [sunet] is your SUNet ID (i.e., the name part of your stanford email address, so if your SUNet ID is troccoli, you would type ssh troccoli@myth.stanford.edu). It will ask for your password, which is your usual Stanford password. If it asks you to confirm that you would like to access myth, type "yes". Jump further down the page for final instructions.
Windows
Windows OS does not natively support the development tools used in this course. Enabling WSL (Windows Subsystem for Linux) allows you to run an Ubuntu instance on top of Windows OS. You will install the necessary development tools into the Ubuntu WSL environment and do your coursework there.
(Notes: A previous version of these instuctions asked you to install the Windows PowerShell, but the below program gives you more features in myth. The current set of instructions are developed by CS107E instructors Julie Zelenski and Pat Hanrahan.)
Enable WSL Windows feature
- Type "features" into the start bar and open the Control panel to "Turn Windows features on or off".
- In the panel, find the checkbox "Windows Subsystem for Linux". Check the box, and click "OK".
- Wait for it to complete the requested changes and then restart your computer when prompted.
Install Ubuntu 20.04 LTS
Ubuntu version 20.04 LTS for WSL is available in the Microsoft Store.
- Open the Microsoft Store app. Search for "Ubuntu 20", select
Ubuntu 20.04 LTSand install it. Be sure to choose version Ubuntu 20.04 LTS. The other Ubuntu versions do not support the software requirements we need. - Once it's done, launch the application. A terminal window will open that says "Installing, this may take a few minutes..."
- Once that command finishes, it will prompt you to enter a new username and password for your local Ubuntu account. Be sure to remember this username/password; you'll need them later for admnistrator privileges.
-
Apply the latest Ubuntu updates by running the command below in the terminal window:
$ sudo apt update && sudo apt upgrade
Don't be alarmed about the long-winded Unix-babble---these processes are total chatterboxes.
-
Check: Confirm Ubuntu version
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal
-
You now have an up-to-date version of Ubuntu running on top of your Windows OS.
Initially you'll be seeing the files and programs of your own computer, just through the lens of Terminal instead of Windows Explorer. From there, use the ssh command to connect to the myth machines. Just be sure to keep track in your own mind of whether you're on myth or your own computer at any given moment! The command you want to type is:
+From there, use the ssh command to connect to the myth machines. Just be sure to keep track in your own mind of whether you're on myth or your own computer at any given moment! The command you want to type is:
ssh [sunet]@myth.stanford.edu
where [sunet] is your SUNet ID (i.e., the name part of your stanford email address, so if your SUNet ID is troccoli, you would type ssh troccoli@myth.stanford.edu). It will ask for your password, which is your usual Stanford password. If it asks you to confirm that you would like to access myth, type "yes". Jump further down the page for final instructions.
Older Windows Versions
PuTTY
Older Windows versions (prior to April 2018) do not have a Windows PowerShell program that supports ssh functionality, but there is a program called PuTTY that provides ssh functionality instead.
Putty is available here - download the package file, or scroll down to the "Alternative Binary Files" section for files that don't need to be installed (for example, if it is not your computer and you don't have permission to install software). Use the 64-bit version (or 32-bit if your computer is more than about 5 years old).
Here's how to use it to connect to Myth:
- In the Host Name field, type "myth.stanford.edu".
- Leave everything else as-is, and click "Open" at the bottom of the window to connect.
- If a security alert appears about a host key, click "Yes".
- When the program prompts you with "login as:", enter your SUNET ID (e.g. part before @stanford.edu).
- When the program prompts you with "password", enter your Stanford password.
SecureCRT
If you are unable to install PuTTY for some reason, there is a program called SecureCRT that provides ssh functionality instead. Note that SecureCRT is not as compatible with Emacs mouse commands as the above two options.
Download and install the SecureCRT software program that will run ssh for you. It is available as a free download from Stanford. Of the two download options at that link (32-bit and 64-bit), choose 64-bit unless your computer is more than about 5 years old.
After the program is installed, launch it. We'll need to configure some Emacs settings (a one-time change) before logging in to myth.
- In the top menu bar, click Options->Edit Default Session
- Select "Emacs" as the category, under Terminal->Emulation
- Check the box "Use ALT as meta key". This means the "Alt" key on your keyboard will act as the "Meta" key for Emacs, instead of being used to access shortcuts within SecureCRT. Take a look at our Emacs guide for more information about Emacs.
- Click OK to save the changes.
- When it asks you whether you would like to apply this to all sessions, select that you'd just like to change the Default Session.
One more setting to configure:
- In the top menu bar, click Options->Edit Default Session
- On the "Terminal/Emulation" page, set the emulation to "Xterm"
- Make sure the value of the "Terminal type" option in the "Terminal / Emulation / Advanced" category is NOT enabled.
- Click OK to save the changes.
- If it asks you whether you would like to apply this to all sessions, select that you'd just like to change the Default Session.
Now we can connect to Myth:
- Go to File -> Quick Connect.
- Enter Hostname "myth.stanford.edu".
- For Username, enter your SUNet ID (i.e., the name part of your stanford email address).
- Leave everything else as-is, and click Connect.
- If it asks you about a New Host Key, click "Accept & Save".
- At the password prompt, enter your Stanford password.
Now you should be logged into Myth! Note that you didn't need to actually type the ssh command, as the program is your ssh client and did this for you. Also, you'll only need to do the above steps once; when you launch SecureCRT in the future, myth will now be listed underneath the available Sessions in the program sidebar for you to double-click on. (If you don't see this sidebar, click the toolbar icon in the top-left corner of the window that looks like a file tree). Now, jump further down the page for final instructions.
Now you should be logged into Myth! Note that you didn't need to actually type the ssh command, as the program is your ssh client and did this for you. Now, jump further down the page for final instructions.
Linux
Click here for a walkthrough video.
All Linux machines have a built-in Terminal program, since like Myth machines they are also built on top of Unix. You can find the Terminal program by searching for it using the search functionality of your chosen Linux version. For instance, Ubuntu users can follow the instructions in this WikiHow guide.
When you open Terminal, initially you'll be seeing the files and programs of your own computer, just through the lens of Terminal instead of your graphical filesystem. From there, use the ssh command to connect to the myth machines. Just be sure to keep track in your own mind of whether you're on myth or your own computer at any given moment! The command you want to type is:
ssh [sunet]@myth.stanford.edu
where [sunet] is your SUNet ID (i.e., the name part of your stanford email address, so if your SUNet ID is troccoli, you would type ssh troccoli@myth.stanford.edu). It will ask for your password, which is your usual Stanford password. If it asks you to confirm that you would like to access myth, type "yes". Jump further down the page for final instructions.
A Successful Login
If you have successfully logged in to myth, you should see something like this:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
myth7.Stanford.EDU
Ubuntu 14.04 (Linux 3.13.0-106-generic amd64)
2 x Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz, 7.73 GB RAM, 3.81 GB swap
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-> For help with your SUNetID, AFS, or class dirs call 725-HELP, or visit
http://helpsu.stanford.edu
-> For problems with hardware, local software, or facilities email
action@soe.stanford.edu
-> The myths are not for CPU-intensive workloads. For alternative
computers see http://farmshare.stanford.edu
-> To logout of the console, click in the background then hit ctrl-alt-del.
myth7:~>
The "myth7" part may name a different myth (myth1 or myth12, etc). Remember that Gates B08 contains many myth machines. When you ssh to "myth.stanford.edu" as a generic name, you are randomly assigned to one of the myths that is currently most idle (fewest other people trying to use it). This log in greeting message is simply telling you which one you were assigned. You may also ssh to a specific myth by using that myth's name (e.g., ssh troccoli@myth9.stanford.edu), but you usually won't need to do this.
Important note: is this your first time logging in? Make sure to download our Emacs or Vim settings file to make navigating Emacs or Vim easy. You can do this by following the instructions at the top of the associated text editor guide on the Resources page.
Important note: When you're working via ssh, remember to save early and often. If you get disconnected from ssh while you are working, you will potentially lose any work up to the last time you saved.
Useful commands
Logging out of myth: Type logout or Ctrl-d to log out of myth.
Clearing the Terminal screen: If your command-line is getting too cluttered, you can use the clear command to clear the currently displayed output. To do a deeper clear, you can use the reset command, which will fully re-initialize the display. The reset command is useful if your input-output somehow get mismatched, but clear will be faster and will work for most use cases.
Troubleshooting
My Windows 10 computer is in a different language without alphanumerical characters, such as Chinese, and I'm having trouble with the instructions.
Ubuntu (the software that is installed in the instructions) may not be able to recognize your user folder name to properly install. If possible, one solution is to change your computer's display language to English, which entails making a new admin account, unsyncing the language, and changing the display language, such that everything is in English. However, this might not be possible in the Home Edition of Windows 10. If for this or other reasons you are not able to or would not like to change the language, we advise that you instead follow the instructions on this page to install the SecureCRT program. [Thanks to TA Annie S.]
More Information
- For more information about SUNET IDs, click here
- For more information about AFS, click here
- For more information about the myth cluster, click here. You will need to be a declared CS student to access this page, as the myth cluster is managed by the CS department and intended for general use by CS department students.
- For more information about the Stanford Farmshare environment, the larger group of systems you can access (and of which
mythis a subgroup), click here. - Optionally, you can configure Xwindows to enable graphical windows.