Sent with Proton Mail secure email.
On Thursday, 17 July 2025 at 05:20, Thomas Klausner <w...@netbsd.org> wrote:
> Hi!
>
> Thanks for the replies.
>
> I guess my next question is, how do I find out the correct TTY (or
> whatever) to use to talk to the host, since /dev/tty00 doesn't work
> for me. I'm using virtual hosting at a provider, so I don't know the
> configuration from the outside.
>
> I'll attach the dmesg in case it gives some clues.
Yes, it does...
It does not show any serial port present. I don't know what is the interface of
your provider, but in the case of ProxMox, in the Options tab, there is 'QEMU
guest agent' setting, which can be 'off', 'ISA' or 'Virtio'. When I select
'ISA' and reboot the machine, I automagically get a com port, which on -current
always shows as tty00:
...
com0 at acpi0 (COM1, PNP0501-1): io 0x3f8-0x3ff irq 4
com0: ns16550a, 16-byte FIFO
...
This way then it works as expected. If I add 2 more serial ports to the VM
(host sockets), I get:
...
com0 at acpi0 (COM3, PNP0501-3): io 0x3e8-0x3ef irq 4
com0: ns16550a, 16-byte FIFO
com1 at acpi0 (COM2, PNP0501-2): io 0x2f8-0x2ff irq 3
com1: ns16550a, 16-byte FIFO
com2 at acpi0 (COM1, PNP0501-1): io 0x3f8-0x3ff irq 4
com2: ns16550a, 16-byte FIFO
...
and the one to use for qemu-ga still stays as /dev/tty00.
So there should be some way to modify the machine definition at your provider
to enable ISA-serial qemu-ga communication. FWIW I am attaching the full qemu
command line used to start this NetBSD guest.
Chavdar
> Thomas
>
> On Tue, Jul 15, 2025 at 01:08:19PM +0000, ci4ic4 wrote:
>
> > Just to confirm, I tweaked /etc/rc.d/qemu-quest-agent to have only
> >
> > command_args="-c /usr/pkg/etc/qemu/qemu-ga.conf"
> >
> > and set the above file as:
> >
> > [general]
> > daemon=true
> > method=isa-serial
> > path=/dev/tty00
> > pidfile=/var/run/qemu-ga.pid
> > logfile=/var/log/qemu-ga/qemu-ga.log
> > statedir=/var/run
> > verbose=true
> > blacklist=
> > allow-rpcs=guest-get-load,guest-ssh-remove-authorized-keys,guest-ssh-add-authorized-keys,guest-ssh-get-authorized-keys,guest-get-osinfo,guest-get-timezone,guest-get-users,guest-get-host-name,guest-exec,guest-exec-status,guest-network-get-interfaces,guest-file-flush,guest-file-seek,guest-file-write,guest-file-read,guest-file-close,guest-file-open,guest-shutdown,guest-info,guest-set-time,guest-get-time,guest-ping,guest-sync,guest-sync-delimited
> >
> > Now ProxMox does not complain that the guest agent is not running and the
> > IP address of the client is correctly displayed.
> >
> > (I just enabled all the rpcs, maybe that is by default, never checked).
> >
> > Sent with Proton Mail secure email.
> >
> > On Tuesday, 15 July 2025 at 13:16, ci4ic4 ci4...@proton.me wrote:
> >
> > > Sent with Proton Mail secure email.
> > >
> > > On Tuesday, 15 July 2025 at 12:51, ci4ic4 ci4...@proton.me wrote:
> > >
> > > > Sent with Proton Mail secure email.
> > > >
> > > > On Tuesday, 15 July 2025 at 10:47, Thomas Klausner w...@netbsd.org
> > > > wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Is anyone using qemu-guest-agent?
> > > >
> > > > Yes,
> > > >
> > > > > I wanted to set it up in a virtual environment, but the defaults don't
> > > > > work (i.e. without a config file):
> > > > >
> > > > > # /etc/rc.d/qemu-guest-agent start
> > > > > Starting qemu_guest_agent.
> > > > > 1752572488.279750: critical: error opening channel '/dev/tty00':
> > > > > Device not configured
> > > > > 1752572488.279898: critical: failed to create guest agent channel
> > > > > 1752572488.279972: critical: failed to initialize guest agent channel
> > > > > 1752572488.280036: critical: error initializing guest agent
> > > > >
> > > > > the package does not install an example config, nor could I find one
> > > > > in the distribution tarball, and I don't know what I should use as a
> > > > > config.
> > > >
> > > > There is no config file as far as I understand it - it is the command
> > > > line parameters:
> > > >
> > > > ...
> > > > command_args="-d -m isa-serial -p /dev/tty00 -r -t /var/run -f
> > > > /var/run/${name}.pid"
> > > > ...
> > > >
> > > > from /etc/rc.d/qemu-quest-agent, so I have:
> > > > ...
> > > > # ps axll | grep qemu-ga
> > > > 0 556 1 0 85 0 26752 2032 poll Isl ? 0:00.00 /usr/pkg/bin/qemu-ga -d -m
> > > > isa-serial -p /dev/tty00 -r -t /var/run -f /var/run/qemu_guest_agent.pid
> > > > ...
> > > >
> > > > This VM runs under ProxMox and has a serial port added to the
> > > > configuration - as a socket, which appears as the only option anyway, I
> > > > have no idea how it is used. In the options setup the QEMU guest agent
> > > > is enabled, usually as ISA - as it shows above - although it apparently
> > > > runs the same if defined as VirtIO.
> > > >
> > > > The graphics device is defined as SPICE and using it this way is quite
> > > > reasonable, with perfectly working sound and (llvmpipe) 3D
> > > > acceleration. The only trouble I am having is that I can't get more
> > > > than 1280x768, for some reason (it is using VESA).
> > > >
> > > > > Thanks,
> > > > > Thomas
> > > >
> > > > FWIW, Chavdar
> > >
> > > (for some reason, sent twice by the web client, no idea why).
> > >
> > > I mean, there is no configuration file in the package, of course.
/usr/bin/kvm -id 108 -name ym1r,debug-threads=on
-no-shutdown
-chardev socket,id=qmp,path=/var/run/qemu-server/108.qmp,server=on,wait=off
-mon chardev=qmp,mode=control
-chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect-ms=5000
-mon chardev=qmp-event,mode=control
-pidfile /var/run/qemu-server/108.pid
-daemonize
-smbios type=1,uuid=691dc970-0c1c-43fc-bda9-1a7347962065
-smp 4,sockets=1,cores=4,maxcpus=4
-nodefaults
-boot
menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg
-vnc unix:/var/run/qemu-server/108.vnc,password=on
-cpu
qemu64,+abm,+aes,+avx,+avx2,+bmi1,+bmi2,enforce,+f16c,+fma,+kvm_pv_eoi,+kvm_pv_unhalt,+movbe,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3,+xsave
-m 6144
-object iothread,id=iothread-virtio0
-object iothread,id=iothread-virtio1
-global ICH9-LPC.disable_s3=1
-global ICH9-LPC.disable_s4=1
-readconfig /usr/share/qemu-server/pve-q35-4.0.cfg
-device vmgenid,guid=db15cd63-6421-4d11-b5a6-e62cebacd4c7
-chardev
socket,id=serial0,path=/var/run/qemu-server/108.serial0,server=on,wait=off
-device isa-serial,chardev=serial0
-chardev
socket,id=serial1,path=/var/run/qemu-server/108.serial1,server=on,wait=off
-device isa-serial,chardev=serial1
-device ich9-intel-hda,id=audiodev0,bus=pci.2,addr=0xc
-device
hda-micro,id=audiodev0-codec0,bus=audiodev0.0,cad=0,audiodev=spice-backend0
-device
hda-duplex,id=audiodev0-codec1,bus=audiodev0.0,cad=1,audiodev=spice-backend0
-audiodev spice,id=spice-backend0
-device
qxl-vga,id=vga,vgamem_mb=128,ram_size_mb=512,vram_size_mb=256,max_outputs=4,bus=pcie.0,addr=0x1
-chardev socket,path=/var/run/qemu-server/108.qga,server=on,wait=off,id=qga0
-device isa-serial,chardev=qga0
-object rng-random,filename=/dev/urandom,id=rng0
-device virtio-rng-pci,rng=rng0,max-bytes=1024,period=1000,bus=pci.1,addr=0x1d
-device virtio-serial,id=spice,bus=pci.0,addr=0x9
-chardev spicevmc,id=vdagent,name=vdagent
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0
-chardev spiceport,id=foldershare,name=org.spice-space.webdav.0
-device virtserialport,chardev=foldershare,name=org.spice-space.webdav.0
-spice
tls-port=61000,addr=127.0.0.1,tls-ciphers=HIGH,seamless-migration=on,streaming-video=all
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on
-iscsi initiator-name=iqn.1993-08.org.debian:01:29f6f0929ac5
-drive if=none,id=drive-ide2,media=cdrom,aio=io_uring
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2
-drive
file=/rpool-vms/images/108/vm-108-disk-0.qcow2,if=none,id=drive-virtio0,cache=writethrough,format=qcow2,aio=io_uring,detect-zeroes=on
-device
virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,iothread=iothread-virtio0,bootindex=100
-drive
file=/dev/zvol/etang/vm-108-disk-0,if=none,id=drive-virtio1,cache=writethrough,format=raw,aio=io_uring,detect-zeroes=on
-device
virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb,iothread=iothread-virtio1
-netdev
type=tap,id=net0,ifname=tap108i0,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on
-device
virtio-net-pci,mac=BC:24:11:12:FB:DF,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256
-netdev
type=tap,id=net1,ifname=tap108i1,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on
-device
virtio-net-pci,mac=BC:24:11:29:56:87,netdev=net1,bus=pci.0,addr=0x13,id=net1,rx_queue_size=1024,tx_queue_size=256
-machine type=q35+pve1