[Howto], wayland, using QEMU VM

I use QEMU VMs. QEMU is not compliant with wayland then I use “GDK_BACKEND=x11”.

Here is the script to launch a QEMU VM and to minimize it in the kde systray with kdocker.


#!/bin/bash

bash -c '
GDK_BACKEND=x11 qemu-kvm -enable-kvm
-m 4G -smp 4 -cpu host
-display gtk,gl=on,zoom-to-fit=off
-device virtio-vga-gl
-device qemu-xhci,p2=5,p3=5,id=xhci
-device usb-kbd
-device usb-mouse
-device intel-hda
-device hda-duplex,audiodev=snd0
-audiodev pipewire,id=snd0
-device usb-host,vendorid=0x046d,productid=0x0825
-device usb-host,vendorid=0x0b05,productid=0x190e
-boot menu=on
-nic bridge,mac=00:16:3e:76:a3:e4
~/QEMU_VM/android_x86_64_8.1-r6.img
' &

while [ true ]
do
sleep 5s
status=$(wmctrl -l | grep "QEMU")
if [ "$status" != "" ] ; then
break
fi
done
WID="$(wmctrl -lx | grep "QEMU")"; QT_QPA_PLATFORM=xcb kdocker -qtw "${WID%% *}" -i ///usr/share/icons/breeze/devices/64/smartphone.svg &

For this the same remark as in your other post. This is unusable in the form it is posted above.

I tried to use it, but it does not work.
The result is `` and when I insert the script, then this has no effect.

When I hit the </> button on a new line (I assume you do not want to have the script merged in your text on the same line), I get three “backqoutes” on that line, then a new line with “type or paste code here” and a third line with again three “backquotes”. And doing what the explanations says works perfect:

henk@boven:~> uname -r
5.14.21-150500.55.39-default
henk@boven:~> 

@promeneur use three “`” and enter the interpreter eg bash, then finish with three “`”. Also check preferences for markdown use…