We’ll be using OCaml in CS 164, which requires only a text editor and a terminal. You’re free to use whatever text editor or IDE you prefer, but we will only support the recommended setup below; we will be unable to provide guidance on any other setups if they are not working correctly.
Note for students with limited internet access: If internet access will be an ongoing issue during the semester, please contact the course staff. We will work with you to find a manageable setup!
We will exclusively use the CS 164 instructional machines for this course. The following steps describe how to connect to the instructional machines. The instructional machines contain all the OCaml command-line tools and packages you will need for this course. This is a relatively new setup for this course, so if you encounter any issues, please let us know.
Tip: If you ever get "Connection refused" or "Connection timeout" error while trying to connect to the instructional machines, check the status of the hive servers at hivemind.eecs.berkeley.edu. All students have access to the following servers:
- hive‹n›.cs.berkeley.edu (where n is in the range 1-20, inclusive).
- If you have not done so already, please create a student instructional account for CS 164.
You should receive an email with your instructional account username
and password. Now, try connecting to a hive machine via SSH. Go into a
terminal and run
ssh firstname.lastname@example.org(You can use any of the servers listed above). Make sure to replace the
???with your username.
If you would like to connect to the Hive machines on your computer
without typing in your password every time, follow these steps. (Credits to CS61C documentation)
Open your terminal. Check if you have existing SSH keys by running
ls ~/.ssh/id_*. If there is a "No such file" error, generate a key pair by running:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519.
Copy your public key to the instructional account with the
If that doesn't work, your computer might not have ssh-copy-id installed. Try this instead:
cat ~/.ssh/id_ed25519.pub | \
ssh email@example.com \
'cat >> ~/.ssh/authorized_keys'
You might need to type in your instructional account password for a final time.
Try SSHing into the instructional servers now! Run
in your terminal.
- Open your terminal. Check if you have existing SSH keys by running
If typing out
firstname.lastname@example.org too long, create a host alias with the steps below! Once you create a SSH host alias, you will be able to connect to the CS164 instructional machines with
ssh cs164or even
ssh ILoveCompilers. (Credits to CS61C documentation)
- Follow the steps above to connect to the instructional machines without a password.
~/.ssh/configin your favorite text editor.
At the end of the file, add the following lines:
Host cs164Feel free to change the host alias next to "Host" from
ILoveCompilersor anything you would like! Make sure that you replace the "User" from
cs164-???to your actual username.
- You should now be able to SSH into the instructional servers with your host alias.
If you would like to use VS Code for development, you can
follow the steps below for remote development. The official docs are
we've also abridged them below.
- Install Visual Studio Code.
- Install the Remote — SSH Extension.
Open Visual Studio Code and press Control-Shift-P (or
Command-Shift-P on a Mac) to open the Command Palette. Search for
Add New SSH Host....
ssh email@example.com press Enter. You may be prompted to enter in your instructional machine password.
Press Control-Shift-P (or Command-Shift-P on a Mac) again to open
the Command Palette. Select
Remote-SSH: Connect to Host....
Type in the ssh hostname (e.g.
firstname.lastname@example.org). If you've set up a host alias, it might come up as an option as well.
- After a moment, you'll be in a new window. Make sure you're connected by checking the bottom left corner of the window: there should be a little green bar with the words "SSH: cory.eecs.berkeley.edu".
- In the new window, install the OCaml Platform extension. This new window also won't have any of the VS Code extensions you've already installed locally, so make sure to install any extensions you need for writing code.
- You can now open any folder using File > Open... .
Connecting to GitHub from the Instructional Machines
To pull from and push to your homework repositories on GitHub, you’ll need to set up an SSH key on the instructional machine and add the public key to your GitHub account. Follow these steps:
While logged into the instructional machine, run the following:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
This will generate a public / private key pair on the instructional machine.
Copy this public key to your clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
- Add the public key to your GitHub account by going to your account SSH settings. The title of your SSH keypair can be “CS 164 Instructional Machine” (or any other name that helps you identify this key).
Homework should be submitted on Gradescope. When you have completed your work on the instructional machine, the simplest way to submit your homework is to:
- Push your final code to your homework repository.
Download your homework repository as a