You are not logged in.

#1 2025-03-03 10:29:17

bbbb4
Member
Registered: 2025-03-03
Posts: 5

Example to run a virtual machine with Qemu

Enable IOMMU in BIOS/UEFI on computer (Intel VT-d, AMD-Vi, IOMMU)
Checking support for KVM on the host

lscpu | grep Virtualization
lsmod | grep kvm

Installing needed components

sudo pacman -S qemu-base qemu-desktop edk2-ovmf dnsmasq swtpm virt-viewer --noconfirm

Disk manipulations -----------------------

qemu-img create -f raw VirtualDisk.img 10G
qemu-img info VirtualDisk.img
qemu-img check VirtualDisk.img
qemu-img resize -f raw VirtualDisk.img +1G
qemu-img convert -p VirtualDisk.vdi -O raw VirtualDisk.img
qemu-img convert -p VirtualDisk.img -O vdi VirtualDisk.vdi
qemu-img convert -p VirtualDisk.img -O qcow2 VirtualDisk_NEW.img
# The shrink work only with raw images
qemu-img resize -f raw --shrink VirtualDisk.img -500M

Boot from live disk for repair after shrinking

lsblk
sudo gdisk /dev/sda
r -> w -> y

Snapshots --------------------------------
https://people.redhat.com/pbonzini/qemu … mages.html

qemu-img snapshot -l VirtualDisk.img          # List snapshots
qemu-img snapshot -c snapshot VirtualDisk.img # Creates a snapshot
qemu-img snapshot -a snapshot VirtualDisk.img # Applies a snapshot
qemu-img snapshot -d snapshot VirtualDisk.img # Deletes a snapshot

Check if virtual host pass

virt-host-validate 

   
Useful commands

qemu-system-x86_64 -machine q35,help
qemu-system-x86_64 -device virtio-vga-gl,help
qemu-system-x86_64 -accel help

Setting the network

echo 'allow virbr0' | sudo tee -a /etc/qemu/bridge.conf
systemctl enable --now libvirtd
sudo virsh net-define /etc/libvirt/qemu/networks/default.xml
sudo virsh net-start --network default
sudo virsh net-autostart --network default
sudo virsh net-list --all
sudo virsh net-info --network default
ip addr show virbr0

Settings for network sharing

sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv6.conf.default.forwarding=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1

Firewall Settings if iptables is enable -----------------------

sudo iptables -N LIBVIRT_FWI
sudo iptables -N LIBVIRT_FWO
sudo iptables -N LIBVIRT_FWX
sudo iptables -N LIBVIRT_INP
sudo iptables -N LIBVIRT_OUT
sudo iptables -A INPUT -j LIBVIRT_INP -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWX -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWI -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWO -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -i wlp2s0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A OUTPUT -j LIBVIRT_OUT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWI -d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWI -o virbr0 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWO -s 192.168.122.0/24 -i virbr0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWO -i virbr0 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWX -i virbr0 -o virbr0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_INP -i virbr0 -p udp -m multiport --dports 53,67 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_INP -i virbr0 -p tcp -m multiport --dports 53,67 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_OUT -o virbr0 -p udp -m multiport --dports 53,68 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_OUT -o virbr0 -p tcp -m multiport --dports 53,68 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables-save -f /etc/iptables/iptables.rules

For Linux systems ---------------

cp -v /usr/share/edk2/x64/OVMF_VARS.4m.fd Linux_VARS.4m.fd

On Linux guest

sudo pacman -S spice-vdagent qemu-guest-agent vulkan-virtio --noconfirm
sudo sed -i 's/^MODULES=([^)]*/& virtio virtio_blk virtio_pci virtio_net virtio_ring/' /etc/mkinitcpio.conf ; sudo mkinitcpio -P
sudo dmesg | grep drm
inxi -G

For Windows11 systems -------------

cp -v /usr/share/edk2/x64/OVMF_VARS.4m.fd Windows11_VARS.4m.fd

On Windows guest
Spice driver -> https://www.spice-space.org/download/wi … 0.10.0.msi
Virtio Driver -> https://fedorapeople.org/groups/virt/vi … io-win.iso
---------------------------------------------------------------
Below is example script to run Windows11 into a virtual machine
Uncomment desire option from the file
Documentation for options -> https://www.qemu.org/docs/master/system … npage.html

#!/usr/bin/env bash
set -euo pipefail

