LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-07-2021, 10:49 AM   #1
scorpion77
Member
 
Registered: Sep 2003
Distribution: Slackware64 current
Posts: 88

Rep: Reputation: 15
Create a virtual machine with QEMU


Hi,

I'm trying do make a virtual machine using QEMU so that I can remove dual boot with Windows 10. I read that QEMU supports PCI Passthrough, so I can use my graphics card with maximum performance.
When I run virt-manager, I got stuck at step 5 of 5, and I got this error:
libvirt.libvirtError: unsupported configuration: domain configuration does not support video model 'qxl'

I tried to change with Video VGA, but I got another error:
libvirt.libvirtError: unsupported configuration: USB redirection is not supported by this version of QEMU

I installed a lot of packages, here they are:

qemu
vde
audit
virt-manager
libvirt
libosinfo
osinfo-db
osinfo-db-tools
spice-protocol
xf86-video-qxl
urlgrabber
yajl
spice-guest-tools
vala
opus
spice-gtk - pacchetto giÓ fatto
meson
ninja
gtk-vnc - pacchetto giÓ fatto
usbredir

My hardware configuration should be compliant with IOMMU:

Mainboard: ASRock X570 Steel Legend
CPU: AMD Ryzen 7 5800X
Graphics card: Radeon RX 580

Is someone already using a Windows guest with PCI passthrough? Could you tell me the right configuration? So finally I will be able to remove the Windows partition and use it only for necessity (especially games) with QEMU.

Many thanks in advance.

Scorpion77
 
Old 04-07-2021, 12:51 PM   #2
truepatriot76
Member
 
Registered: Apr 2014
Location: California, USA
Distribution: slackware64-current
Posts: 111

