Signal Desktop on OpenBSD via vmm(4)

X11 forwarding to the rescue

Early this year, I completely switched over to Signal and I’m fortunate enough to have everyone that I talk to switch over as well. I know I wrote what some might view as a hit piece on Signal, but I have immense respect for the project and will continue to use it until an actually viable alternative comes along.

Unfortunately, their desktop application isn’t natively available for OpenBSD. A solution that’s worked decently enough for me is to run it via X11 forwarding on a Ubuntu VM running on vmm(4)—OpenBSD’s built-in hypervisor.

setting up the VM

I recommend reading the FAQ on Virtualization first, but here’s a quick overview. Note that I’ll be skipping the networking bits so I highly recommend reading the FAQ to get your VM connected to the internet.

Create a disk image for the VM to install onto.

$ vmctl create -s 30G ubuntu.img

I’m using the Ubuntu 18.04 LTS mini.iso. I ran into issues with the 20.04 LTS ISO, but I think you should be able to dist-upgrade from 18.04 without much trouble. Once you have the ISO downloaded somewhere, edit /etc/vm.conf:

vm "ubuntu" {
    memory 2G 
    cdrom "/path/to/mini.iso"
    disk "/path/to/ubuntu.img"
    interfaces 1
    local interface tap
    owner icy   # this is your user
    disable
}

Start and (optionally) enable vmd(8).

$ doas rcctl -f start vmd
$ doas rcctl enable vmd

We can now boot into the VM, and interface via the serial console. This can be done using vmctl(8).

$ vmctl start -c ubuntu  # note -c for console

Hit Tab on the bootloader screen to edit the kernel parameters. We want to force it to use the serial console for installation. This is done by adding console=ttyS0,115200 on the line shown. If there’s a quiet, delete that and add the above. You can then continue on with the installation—install OpenSSH, add your keys etc.

Once installed, remove the cdrom line from your vm.conf and start the VM without the serial console.

$ vmctl start ubuntu

installing and running Signal Desktop

SSH into the VM with X11 forwarding enabled:

$ ssh -Y myvmhost

Install signal-desktop, following the instructions at https://signal.org/download. You can now run the signal-desktop command from the VM’s shell. As long as it spawns a GUI, the multitude of warnings and errors it produces can ge ignored.

Below is a helper script to launch Signal from your host machine:

#!/bin/sh
# signal: launch signal-desktop via a vm (vmm(4))

status="$(vmctl status ubuntu | grep running)"
[[ "$status" == "" ]] && {
    vmctl start ubuntu
    sleep 10
}

ssh -Y pantwo signal-desktop &> /dev/null

signal desktop

caveats

Questions or comments? Send an email.