Backing Up OpenBSD VM

Modern day OpenBSD has qemu-ga as a package on its own. This introduces that:

https://undeadly.org/cgi?action=article;sid=20200514073852

But there has been more work since. It still revolves around this simple conf tweak:

agent: 1,type=isa

$ cat /etc/qemu/qemu-ga.conf
[general]
daemonize = 1
pidfile = /var/run/qemu-ga.pid
verbose = 1
method = isa-serial
path = /dev/cua01
statedir = /var/run

This config works for me on an OpenBSD 7.0 amd64 guest.

Note it does presume 'serial0: ' exists, so the next com port is for the guest agent:

...
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
...

I know this is a very big delay from your earlier posts, and perhaps you've discovered this in the interum, but .. in case not ..
Thanks a bunch!
 
Right. I've already installed the Qemu package in OpenBSD (required to get the guest agent) and had related discussions on their mailing list. However, I've circled back to Proxmox because from what I understand, OpenBSD doesn't have drivers for the default device Qemu uses (I just woke up, but IIRC virtio-serial), so I'm checking into how to specify using ISA-serial instead.
Hello!

It is now possible to make QEMU Agent working under Proxmox VE - tested Proxmox 7.4-3 Host and OpenBSD 7.2 Guest.

Disclaimer:
However please note that OpenBSD does not support all Agent commands - especially not sure about
filesystem snapshots

You have to:
- go to VM -> Options -> Qemu guest Agent
- click on Edit
- check Advanced and both:
- check on: `Enabled`
- change Type to: `ISA`
- as shown on Picture below:

proxmox-gust-agent-isa.png

Now normally boot OpenBSD guest (tested 7.2). Verify that OpenBSD detected new serial port with dmesg, for example:

Bash:
dmesg | grep COM

com0 at acpi0 COM1 addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo

Now install Qemu Guest Agent package using:

Bash:
pkg_add qemu-ga

And add this to `/etc/rc.conf.local`:

Bash:
pkg_scripts=qemu_ga
qemu_ga_flags="-t /var/run/qemu-ga -m isa-serial -p /dev/cua00 -f /var/run/qemu-ga/qemu-ga.pid"

Try to stop and start `qemu_ga` service:

Bash:
/etc/rc.d/qemu_ga stop
/etc/rc.d/qemu_ga start

Verify that agent is still running with `ps axf`. In Proxmox VE -> Summary you should now see assigned IP address, you can
also try in Proxmox shell some Agent commands, for example:

Bash:
qm guest cmd MY_VM_ID info
qm guest cmd MY_VM_ID get-osinfo
 
Last edited:
  • Like
Reactions: Darkk
Yes, this is working for quite some time. The biggest problem is still that the FreeBSD implementation of the QEMU guest agent isn't supporting fsfreeze, so you can't rely on the data integrity of snapshot-mode backups. So if you want a valid backup you will have to use the stop mode, shutting the VM down for every backup which is very annoying because of the downtime and it will prevent you from using dirty-bitmapping, so backups will take much longer.
 
Last edited:
Hi folks,

Sorry bumping this up but OpenBSD 7.6 just come out so I gave another shot for this guest agent. Referring to this tutorial: https://undeadly.org/cgi?action=article;sid=20200514073852

Can anybody tell me how to do the virtio port modification with virsh edit <vm>

I have these relevant sections (they work with Linuxes no problem):

Code:
<channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>


So I guess what I need to accomplish here is to give the guest_agent device an id, qga0 and bind this to the regular serial port somehow.

Any help is welcome.
 
if you enable the "agent" option on the VM, then PVE will automatically generate a serial device for the agent:

Code:
  -chardev 'socket,path=/var/run/qemu-server/<VMID>.qga,server=on,wait=off,id=qga0' \
  -device 'virtio-serial,id=qga0,bus=pci.0,addr=0x8' \
  -device 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0' \

and PVE will automatically attempt to use that socket to communicate with the guest agent.

the regular serial port (if there is one ;)) should be separate from the agent one..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!