OpenBSD VMM Install Guide
This guide provides instructions for installing an OpenBSD virtual machine inside vmm.
NOTE: This guide is no substitute for reading the OpenBSD FAQ. In particular, you should read the Installation Guide
vmm is OpenBSD's native hypervisor, which allows multiple virtual machines to run inside a single physical server (a dedicated server). A virtual machine is a guest which lives inside the host.
To install OpenBSD inside the virtual machine, you will need to connect to the
host which runs the hypervisor. This will provide you with serial console
access to the guest virtual machine. The hostname may be of the form
host.example.com
. Check your email or contact your network admin if you are
uncertain.
- NOTE: The host machine (
host.example.com
) is NOT the guest virtual machine (username.host.example.com
). You have root access inside your guest machine, but not the host machine. - NOTE: The host is not your personal virtual machine (VM). Your personal VM is a guest inside the host. Because the guest runs inside the host, to obtain serial console access to the guest, you must first log in to the host.
First, login to the host machine using ssh?. Once logged in, use vmctl to get serial console access.
$ vmctl console $VMNAME
Replace $VMNAME with the name of your virtual machine. The VM name will be in your email, and is likely your username.
NOTE: VMM uses ssh rather than VNC or a webpanel to administer your virtual machine. To view the serial console, vmctl uses cu(1).
The rest of the process follows the typical installation process of OpenBSD.
- At any time, if you want to escape the serial console, type
~.
(tilde followed by a period) or~^d
(tilde followed by ctrl+d). Note: ^d is ctrl+d. Sometimes, you may need to press enter a few times before the~.
or~^d
combination works. On some keyboards, you may need to type~~.
(two tildes followed by a period). - Installing the operating system requires a clean qcow2 image. See the reinstall guide for instructions on how to create a clean image.
- By default, your virtual machine will boot from the OpenBSD ISO image when there is no operating system installed. After the OS is installed, your virtual machine will automatically boot from hard disk instead of ISO image. There is no need to mount/unmount the ISO image.
Boot failed: not a bootable disk CD-ROM: E0 Loading /7.7/AMD64/CDBOOT probing: pc0 com0 mem[638K 2046M a20=on] disk: hd0+* cd0 >> OpenBSD/amd64 CDBOOT 3.65 boot>
- Once you see the bootup screen, follow the normal install instructions.
Upgrade/Reinstall with bsd.rd
NOTE: OpenBSD provides sysupgrade for unattended system upgrades. For routine system upgrades, sysupgrade is preferred over the manual upgrade described below.
If you want to upgrade or reinstall the operating system, follow the bsd.rd install guide. Either [[openbsd/bootconf|configure boot.conf]] to increase the timeout, or type something immediately after the boot prompt appears. This will prevent the system from automatically booting the default kernel. If the system automatically boots by accident, you will need to restart the system. To restart the system, log in and then run @@$ doas shutdown -r now@@ to reboot.
Bug fixes
vmm used to have a bug where virtual machines lose network connectivity after a few hours. Here is one workaround based on openbsd.amsterdam:
First, find the virtual machine's default gateway. This information should have been provided to you either in your registration email or by your network admin. If networking is set up properly, you can also find this using route:
$ route -n show | awk '/default/{print $2}' 198.51.100.1 2001:db8::1
Next, run this command to create a cronjob to run ping every 5 minutes:
# echo "*/5 * * * * -n ping -c3 198.51.100.1" >> /var/cron/tabs/root
Note: You must replace 198.51.100.1 with your actual default gateway.
This helps ensure that ping runs every 5 minutes the background to keep the network alive.
See Also
vmctl(8) | VMM User Guide |