# chmod a+x Qemu_Windows11_SPICE_client.sh
# To start app use ./Qemu_Windows11_SPICE_client.sh

# Check for needed dependencies --------------
deps=(qemu-system-x86_64 swtpm remote-viewer socat)
for dep in "${deps[@]}"; do
    command -v "$dep" >/dev/null || { echo "Missing dependency: $dep"; exit 1; }
done

Name=Windows11
mkdir -p /tmp/${Name}_tpm
swtpm socket --tpmstate dir=/tmp/${Name}_tpm --ctrl type=unixio,path=/tmp/${Name}_tpm/tpm --tpm2 --daemon
echo -e " Trusted Platform Module terminal\n Close after shutdown virtual $Name !!!\n"
options=(
 -name $Name -nodefaults\
 # Time standard
 -rtc base=localtime\
 # Set Machine
 -machine type=q35,vmport=off,hmat=on,pflash0=ovmf_code_raw,pflash1=ovmf_vars_raw\
 # Processor -> lscpu | grep -E "CPU\(s):|Thread|Core\(s|Socket"
 -cpu host,topoext=on,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,+avx,+avx2,+fma,+bmi2\
 -smp $(nproc),sockets=1,cores=4,threads=2,maxcpus=$(nproc)\
 # Acceleration and RAM memory --------------
 -accel kvm -m 4100M\
 # QEMU monitor -> [url]https://wiki.archlinux.org/title/QEMU#QEMU_monitor[/url]
 # Connecting -> socat - UNIX-CONNECT:/tmp/${Name}.sock
 # Connecting -> ncat -U /tmp/${Name}.sock
 -monitor unix:/tmp/${Name}.sock,server,nowait\
 # Bios firmware
 -blockdev driver=file,filename=/usr/share/edk2/x64/OVMF_CODE.4m.fd,node-name=ovmf_code_file,read-only=on\
 -blockdev driver=raw,node-name=ovmf_code_raw,read-only=on,file=ovmf_code_file\
 -blockdev driver=file,filename=${Name}_VARS.4m.fd,node-name=ovmf_vars_file\
 -blockdev driver=raw,node-name=ovmf_vars_raw,file=ovmf_vars_file\
 # CD-ROM ---------------
 -device virtio-scsi-pci,id=scsi0\
 # Empty CD-ROM
 -drive file=,if=ide,index=0,media=cdrom,read-only=on\
 # ISO CD1
 # -drive file=Win11_25H2_English_x64.iso,if=ide,index=1,media=cdrom,read-only=on,format=raw\
 # ISO CD2
 # -blockdev driver=file,filename=virtio-win-0.1.266.iso,node-name=cd2_file,read-only=on\
 # -blockdev driver=raw,node-name=cd2_raw,file=cd2_file,read-only=on -device scsi-cd,drive=cd2_raw,bus=scsi0.0\
 # Hard drive ---------------
 # NVME driver
 # -blockdev driver=file,node-name=disk0_file,filename=${Name}.img,aio=io_uring,cache.direct=on,cache.no-flush=off\
 # -blockdev driver=raw,node-name=disk0_raw,file=disk0_file -device nvme,drive=disk0_raw,serial=myvirtdev0\
 # Virtio-blk driver
 -blockdev driver=file,node-name=disk1_file,filename=${Name}.img,aio=io_uring,cache.direct=on,cache.no-flush=off\
 -blockdev driver=raw,node-name=disk1_raw,file=disk1_file -object iothread,id=iothread1\
 -device virtio-blk-pci,drive=disk1_raw,iothread=iothread1,num-queues=$(nproc)\
 # Video ---------------
 # -vga none -device qxl-vga,vgamem_mb=64\
 -vga none -device virtio-vga-gl,disable-legacy=on,blob=on,hostmem=1G,packed=on\
 # Vulkan Support prerequisites -> QEMU >= 9.2.0, Linux kernel >= 6.13 and mesa >= 24.2.0
 # -vga none -device virtio-vga-gl,hostmem=1G,blob=on,venus=on,disable-legacy=on,packed=on\
 # Network -> [url]https://wiki.qemu.org/Documentation/Networking[/url] -------------
 # User network
 # -nic user,ipv6=off,model=e1000,mac=52:54:00:00:00:02\
 # Bridge network
 -nic bridge,br=virbr0,model=virtio-net-pci,mac=52:54:00:00:00:02\
 # Intel HD Audio ---------------
 -audiodev pa,id=snd0 -device ich9-intel-hda -device hda-duplex,audiodev=snd0\
 # Trusted Platform Module emulation ---------------
 -chardev socket,id=chrtpm,path=/tmp/${Name}_tpm/tpm\
 -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0,id=tpm0\
 # Pass-through host USB 3 device -> [url]https://wiki.archlinux.org/title/QEMU#Pass-through_host_USB_device[/url]
 # lsusb
 # sudo chown -v $USER:$USER /dev/bus/usb/002/006
 # -device qemu-xhci,id=xhci -device usb-host,hostdevice=/dev/bus/usb/002/006\
 # -device qemu-xhci,id=xhci -device usb-host,bus=xhci.0,vendorid=0x125f,productid=0xc13a\
 # -device qemu-xhci,id=xhci -device usb-host,bus=xhci.0,hostbus=2,hostport=6\
 # Enabling SPICE support (Copy & Paste) -> [url]https://www.spice-space.org/spice-user-manual.html[/url]
 -chardev spicevmc,id=ch1,name=vdagent\
 -device virtio-serial-pci\
 -display none\
 -spice unix=on,addr=/tmp/${Name}_spice,gl=on,disable-ticketing=on\
 # For qxl-vga -> -spice unix=on,addr=/tmp/${Name}_spice,disable-ticketing=on\
 # For qxl-vga -> -spice port=5924,disable-ticketing=on\
 -device virtserialport,chardev=ch1,id=ch1,name=com.redhat.spice.0\
 # USB 3 redirection with SPICE -> [url]https://www.spice-space.org/usbredir.html[/url]
 -device nec-usb-xhci,id=usb\
 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1\
 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2\
 # Mouse grab ---------------------
 -usb -device usb-tablet
 )
