KVM virt-install: Install OpenBSD As Guest Operating System

Posted on in Categories , , , , last updated May 6, 2017

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.

OpenBSD Installation

You need to first download OpenBSD iso image by visiting this page. You can use the wget command to grab the same as follows. The following command will download OpenBSD v4.7 64 bit (AMD64) iso file:
cd /tmp
wget http://filedump.se.rit.edu/pub/OpenBSD/4.7/amd64/install47.iso

Install OpeBSD 4.7 AMD64

Type the following command to install OpenBSD v4.7 64 bit with 512 MB RAM, 1 vcore cpu, 5GB disk space, br0 and br1 network interface:

virt-install \
-n openbsd1 \
-r 512 \
--vcpus=1 \
--os-variant=openbsd4 \
--accelerate \
-v -c /tmp/install47.iso \
-w bridge:br0 -w bridge:br1 \
--vnc \
--disk path=/raid10/kvm/openbsd1.img,size=5

Sample outputs:

Starting install...
Creating domain...                                                                                                                                                                                                    |    0 B     00:01     

Domain installation still in progress. You can reconnect to
the console to complete the installation process.

Use your local vnc viewer or type the following at server itself to view installer screen:
# vncviewer
OR run it over the ssh session, enter:
# ssh -X -C [email protected]
# virt-viewer openbsd1

Sample outputs:

Fig.01: Creating OpenBSD guest with virt-install and installing the same with vnc
Fig.01: Creating OpenBSD guest with virt-install and installing the same with vnc

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

After Reboot My OpenBSD Guest Hangs At The Boot Screen…

Optional: Configure Serial Console Login and Redirection

This entry is 12 of 14 in the CentOS / Redhat (RHEL) KVM Virtulization series. Keep reading the rest of the series:
  1. CentOS / Redhat: Install KVM Virtualization Software
  2. CentOS / Redhat: KVM Bridged Network Configuration
  3. KVM virt-manager: Install CentOS As Guest Operating System
  4. KVM virt-install: Install FreeBSD / CentOS As Guest Operating System
  5. KVM: Install CentOS / RHEL Using Kickstart File (Automated Installation)
  6. Troubleshooting KVM Virtualization Problem With Log Files
  7. KVM Virsh: Redirect FreeBSD Console To A Serial Port
  8. KVM: Starting / Stopping Guest Operating Systems With virsh Command
  9. Linux KVM: Disable virbr0 NAT Interface
  10. FreeBSD / OpeBSD Running in KVM Does Not Accept FTP Traffic
  11. KVM: Start a Virtual Machine / Guest At Boot Time
  12. KVM virt-install: Install OpenBSD As Guest Operating System
  13. Linux KVM: OpenBSD Guest Hangs At Starting tty Flags
  14. KVM Virtualization: Start VNC Remote Access For Guest Operating Systems

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.