OpenBSD has had for a couple of years its own virtual machine system,
vmm. Despite being at a fairly early stage , its development is proceeding at a fast pace, it is a joy to configure and use – OpenBSD style, and I’ve been using it to run Alpine Linux VMs for a while.
It took me some time to get Ubuntu running on it, but the final solution is straightforward. So here are my notes on how to do this.
I wanted some Ubuntu/Debian-like VM on my OpenBSD 6.4 machine because of “reasons” (some Machine Learning packages don’t like OpenBSD nor Alpine Linux).
For those who don’t know,
vmm is OpenBSD’s very own virtual machine manager.
As with most software coming from OpenBSD’s developers, it is well-thought,
and it is simple to configure, with a very clear syntax.
The main obstacle for installing Ubuntu/Debian on
vmm is that the OS should
support installation via serial console.
Plenty of guides exist for configuring Alpine Linux on
vmm (it supports
serial console installation out of the box), but AFAIK
only a couple are dedicated to Ubuntu/Debian:
-  for Ubuntu cloud images – an overkill for what I need,
-  for Debian.
The latter option, unfortunately, requires making the actual installation via
qemu, and then importing the image from
I thought there should be a more direct way of doing this, and indeed there was.
I’ll give the final solution first, and then enumerate failed attempts – should anyone wish to try different solutions.
The solution was to use the minimal installer for Ubuntu 18.04. I tried many versions/distros: this is the only one that did not cause any troubles.
To get it running, we will need to:
- edit the installation ISO image to support the serial console,
- proceed with the standard installation on
Note that once the installation image is configured for serial console
installation, the actual configuration and installation on
Preparing the ISO image
We first need to enable serial console installation for the ISO image.
This requires installing
The following steps are adapted from .
First download the minimal installer image,
mini.iso, from the link above.
With root privileges, run:
This mounts the ISO image read-only and copies its content into
Then edit the files as follows:
For the installation, we will be using the default “install” mode.
Finally, create the new image,
I henceforth refer to
Installation steps are pretty standard and distro-independent .
We first create the disk where the VM will be installed.
Note that the actual size used by the newly created
actually fairly low (the space is dynamically allocated):
vmm has a very nice configuration syntax.
For the installation, we will include the following in
user is replaced by your user; this allows such user to start/stop/pause
the VM without root privileges.
Now for the installation:
And follow the installation. Simple as that.
After the installation, you can start the VM with the same command.
However, I’d recommend setting up an
ssh server on the machine, and to
launch the VM without the console:
Authentication via public key is a must. Note that this also allows X forwarding:)
Optionally, you can now remove the parameter
The steps for installing Ubuntu or Debian are more or less as follows:
- edit the ISO image to support serial console installation,
- install the thing with
Simple enough, huh? Well, I tried so many different Ubuntu&Debian distros, until I found one that worked (see above).
Since along the way I solved some problems that brought me closer (but not close enough) to installing other Ubuntu versions, I trace my steps here in case someone (e.g., my future self) encounters them.
I stopped trying with Debian distros because:
- the installer wouldn’t see the installation cdrom, and even when opening a shell I could not find the device,
- the installer wouldn’t see my network interface.
Debian can be installed with the
qemu method , but that’s out of scope.
In “Alternative method” I reference a guide which managed to install
vmm by first adding the
virtio modules on the image.
As for Ubuntu distros, I did make some progress. For instance, with Ubuntu server 16.04.5, I managed to get quite far with the installation process.
To configure a Ubuntu ISO, one can proceed as we did above for the
minimal Ubuntu install: extract the image’s content, edit its files,
and create a new ISO with serial console activated.
(Note that this time the files to edit are in
However, once the installation is launched, it usually does not recognise
The solution to this is to escape to a shell and to mount the (virtual) CD
In my case this meant running:
mount /dev/sr0 /cdrom.
After this, the installation will proceed as normal, but it will get stuck with error:
I asked people on
I checked the network connection was working, and I tried various disk
partitioning methods without luck: I could not move past this error.
On #openbsd, I was pointed out to a guide for installing Debian on
vmm . This guide uses a boot image – rather than an ISO, which still
poses the issue that cdrom and network interface are not recognised.
To solve this, they suggest uncompressing the image, and adding the
virtio modules before installation.
Concluding remarks (actually, rather OT)
vmm is awesome.
It is clear, well-structured, and competitors such as VirtualBox have already
much to envy (e.g., a clean text-based configuration file and sensible
command line options).
Clearly, there are several things in
vmm’s TODO list (e.g., ), but I see it
as very promising software, and I can only thank its developers sincerely.
Props also go to services like OpenBSD Amsterdam,
who’ve been offering OpenBSD VMs using
vmm for long: their effort certainly