qemu-system-x86_64 ${options[@]} &
remote-viewer spice+unix:///tmp/${Name}_spice --title=$Name
# For qxl-vga -> spicy --uri="spice+unix:///tmp/${Name}_spice" --title=$Name
# For qxl-vga -> remote-viewer spice://127.0.0.1:5924 --title=$Name
# For qxl-vga -> spicy -h 127.0.0.1 -p 5924 --title=$Name
wait $!
rm -r "/tmp/${Name}_tpm" "/tmp/${Name}_spice"
exit 0

Last edited by bbbb4 (2026-01-14 08:49:45)

Offline

#2 2025-03-03 13:44:23

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 213

Re: Example to run a virtual machine with Qemu

bbbb4 wrote:
sudo pacman -S qemu-base qemu-desktop edk2-ovmf dnsmasq swtpm virt-viewer --noconfirm
echo 'allow virbr0' | sudo tee -a /etc/qemu/bridge.conf
grep -Ev '^$|^#' /etc/libvirt/libvirtd.conf
systemctl enable --now libvirtd
sudo virsh net-start --network default
sudo virsh net-autostart --network default
sudo virsh net-list --all
sudo virsh net-info --network default
ip addr show virbr0

# Firewall -----------------------
sudo iptables -N LIBVIRT_FWI
sudo iptables -N LIBVIRT_FWO
sudo iptables -N LIBVIRT_FWX
sudo iptables -N LIBVIRT_INP
sudo iptables -N LIBVIRT_OUT
sudo iptables -A INPUT -j LIBVIRT_INP -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWX -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWI -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -j LIBVIRT_FWO -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A FORWARD -i wlp2s0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A OUTPUT -j LIBVIRT_OUT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWI -d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWI -o virbr0 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWO -s 192.168.122.0/24 -i virbr0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWO -i virbr0 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_FWX -i virbr0 -o virbr0 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_INP -i virbr0 -p udp -m multiport --dports 53,67 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_INP -i virbr0 -p tcp -m multiport --dports 53,67 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_OUT -o virbr0 -p udp -m multiport --dports 53,68 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables -A LIBVIRT_OUT -o virbr0 -p tcp -m multiport --dports 53,68 -j ACCEPT -m comment --comment "Vitrual machine setting"
sudo iptables-save -f /etc/iptables/iptables.rules

Sad. Installing libvirt to use it only for the network configuration. You're missing out on so much libvirt - heh

Last edited by ReDress (2025-03-03 13:44:48)

Offline

#3 2025-03-03 14:56:40

cryptearth
Member
Registered: 2024-02-03
Posts: 1,904

Re: Example to run a virtual machine with Qemu

@OP
first: please use code tags
second: is there anything related to this uncommentd dump of stuff like questions, issues, advices? if you look for a dumbing host please see github

