KVM virt-install: Install OpenBSD As Guest Operating System

How do I install OpenBSD as guest operating system when using KVM? How can I use virt-install to setup OpenBSD VM under KVM running on a CentOS Linux 7 server?

OpenBSD is a UNIX like system based on Berkeley Software Distribution (BSD). It was forked form NetBSD and created by Theo de Raadt in 1995. OpenBSD is famous for quality code and documentation without compromising position on software licensing. OpenBSD is also well know for focus on security features such as Memory protection, cryptography, randomization and much more in default base installation. This page shows how to use the virt-install command line tool of KVM to setup OpenBSD guest VM.

How to install OpenBSD as guest operating system when using KVM

You need to first download OpenBSD iso image by visiting this page. You can use the wget command or lftp command or curl command to grab the ISO image as follows. The following command will download OpenBSD v6.3 64 bit (AMD64) iso file on a CentOS 7 or Ubuntu 18.4/16.04 LTS or Debian Linux 9.x server:
# cd /var/lib/libvirt/boot/
# wget https://cloudflare.cdn.openbsd.org/pub/OpenBSD/6.3/amd64/install63.iso
# wget https://cloudflare.cdn.openbsd.org/pub/OpenBSD/6.3/amd64/SHA256
# chown qemu:qemu install63.iso

Verify SHA256 (256-bit) checksums for install63.iso:
# grep install63.iso SHA256 > /tmp/x
# sha256sum -c /tmp/x
# rm /tmp/x

Install OpenBSD 6.3 AMD64 VM on Linux KVM

Type the following command to install OpenBSD 6.3 64 bit with minimum 2GB RAM, 2 vcpu, 40GB disk space, and virbr0 network interface:
# virt-install \
--name=openbsd \
--virt-type=kvm \
--memory=2048,maxmemory=4096 \
--vcpus=2,maxvcpus=4 \
--cpu host \
--os-variant=openbsd5.8 \
--cdrom=/var/lib/libvirt/boot/install63.iso \
--network=bridge=virbr0,model=virtio \
--graphics=vnc \
--disk path=/var/lib/libvirt/images/openbsd.qcow2,size=40,bus=virtio,format=qcow2

Sample outputs:

Starting install...
Allocating 'openbsd.qcow2'                                                                                                                                                                  |  40 GB  00:00:00     
Domain installation still in progress. Waiting for installation to complete.

Use your local vnc viewer or type the following at server itself to view installer screen:
# vncviewer
To configure vnc login from another terminal over ssh and type:
# virsh dumpxml openbsd | grep vnc
<graphics type='vnc' port='5903' autoport='yes' listen=''>

Please note down the port value (i.e. 5903). You need to use an SSH client to setup tunnel and a VNC client to access the remote vnc server. Type the following SSH port forwarding command from your client/desktop:
$ ssh vivek@server1.cyberciti.biz -L 5903:
Once you have ssh tunnel established, you can point your VNC client at your own (localhost) address and port 5903 to continue with OpenBSD 6.3 installation:

Now, just follow on screen installation instructions and install OpenBSD as per your requirements:

Sorry, your browser doesn’t support HTML5 video.
(HTML5 Video 01: Click to play)

Make sure OpenBSD vm starts when Linux KVM box restarts

# virsh autostart openbsd

After Reboot My OpenBSD Guest Hangs At The Boot Screen…

Optional: Configure Serial Console Login and Redirection

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Tony Aug 1, 2010 @ 11:02

    Just tested it with OpenBDS 4.8

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz