virsh qemu-monitor-command is the answer. You can use it by following: For qmp command: # virsh qemu-monitor-command $VM_NAME $QMP_COMMAND For hmp commmand: # virsh qemu-monitor-command --hmp $VM_NAME $HMP_COMMAND
On Thu, May 31, 2018 at 2:28 AM, Jakob Bohm <jb-gnumli...@wisemo.com> wrote: > On 29/05/2018 21:15, Lentes, Bernd wrote: > >> Hi, >> >> sorry for asking this propable silly question, but i googled and didn't >> find an appropriate answer. >> I have a SLES 12 SP3 host with a SLES 10 SP4 guest and some windows 7 >> guests. I'd like to connect to both os when they are running.. >> The command-line for the SLES 10 is: >> ps aux|grep kvm|grep -E 'chardev|mon' >> qemu 11131 4.2 53.0 13463948 8583652 ? Sl May03 1605:21 >> /usr/bin/qemu-system-x86_64 -machine accel=kvm -name >> guest=mausdb2,debug-threads=on -S -object secret,id=masterKey0,format=ra >> w,file=/var/lib/libvirt/qemu/domain-10-mausdb2/master-key.aes -machine >> pc-i440fx-2.9,accel=kvm,usb=off,dump-guest-core=off -m 8320 -realtime >> mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid >> 5db2211a-1b91-76a1-11dd-1bf1e85ace75 -no-user-config -nodefaults >> -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-10- >> mausdb2/monitor.sock,server,nowait -mon >> chardev=charmonitor,id=monitor,mode=control >> -rtc base=utc -no-shutdown -boot strict=on -device >> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive >> file=/var/lib/libvirt/images/mausdb/mausdb.dd,format=raw,if= >> none,id=drive-virtio-disk0,cache=none -device >> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virti >> o-disk0,id=virtio-disk0,bootindex=1 -drive file=/mnt/idg-2/SysAdmin_AG_Wu >> rst/software_und_treiber/linux/knoppix/KNOPPIX_V8.1-2017-09- >> 05-DE.iso,format=raw,if=none,id=drive-ide0-0-0,readonly=on,cache=none >> -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 >> -netdev tap,fd=24,id=hostnet0 -device e1000,netdev=hostnet0,id=net0, >> mac=52:54:00:37:92:aa,bus=pci.0,addr=0x3 -vnc 127.0.0.1:0 -device >> cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device >> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on >> >> I created the guest with virt-manager. Is there a way to connect with >> qemu to the console/GUI of a running guest ? >> >> It's very close, but not exact (you need to do it one command at a time, > but there may be a libvirt programming interface to do this more easily > for automation). > > # virsh qemu-monitor-command --help > > For example > > # virsh qemu-monitor-command $guestname --hmp help > > Enjoy > > Jakob > -- > Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com > Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10 > This public discussion message is non-binding and may contain errors. > WiseMo - Remote Service Management for PCs, Phones and Embedded > > > > -- Best regards, ----------------------------------- Han Han Quality Engineer Redhat. Email: h...@redhat.com Phone: +861065339333