CS219/CS236 Operating Systems
Spring 2025-26

xv6 setup instructions                home                labs                schedule                references


Installation and Running xv6
xv6-riscv requires the RISC-V versions of QEMU (7.2+), GDB (8.3+), GCC, and Binutils. You can set this up natively or via Docker.

Option A: Native Installation
Installation guides for Linux, Windows, and Mac are provided here: MIT Tools Page.
Note: If using Linux, you likely need Ubuntu 24.04 (or later) for apt-get to install a recent enough version of QEMU.

Option B: Docker (Containerized)
To avoid dependency issues, you can run QEMU inside a container that has all dependencies pre-installed.
1. First, Install Docker.
2. Run the following commands to pull the image and start the environment:
$ git clone https://github.com/mit-pdos/xv6-riscv.git
$ docker pull arghyadipchak/xv6-riscv-devbox:latest
$ docker run --rm \
--interactive --tty \
--name xv6-devbox \
--hostname xv6 \
--user $(id -u):$(id -g) \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume ./xv6-riscv:/xv6-riscv \
arghyadipchak/xv6-riscv-devbox:latest