Offline

#4 2025-03-04 12:51:33

bbbb4
Member
Registered: 2025-03-03
Posts: 5

Re: Example to run a virtual machine with Qemu

Guys you are right, and this is my first post in the forum and still get used to work with this forum i will try to improve my posts. thank you for advices and have a nice day.

Offline

#5 2025-03-04 16:28:07

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: Example to run a virtual machine with Qemu

Don't use QXL, it's old & crusty. All the cool kids use virtio for the GPU stuff.


Jin, Jîyan, Azadî

Offline

#6 2025-03-07 09:37:27

bbbb4
Member
Registered: 2025-03-03
Posts: 5

Re: Example to run a virtual machine with Qemu

In some case, only Qxl video can be used to use the virtual machine so I have added it as an option that can be activated if is needed.

Offline

#7 2025-03-12 18:27:12

bbbb4
Member
Registered: 2025-03-03
Posts: 5

Re: Example to run a virtual machine with Qemu

Example script to run Arch linux into a virtual machine

#!/usr/bin/env bash
set -euo pipefail

# chmod a+x Qemu_Archlinux.sh
# To start app use ./Qemu_Archlinux.sh

# Check for needed dependencies --------------
deps=(qemu-system-x86_64 swtpm socat)
for dep in "${deps[@]}"; do
    command -v "$dep" >/dev/null || { echo "Missing dependency: $dep"; exit 1; }
done

Name=Archlinux
mkdir -p /tmp/${Name}_tpm
swtpm socket --tpmstate dir=/tmp/${Name}_tpm --ctrl type=unixio,path=/tmp/${Name}_tpm/tpm --tpm2 --daemon
echo -e " Trusted Platform Module terminal\n Close after shutdown virtual $Name !!!\n"
options=(
 -name $Name -nodefaults\
 # Set Machine
 -machine type=q35,vmport=off,hmat=on,pflash0=ovmf_code_raw,pflash1=ovmf_vars_raw\
 # Processor -> lscpu | grep -E "CPU\(s):|Thread|Core\(s|Socket"
 -cpu host,topoext=on -smp $(nproc),sockets=1,cores=4,threads=2,maxcpus=$(nproc)\
 # Acceleration and RAM memory --------------
 -accel kvm -m 4300M\
 # QEMU monitor -> https://wiki.archlinux.org/title/QEMU#QEMU_monitor
 # Connecting -> socat - UNIX-CONNECT:/tmp/${Name}.sock
 # Connecting -> ncat -U /tmp/${Name}.sock
 -monitor unix:/tmp/${Name}.sock,server,nowait\
 # Bios firmware
 -blockdev driver=file,filename=/usr/share/edk2/x64/OVMF_CODE.4m.fd,node-name=ovmf_code_file,read-only=on\
 -blockdev driver=raw,node-name=ovmf_code_raw,read-only=on,file=ovmf_code_file\
 -blockdev driver=file,filename=${Name}_VARS.4m.fd,node-name=ovmf_vars_file\
 -blockdev driver=raw,node-name=ovmf_vars_raw,file=ovmf_vars_file\
 # CD-ROM ---------------
 -device virtio-scsi-pci,id=scsi0\
 # Empty CD-ROM
 -drive file=,if=ide,index=0,media=cdrom,read-only=on\
 # ISO CD1
 # -drive file=manjaro-kde-26.0-260104-linux618.iso,if=ide,index=1,media=cdrom,read-only=on,format=raw\
 # ISO CD2
 # -blockdev driver=file,filename=archlinux-2026.01.01-x86_64.iso,node-name=cd2_file,read-only=on\
 # -blockdev driver=raw,node-name=cd2_raw,file=cd2_file,read-only=on -device scsi-cd,drive=cd2_raw,bus=scsi0.0\
 # Hard drive ---------------
 # NVME driver
 # -blockdev driver=file,node-name=disk0_file,filename=${Name}.img,aio=io_uring,cache.direct=on,cache.no-flush=off\
 # -blockdev driver=raw,node-name=disk0_raw,file=disk0_file -device nvme,drive=disk0_raw,serial=myvirtdev0\
 # Virtio-blk driver
 -blockdev driver=file,node-name=disk1_file,filename=${Name}.img,aio=io_uring,cache.direct=on,cache.no-flush=off\
 -blockdev driver=raw,node-name=disk1_raw,file=disk1_file -object iothread,id=iothread1\
 -device virtio-blk-pci,drive=disk1_raw,iothread=iothread1,num-queues=$(nproc)\
 # Video ---------------
 # -vga none -device qxl-vga,vgamem_mb=64\
 -vga none -device virtio-vga-gl,disable-legacy=on,blob=on,hostmem=1G,packed=on\
 # Vulkan Support prerequisites -> QEMU >= 9.2.0, Linux kernel >= 6.13 and mesa >= 24.2.0
 # -vga none -device virtio-vga-gl,hostmem=1G,blob=on,venus=on,disable-legacy=on,packed=on\
 # Graphical user interface for QEMU
 -display gtk,gl=on,grab-on-hover=on,show-tabs=off,window-close=on,show-menubar=on,zoom-to-fit=off\
 # Network -> https://wiki.qemu.org/Documentation/Networking -------------
 # User network
 # -nic user,ipv6=off,model=e1000,mac=52:54:00:00:00:01\
 # Bridge network
 -nic bridge,br=virbr0,model=virtio-net-pci,mac=52:54:00:00:00:01\
 # Intel HD Audio ---------------
 -audiodev pa,id=snd0 -device ich9-intel-hda -device hda-duplex,audiodev=snd0\
 # Trusted Platform Module emulation ---------------
 -chardev socket,id=chrtpm,path=/tmp/${Name}_tpm/tpm\
 -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0,id=tpm0\
 # Pass-through host USB 3 device -> https://wiki.archlinux.org/title/QEMU#Pass-through_host_USB_device
 # lsusb
 # sudo chown -v $USER:$USER /dev/bus/usb/002/006
 # -device qemu-xhci,id=xhci -device usb-host,hostdevice=/dev/bus/usb/002/006\
 # -device qemu-xhci,id=xhci -device usb-host,bus=xhci.0,vendorid=0x125f,productid=0xc13a\
 # -device qemu-xhci,id=xhci -device usb-host,bus=xhci.0,hostbus=2,hostport=6\
 # Sharing Host folder with the Guest -> https://wiki.qemu.org/Documentation/9psetup ------------------
 # -device virtio-9p-pci,fsdev=p9fs,mount_tag=9pshare\
 # -fsdev local,id=p9fs,path=/HOST_shared,security_model=mapped,multidevs=remap\
 # mkdir ~/share    # On the guest machine
 # sudo sed -i '$a 9pshare /homme/USER/share 9p trans=virtio,version=9p2000.L,rw 0 0' /etc/fstab
 # sudo mount -t 9p -o trans=virtio 9pshare ~/share -oversion=9p2000.L
 # Mouse grab ---------------------
 -usb -device usb-tablet
 )
