VM passthrough w/ looking-glass not working.
Hoi, I'm trying to setup the virtulizations for my vm, though when I wish to add my dGPU to virt-manager i get the error that passing through is not supported on my system, its enabled in the bios and ive also ran setup-virtulization.
Can i not use the dedicated graphics card using VFIO driver?
lspci -nn | grep -E "NVIDIA" 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] [10de:28a0] (rev a1) 01:00.1 Audio device [0403]: NVIDIA Corporation AD107 High Definition Audio Controller [10de:22be] (rev a1)I also dont know why my devices are being skipped
sudo dmesg | grep IOMMU [sudo] password for lynx-bazzite:
[ 0.191403] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1 [ 0.404771] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics
99 Replies
Ok so I ran the script again and everything is setup,I can create and run a VM though is it not able to switch from my Intel to Nvidia GPU? It doesn't even let me start the vm anymore.
@HikariKnight hey, i followed the guide but you have any idea why im getting these errors when i try and run looking glass?

youre not using the kvmfr device
thought they set it as default for B7
well i just rebooted and now its saying it cant connect to the spice server
did you disable spice on the VM?
no
is the VM running?
yes, now it did connect but.. I don't have any kind of mouse input on it
the guest drivers for virtio are installed though
did you follow their guide
add a virtio mouse and keyboard
yes, I installed looking glass on the host, then i connect and i get this and the service crashes

00:00:00.010 [I] time.c:85 | windowsSetTimerResolution | System timer resolution: 500.0 μs 00:00:00.010 [I] app.c:867 | app_main | Looking Glass Host (B7) 00:00:00.011 [I] cpuinfo.c:38 | cpuInfo_log | CPU Model: 12th Gen Intel(R) Core(TM) i5-12500H 00:00:00.012 [I] cpuinfo.c:39 | cpuInfo_log | CPU: 1 sockets, 4 cores, 8 threads 00:00:00.013 [E] vector.c:123 | vector_ptrTo | Assertion failed: index < vector->size && "Out of bounds access"
try
rpm-ostree kargs --append-if-missing="split_lock_detect=off"
then reboot the hostalright rebooting
okay i did that, Ill try booting the vm again.
did it work?
No, I installed all the guest programs and looking glass still doesn't allow me to pass-through any kind of input except my keyboard.
i meant is the service still crashing in the VM
yes
send me the output of
rpm-ostree kargs
and make sure you have configured the xml properly
https://looking-glass.io/docs/B7/ivshmem_kvmfr/#libvirt
i have to head offso this is what im getting now when i run looking glass
I assume i have to add this to the overview xml right.
here you go
rpm-ostree kargs rhgb quiet root=UUID=e7e3daa1-f18a-4112-ae5f-d08f9ab8c5dd rootflags=subvol=root rw ostree=/ostree/boot.0/default/9a6c6c28c11d1609ff0138164ed50a2773eb21c96a3688e782c238c3de164190/0 bluetooth.disable_ertm=1 preempt=full rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 vfio-pci.ids=10de:28a0,10de:22be kvmfr.static_size_mb=128 split_lock_detect=off
read the documentation, add it to the VM xml
its important you read everything
Yeah, I don't got time to break stuff..
ok that looks fine at my first glance
the commandline goes right under the domain right
you want it above the
</domain>
line at the bottom
and the first line of the xml needs to be <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
i did both
it keeps looping like this

and change the
size
to match the right amount you need for kvmfr
once all that is correct you need the looking-glass host to run in the VMis this value in bytes or mb
bytes iirc
yeah mine is
134217728
which is 128mbjust finished that on the calc, anyhow i have updated the size for kvmfr
and it matches your kvmfr static size right
yes
anyways i have to go, but you can check if kvmfr is working by running
sudo dmesg | grep -i kvmfr
I think something might be wrong on the windows end? The service seems to be running, even though theres nothing in the tray.

try connect
and provide looking-glass logs
Its running, though i got one permisson error
Ill send the logs too
kvmfr is working
and ignore
[ 12.337560] systemd[1]: Unable to fix SELinux security context of /dev/kvmfr0: Permission denied
as the selinux type enforcement we set is applied after that gets loggedwindows is failing
does the vm have a GPU passed through atm?
not yet, i tried before and it refused to boot
you need to fix that
looking-glass will not work until you have a gpu passed through
Ive added them, do i disable the video output from vga to none?
the spice function might still work but i havent tried that
no
you just turn off the virtual display once youre in windows
Right, am rebooting the vm
if you remove the qxl video you will break the spice fallback for looking-glass
it didnt like that
yes i have vt-d and virtualization turned on
open the terminal and run
ls-iommu
Yeah i dont know why im getting this.
IOMMU Disabled in UEFI/BIOS and/or not enabled in boot arguments!
you didnt enable vfio in the ujust
ujust-setup-virtulization should have already done that right
ill check again
wont do it if you didnt enable vfio
i checked your kargs again, you havent run it
error: initramfs regeneration state is already enabled
rest is still ongoing
we dont use initramfs regeneration anymore
how old is your image?
uhhh
rpm-ostree status
rpm-ostree initramfs --disable
i think the command is to disable it
and its waiting for the kargs to be updated for vfioWell it finished "re"enabling
I got Intel XE and Nvidia GPU's in this system.
yep
ok imma reboot
if this is a desktop it should work fine if its the nvidia card youre passing through
if its a laptop its literally a dice roll if it will work

maybe it just needs drivers
yes
also which gpu are you passing through and is this a desktop
oh it auto installed
4060
defo laptop
ok well with a laptop its a big chance it cant work
prob cuz it has a mux switch
it already installed the driver
yeah
doesnt mean it will work
you still need a hdmi plug that is wired directly to the gpu
either through mux switch or hardwired to the gpu
ill plug it into a monitor, does displayport also work?
yeah just replace hdmi in my messages with display port, message stays the same 😛
based\
the monitor has to be connected before booting the VM btw
it workd
then looking glass should work
oh
alr
just gotta figure out mouse
<input type="mouse" bus="virtio">
<alias name="input0"/>
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
</input>
using this
cant help with that other than just follow the looking-glass documentation
ye
just add that to the right location in the xml
you can ignore the
<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
it gets auto addedcool, the thing is that i cant remove the standard mouse it assigns tho
looking glass works
you need to keep the standard mouse
its a requirement
the PS2 mouse and keyboard are required for the VM in general
ah
pretty sure the documentaiton mentions that you add the virtio mouse and keyboard
not replace
ok so i got two screens
and the one in qemu is screen 1 and LG is using screen 2
oh wel nvm fixed
i did
anyhow ty for the help
goodnight
nighty
@HikariKnight maybe tmr u can let my know why I'm not getting full screen with 1080p res..
im quite busy atm buying an apartment and dealing with a broken down car
i dont do vfio on laptops because it is a mess
the card is passed through and looking-glass works (you get an image and its not complaining about it being spice)
not much more i can do since laptops are a mess when it comes to vfio
fair
you could try getting help in the vfio discord if you have general vfio issues that remains
nah its like a scaling issue with looking glass
but for 1080p kvmfr just needs at minimum 64mb, we default it to 128mb


change the resolution
1440x1080 is not a normal resolution
The first one it 1080
yeah
and what is the panels actual resolution?
because it will use whatever the monitor reports
1080
It works fine on the monitor only on looking glass it's scaled down
because the laptop screen is not 1080p
or rather its not 16:9
Both are the same res and are 16:9
In windowed mode LG does scale properly
at that point, play around with your looking-glass settings
goodnight
Okay, goodnight
alr fixed