This page contains some simple instructions to build and boot into a plain vanilla Debian environment running on a Morello (Arm-based) CHERI virtual machine in QEMU.
We will use the cheribuild.py script from the University of Cambridge to simplify the process of building and running QEMU with support for CHERI. These instructions are for a Debian/Ubuntu host machine, but cheribuild’s README has instructions for setting up your development environment on MacOS, RHEL/Fedora, FreeBSD, and Arch Linux hosts.
On a Debian/Ubuntu host machine, you can install the packages required for the most commonly used cheribuild targets with:
apt install autoconf automake libtool pkg-config clang bison cmake mercurial ninja-build samba flex texinfo time libglib2.0-dev libpixman-1-dev libarchive-dev libarchive-tools libbz2-dev libattr1-dev libcap-ng-dev libexpat1-dev libgmp-dev bc tzdata
A few additional dependencies are needed for running Debian on QEMU:
apt install device-tree-compiler python3-setuptools libssl-dev
Clone the cheribuild source repo:
git clone git@github.com:CTSRD-CHERI/cheribuild.git
From the cheribuild/ source directory run the cheribuild script:
./cheribuild.py run-debian-on-cheri-linux-morello-purecap --linux-kernel/git-revision cambridge-morello-7.0 -d
This command specifies that cheribuild should:
run-debian-on-cheri-linux-morello-purecapcambridge-morello-7.0-d at the end)The build will take a while. Near the end it will pause to ask you to set the timezone and root password, then drop you into a login prompt for the Debian image running in a QEMU VM. Login with user root and the password you set.