qemu-system-x86_64 ${options[@]}
rm -r /tmp/${Name}_tpm
exit 0

Last edited by bbbb4 (2026-01-14 08:51:56)

Offline

#8 2025-03-13 16:12:19

ReDress
Member
From: Nairobi
Registered: 2024-11-30
Posts: 213

Re: Example to run a virtual machine with Qemu

bbbb4 wrote:

Example script to run Arch linux into a virtual machine

bbbb4 wrote:

Below is example script to run Windows11 into a virtual machine

It seems like the primary difference is the display and maybe

-cpu host,topoext=on,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time

Edit: Yes, even on libvirt, Linuxes default to spice while Windows default to qxl ;-)

Last edited by ReDress (2025-03-13 17:46:41)

Offline

#9 2025-03-16 20:22:15

bbbb4
Member
Registered: 2025-03-03
Posts: 5

Re: Example to run a virtual machine with Qemu

To disable 3D support you can use next option

-vga none -device virtio-vga

And for integrated display which do not support copy & past and usb redirecting

-display gtk,grab-on-hover=on,show-tabs=off,window-close=on,show-menubar=on,zoom-to-fit=off

And for remote viewer who support copy & past and usb redirecting

-spice unix=on,addr=/tmp/${Name}_spice,disable-ticketing=on

remote-viewer spice+unix:///tmp/${Name}_spice --title=$Name
spicy --uri="spice+unix:///tmp/${Name}_spice" --title=$Name

And with port connection

-spice port=5924,disable-ticketing=on

remote-viewer spice://127.0.0.1:5924 --title=$Name
spicy -h 127.0.0.1 -p 5924 --title=$Name

Last edited by bbbb4 (2025-03-16 20:23:12)

Offline

Board footer

Powered by FluxBB