OpenBSD in QEMU

home next >
approximate reading time: 2 minutes
created by pur on 2022/12/08 - last changed on 2022/12/27

This article will be a summary of what I've learned during writing the unstructured articles. After a short introduction on OpenBSD we will show how to obtain OpenBSD, create a virtual machine with qemu and set up your OpenBSD system.


What is OpenBSD

OpenBSD is free operating system that strives for being secure and actively preventing security fails by minimizing attack surface. The code base is reviewed regularly (every 6 months).

Obtaining the Image

You can download the latest image by visiting the download page or download OpenBSD 7.2 iso image directly from here.

Creating Virtual Machine

Now that we have downloaded the image, we only have create the virtual hard disk.

qemu-img create -f qcow2 openbsdbox.qcow2 10G

This command creates a dynamically allocated virtual hard disk with a maximum size of 10GB with the name openbsdbox.img and the file format qcow2. Dynamically allocated means that if 2GB of the HD are used, the virtual HD file will only be 2GB instead of 10GB.

Now, let's start our virtual machine with 4GB RAM and boot from disc

qemu-system-x86_64 -drive file=obsdbox.qcow2 -enable-kvm -m 4G -cdrom openbsd_install70.iso -boot once=d -vga vmware

Setup of OpenBSD

BTC: 1WLANzCKEuo8Zvssi84cyqTFePvQ8f8tW