Download OpenBSD 8.0 and verify the signature
The virtual machine is built from the official installation image, and the image is checked before the first boot. OpenBSD signs every release with its own tool, signify, so a copy from a mirror can be proved identical to the one the project built. This page downloads the files of the current release, 8.0, and runs the check.
Find the current release
The mirror lists the releases as folders. The last number in the list is the newest stable release; the folder snapshots is the development version and is not used here.
curl -s https://cdn.openbsd.org/pub/OpenBSD/ | grep -o 'href="[0-9][0-9.]*/"' | tail -3
href="7.8/"
href="7.9/"
href="8.0/"
The rest of the page says 8.0 and writes it as 80 in file names. For a newer release change both.
Choose the image
The folder 8.0/amd64/ holds several images. The virtual machine boots from a disk image, so install80.img is the one to take:
- install80.img, 839 MB: a bootable disk with the installer and the offline copy of the system, which QEMU opens like a hard disk;
- install80.iso: the same installer as a CD image;
- miniroot80.img, 6 MB: the installer without the sets, so every file is downloaded during the install;
- SHA256 and SHA256.sig: the checksums of all files in the folder and the signature of that list.
Download the files
Keep the disk files outside the repository, in one folder of the user account:
mkdir -p ~/.local/share/aredel/openbsd/8.0
cd ~/.local/share/aredel/openbsd/8.0
The small files first: the checksum list, its signature and the public key of the release. The key is one folder above the images.
curl -fsSO https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/SHA256 -O https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/SHA256.sig -O https://cdn.openbsd.org/pub/OpenBSD/8.0/openbsd-80-base.pub
The image takes a few minutes. -C - resumes an interrupted download.
curl -fSO -C - https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/install80.img
ls -l install80.img
-rw-rw-r-- 1 user user 839352320 Nov 25 11:01 install80.img
Verify the signature and the checksum
The command signify -C does both checks in one run: it verifies the signature of SHA256.sig with the public key and then compares the checksum of the file with the line in the signed list. Linux has no signify in a default install, so run it from a throw-away Alpine container that sees the current folder read-only:
docker run --rm -v "$PWD:/w:ro" -w /w alpine:3.22 sh -c 'apk add -q signify && signify -C -p openbsd-80-base.pub -x SHA256.sig install80.img'
Signature Verified
install80.img: OK
Both lines are needed. Signature Verified alone says the list is genuine, and the second line says the file is the one the list describes. A damaged download ends with install80.img: FAIL and a non-zero exit status, and then the file is deleted and fetched again. For a second opinion compare the hash with the list by hand:
sha256sum install80.img
f64311b5bb1078a47fe62f1dca269061906d7318c7f0a2db36b4c0171993d7df install80.img
grep install80.img SHA256
SHA256 (install80.img) = f64311b5bb1078a47fe62f1dca269061906d7318c7f0a2db36b4c0171993d7df
The key came from the same mirror, so this check proves that the files are consistent and intact, not that the mirror is honest. The key is also in the installation of every OpenBSD release before it, and the project prints its fingerprint on its web site; compare the two once when the key matters for something beyond a test lab.
What is next
The verified file stays read-only from now on. It is never installed onto: the installer runs from it and writes the system to an empty disk. The next page builds the container that runs QEMU, and the page after it does the install.
Related
- Build the QEMU container image: the next step.
- Hardware virtualization for QEMU on a Linux machine: the previous step.
- OpenBSD: the section of the site.
Article author: Klavdiya Kondakova