-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
- In my experience, at least 16GB of RAM is required to run the devcontainer without any issues on Windows and Mac. You might get away with using less if you are running on native Linux since it seems to manage memory better when using Docker 🤷
- Docker must be installed. The installation process looks different depending on the operating system:
- Windows 11
- MacOS
- Linux
- VS Code must be installed. Once VS Code is installed, install the Remote Development Extension Pack.

- Ensure that the docker daemon is running. You can check that
docker --versionreturns an error-free output in the CLI. If you installed Docker Desktop for Windows or MacOS, starting it will start the docker daemon.
- Clone this repository:
cd ${HOME} && git clone https://github.com/DFriend01/os161_devcontainer.gitImportant
If you are in Windows WSL, the devcontainer must be cloned within the WSL network.
It is recommended that you install Windows Terminal
and use the Ubuntu profile when working in WSL. Ensure the starting directory is your home directory
~ or /home/<USERNAME>. If not, you will need to change the starting directory field for the Ubuntu profile to
//wsl.localhost/<DISTRO NAME>/home/<USERNAME>.
See the windows terminal documentation.
- Clone your OS161 source code into the devcontainer:
Important
Your os161 code must be contained inside os161_devcontainer/os161/src
If you already have a repository for os161
cd os161_devcontainer/os161 && git clone <REPO URL> srcIf you do not have a repository for os161
The instructions are adapted from here.
First, create an empty repository on GitHub (probably a private repo if this is for a course). Then, set up the repository locally:
# Create the source directory for development
mkdir os161_devcontainer/os161/src
cd os161_devcontainer/os161/src
# Set up the git repository
echo "# os161" >> README.md
git init
git add README.md
git commit -m "Initial commit"
git branch -M main
git remote add origin <REPO URL>
git push -u origin mainGet a copy of the source code and push to main:
# Ensure that you are inside the src directory
# If wget fails with error 404, also try getting the source from
# http://www.os161.org/download
wget http://people.ece.ubc.ca/os161/download/os161-CPEN331-base-2016.tar.gz \
&& tar -xvzf os161-CPEN331-base-2016.tar.gz \
&& rm os161-CPEN331-base-2016.tar.gz
git commit -am "Initial commit of os161"
git push origin main- Start VS Code with the
os161_devcontaineras the project directory:
# Check that the path ends in 'os161_devcontainer'
cd ../.. && pwd
code .- VS Code should prompt you to reopen in the devcontainer. Accept the prompt.

If VS Code does not prompt anything, then open the VS Code command palette with ctrl + shift + p (you should see the > character) then
search for Dev Containers: Rebuild and Reopen in Container and select that option. When the build starts, VS Code gives you the option
to view the logs during the build process (click on Starting Dev Container (show log) on the bottom-right).

Wait for the devcontainer to finish building. Subsequent builds should be quicker.
Note
If you experience the error "Missing GCLIB >= 2.28" (or something similar) when building the devcontainer, this is a result of a breaking change that was made in recent updates to VS Code. There was a GitHub issue related to this problem here. However, the easiest workaround is to downgrade to VS Code 1.85 and disable auto updates.
- Open the
os161.code-workspacefile and click the "Open Workspace" button. You should see a purple border on your VS Code window.


This will provide access to VS Code settings and configurations specific to the devcontainer using a VS Code Workspace.
- Build your kernel with
ctrl + shift + band selecting a kernel to configure (i.e.DUMBVM). You can also do it yourself by following the instructions here.
- Open a new terminal
Terminal > New Terminaland then run your kernelRun > Start Debugging. Alternatively, the kernel can also be started in the command line:
cd $WORKSPACE_DIR/os161/root && sys161 kernel-
ctrl + shift + pandTasks: Run Taskgives a list of a few common tasks that have been automated (running the kernel, building, and cleaning).