Rep: Reputation: 75
Just glancing at your list, xf86-video-qxl should be installed in a linux guest, not the host. As far as pass through (I've never used it), I believe you need to pass options to kernel at boot, something like "iommu=pt" If windows is your guest OS, you will need to install Spice tools for windows.
 
Old 04-07-2021, 02:37 PM   #3
Tonus
Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-current
Posts: 912
Blog Entries: 3

Rep: Reputation: 248Reputation: 248Reputation: 248
Does the guest launches with less options ?
At least I have some win7 an 10 running with qemu but on laptop. Never checked for graphic card as I'm using that for (proprietary) office work.

Maybe the command launch could help too ?
 
Old 04-07-2021, 07:52 PM   #4
notzed
Member
 
Registered: Dec 2020
Location: South Australia
Distribution: slackware64-current
Posts: 31

Rep: Reputation: Disabled
I looked into pass-through at one point and it requires a separate dedicated GPU for each guest and your system only has the one. You could theoretically run slackware completely headless (not even a console) and let the guest own the gpu but that's probably not what you're after.

From a quick search this seems to have a reasonable rundown of the requirements and setup.

https://wiki.gentoo.org/wiki/GPU_pas...bvirt_qemu_kvm
 
Old 04-08-2021, 03:49 AM   #5
walecha
Member
 
Registered: Jan 2010
Location: Malang, +62
Distribution: slackware
Posts: 95

Rep: Reputation: 18
This is my build order for qemu - libvirt - virt-manager
Code:
# For QEMU
libbsd
netcat-openbsd
virglrenderer
acpica
ovmf
libseccomp
libiscsi
libnfs
usbredir
alabaster
imagesize
pytz
pytzdata
python3-babel
MarkupSafe
Jinja2
snowballstemmer
sphinxcontrib-applehelp
sphinxcontrib-devhelp
sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
Sphinx
numactl
spice-protocol
softhsm
pcsc-lite
libcacard
spice
vde2
liburcu
glusterfs
liburing
device-tree-compiler
snappy
daemon
rdma-core
rng-tools
multipath-tools
qemu

# FOR LIBVIRT
osinfo-db-tools
osinfo-db
libosinfo
yajl
urlgrabber
wheel
python-zipp
python-importlib_metadata
python3-pyrsistent
python3-attrs
python3-jsonschema
nftables (rebuild slackware package)
python3-slip
python3-decorator
firewalld
sanlock
phodav
libvirt

# FOR VIRT-MANAGER
spice-gtk
gtk-vnc
libvirt-glib
libvirt-python
tunctl
virt-manager
You can use my slackbuilds to build with latest stable version https://gitlab.com/w41l/slackbuilds/-/tree/master/
 
Old 04-08-2021, 08:21 AM   #6
scorpion77
Member
 
Registered: Sep 2003
Distribution: Slackware64 current
Posts: 88

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tonus View Post
Does the guest launches with less options ?
At least I have some win7 an 10 running with qemu but on laptop. Never checked for graphic card as I'm using that for (proprietary) office work.

Maybe the command launch could help too ?
This is the output of virt-manager --debug related to Video QXL:

Code:
[gio, 08 apr 2021 15:16:46 virt-manager 4000] DEBUG (installer:599) Generated install XML: 
<domain type="kvm">
  <name>win10</name>
  <uuid>9972b551-808b-41c3-9674-f7e7377c3451</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch="x86_64" machine="q35">hvm</type>
    <boot dev="cdrom"/>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-model"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_reboot>destroy</on_reboot>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/WinSSD/win10.qcow2"/>
      <target dev="sda" bus="sata"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/WinD/W10HomePro20H2x64.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
    </disk>
    <controller type="usb" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:e0:22:b0"/>
      <model type="e1000e"/>
    </interface>
    <console type="pty"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
    </channel>
    <input type="tablet" bus="usb"/>
    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
      <image compression="off"/>
    </graphics>
    <sound model="ich9"/>
    <video>
      <model type="qxl"/>
    </video>
    <redirdev bus="usb" type="spicevmc"/>
    <redirdev bus="usb" type="spicevmc"/>
  </devices>
</domain>

[gio, 08 apr 2021 15:16:46 virt-manager 4000] DEBUG (installer:601) Generated boot XML: 
<domain type="kvm">
  <name>win10</name>
  <uuid>9972b551-808b-41c3-9674-f7e7377c3451</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch="x86_64" machine="q35">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-model"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/WinSSD/win10.qcow2"/>
      <target dev="sda" bus="sata"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/WinD/W10HomePro20H2x64.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
    </disk>
    <controller type="usb" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:e0:22:b0"/>
      <model type="e1000e"/>
    </interface>
    <console type="pty"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
    </channel>
    <input type="tablet" bus="usb"/>
    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
      <image compression="off"/>
    </graphics>
    <sound model="ich9"/>
    <video>
      <model type="qxl"/>
    </video>
    <redirdev bus="usb" type="spicevmc"/>
    <redirdev bus="usb" type="spicevmc"/>
  </devices>
</domain>

[gio, 08 apr 2021 15:16:46 virt-manager 4000] DEBUG (error:101) error dialog message:
summary=Impossibile completare l'installazione: 'unsupported configuration: domain configuration does not support video model 'qxl''
details=Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib64/python3.9/site-packages/libvirt.py", line 4376, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: unsupported configuration: domain configuration does not support video model 'qxl'
This is the output of virt-manager --debug related to Video VGA:

Code:
[gio, 08 apr 2021 15:19:54 virt-manager 4000] DEBUG (installer:599) Generated install XML: 
<domain type="kvm">
  <name>win10</name>
  <uuid>8a31c60d-7293-4ea1-818e-595517326966</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch="x86_64" machine="q35">hvm</type>
    <boot dev="cdrom"/>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-model"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_reboot>destroy</on_reboot>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/WinSSD/win10.qcow2"/>
      <target dev="sda" bus="sata"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/WinD/W10HomePro20H2x64.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
    </disk>
    <controller type="usb" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:cc:d3:4b"/>
      <model type="e1000e"/>
    </interface>
    <console type="pty"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
    </channel>
    <input type="tablet" bus="usb"/>
    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
      <image compression="off"/>
    </graphics>
    <sound model="ich9"/>
    <video>
      <model type="vga"/>
    </video>
    <redirdev bus="usb" type="spicevmc"/>
    <redirdev bus="usb" type="spicevmc"/>
  </devices>
</domain>

[gio, 08 apr 2021 15:19:54 virt-manager 4000] DEBUG (installer:601) Generated boot XML: 
<domain type="kvm">
  <name>win10</name>
  <uuid>8a31c60d-7293-4ea1-818e-595517326966</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu>4</vcpu>
  <os>
    <type arch="x86_64" machine="q35">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-model"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/WinSSD/win10.qcow2"/>
      <target dev="sda" bus="sata"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/WinD/W10HomePro20H2x64.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
    </disk>
    <controller type="usb" model="qemu-xhci" ports="15"/>
    <interface type="network">
      <source network="default"/>
      <mac address="52:54:00:cc:d3:4b"/>
      <model type="e1000e"/>
    </interface>
    <console type="pty"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
    </channel>
    <input type="tablet" bus="usb"/>
    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
      <image compression="off"/>
    </graphics>
    <sound model="ich9"/>
    <video>
      <model type="vga"/>
    </video>
    <redirdev bus="usb" type="spicevmc"/>
    <redirdev bus="usb" type="spicevmc"/>
  </devices>
</domain>

[gio, 08 apr 2021 15:19:54 virt-manager 4000] DEBUG (error:101) error dialog message:
summary=Impossibile completare l'installazione: 'unsupported configuration: USB redirection is not supported by this version of QEMU'
details=Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install
    installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib64/python3.9/site-packages/libvirt.py", line 4376, in createXML
    raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: unsupported configuration: USB redirection is not supported by this version of QEMU
 
Old 04-08-2021, 08:27 AM   #7
scorpion77
Member
 
Registered: Sep 2003
Distribution: Slackware64 current
Posts: 88

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by walecha View Post
This is my build order for qemu - libvirt - virt-manager
Code:
# For QEMU
libbsd
netcat-openbsd
virglrenderer
acpica
ovmf
libseccomp
libiscsi
libnfs
usbredir
alabaster
imagesize
pytz
pytzdata
python3-babel
MarkupSafe
Jinja2
snowballstemmer
sphinxcontrib-applehelp
sphinxcontrib-devhelp
sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
Sphinx
numactl
spice-protocol
softhsm
pcsc-lite
libcacard
spice
vde2
liburcu
glusterfs
liburing
device-tree-compiler
snappy
daemon
rdma-core
rng-tools
multipath-tools
qemu

# FOR LIBVIRT
osinfo-db-tools
osinfo-db
libosinfo
yajl
urlgrabber
wheel
python-zipp
python-importlib_metadata
python3-pyrsistent
python3-attrs
python3-jsonschema
nftables (rebuild slackware package)
python3-slip
python3-decorator
firewalld
sanlock
phodav
libvirt

# FOR VIRT-MANAGER
spice-gtk
gtk-vnc
libvirt-glib
libvirt-python
tunctl
virt-manager
You can use my slackbuilds to build with latest stable version https://gitlab.com/w41l/slackbuilds/-/tree/master/
Wow! So many packages! When I have some time I try to compile and install them. Thank you.
 
Old 04-08-2021, 10:33 AM   #8
scorpion77
Member
 
Registered: Sep 2003
Distribution: Slackware64 current
Posts: 88

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by notzed View Post
I looked into pass-through at one point and it requires a separate dedicated GPU for each guest and your system only has the one. You could theoretically run slackware completely headless (not even a console) and let the guest own the gpu but that's probably not what you're after.

From a quick search this seems to have a reasonable rundown of the requirements and setup.

https://wiki.gentoo.org/wiki/GPU_pas...bvirt_qemu_kvm
Thank you, so I can't do it, I have only one GPU.
 
Old 04-08-2021, 12:04 PM   #9
truepatriot76
Member
 
Registered: Apr 2014
Location: California, USA
Distribution: slackware64-current
Posts: 111

Rep: Reputation: 75
Quote:
Originally Posted by scorpion77 View Post
Wow! So many packages! When I have some time I try to compile and install them. Thank you.
I use ponce's repo for current exclusively - my build order is a bit more modest and works well for current 86_x64

gtksourceview3
osinfo-db-tools
osinfo-db
libosinfo
yajl
numactl
libvirt
libvirt-glib
libvirt-python
gtk-vnc
spice-protocol
spice
usbredir
spice-gtk
device-tree-compiler
libnfs
libseccomp
snappy
vde2
virglrenderer
qemu
virt-manager
acpica
ovmf

Last edited by truepatriot76; 04-08-2021 at 05:20 PM.
 
Old 04-08-2021, 05:17 PM   #10
ialexand
Member
 
Registered: Apr 2021
Posts: 99

Rep: Reputation: 20
You need gst-plugins-ugly with x264 built with it.
 
Old 04-08-2021, 09:12 PM   #11
walecha
Member
 
Registered: Jan 2010
Location: Malang, +62
Distribution: slackware
Posts: 95

Rep: Reputation: 18
Actually that was my build order for qemu-libvirt for used in server environment. That's why it had packages for managing and accessing SAN server with multipath I/O, firewalld, etc. If you have nvme drive in your system, and using linux 5.10+, then I highly recommend to build qemu against liburing. You can use high capacity I/O for your vm with very very low CPU usage on the host. In epyc server, I got gigabit I/O with less then 5% CPU. But I think io_uring still does not work nicely with windows vm. Sometimes they got BSOD when doing high I/O, tested when extracting large ISO. To use io_uring just pass parameter on the vm disk configuration: io="io_uring".

Anyway, this is my GPU passthrough test using second GPU of my laptop, using it's own monitor through hdmi port on the gpu:
https://imgur.com/sigBGdk
https://i.imgur.com/Q9dpCQx.jpg

I'm booting slackware64-current with driver radeon and amdgpu blacklisted, then using this option in kernel boot line:
Code:
vmlinuz root=... ro intel_iommu=on iommu=pt kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 pcie_acs_override=downstream,multifunction vfio_iommu_type1.allow_unsafe_interrupts=1 rd.driver.pre=vfio-pci vfio_pci.ids=1002:6640,1002:aac0
I also had to pass my usb mouse to the guest.

Last edited by walecha; 04-08-2021 at 09:15 PM. Reason: info for monitor and mouse
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to : Open Virtual Machine Manager to create a new virtual machine BKChicago Linux - Newbie 2 11-08-2016 09:48 PM
Looking For A Bootable OS + Virtual Machine Combo - Bootable Virtual Machine OS Help angelbabycry Linux - Newbie 7 05-08-2015 08:36 PM
Is base memory of virtual machine used when virtual machine is not running? ravisingh1 Linux - Virtualization and Cloud 3 04-09-2013 03:41 AM
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration