Almost got to bind back Intel iGPU from VM to host (laptop) upon VM shutdown, how to diagnose what's missing?

weuquibegruddi

New Member
Apr 23, 2026
2
0
1
I have pve9 running on a laptop with single Intel iGPU (driver i915, GOP v9.1 rom thus no advanced virtualisation options).

I have configured whole GPU passthrough to my VMs/containers (works for both windows and Linux VMs, and kodi in lxc) by following "standard" https://github.com/LongQT-sea/intel-igpu-passthru (legacy mode). Thanks, @LongQT-sea !!!

All looks good as of passthrough into VMs - laptop boots into proxmox text console on internal display and I can start a VMs to take over internal display. Then I can use my laptop like if it is running Windows or Ubuntu desktop with guest VMs recognising what GPU they're running on.

However, as it's widely discussed here on the forum, when I shutdown VM, host doesn't get it's internal display back, so integrated laptop display stays black.

I've tried typically suggeted comands, however, as most of the discussions/guides are around AMD/NVidia GPUs, I couldn't spot anything for my Intel case.
What's interesting though, is that if I connect external display via HDMI and boot proxmox (both proxmox console and VMs are duplicating picture on both internal and hdmi/external) and then shutdown VM followed by set of re-bind commands, then internal display still stays black, but external HDMI display shows expected proxmox text console.
So this re-binding is partially working as console is restored on external hdmi display.

I hope there is some command I'm missing that is left to be executed to also "recover" internal laptop console after VM shutdown.
Please advise what diagnostic I can do to figure out what re-binding is missing, or maybe some commands to run to complete re-bind to host.

Thanks!

Commands I've tried after shutting down VM (using proxmox webgui console):
Bash:
echo "0000:00:02.0" > /sys/bus/pci/drivers/vfio-pci/unbind 2>/dev/null
wait
echo "0000:00:02.0" > /sys/bus/pci/drivers/i915/bind 2>/dev/null
wait
echo 0 > /sys/class/vtconsole/vtcon0/bind
wait
echo 1 > /sys/class/vtconsole/vtcon1/bind

Bash:
cat /proc/cmdline
initrd=\EFI\proxmox\6.17.13-3-pve\initrd.img-6.17.13-3-pve initrd=\EFI\proxmox.17.13-3-pve\initrd.img-6.17.13-3-pve BOOT_IMAGE=/vmlinuz-6.17.13-3-pve root=/dev/mapper/pve-root ro quiet intel_iommu=on iommu=pt video=simplefb:off video=efifb:off initcall_blacklist=sysfb_init pcie_acs_override=downstream,multifunction acpi_backlight=vendor

Bash:
cat /sys/class/tty/console/active tty0
cat /sys/class/tty/console/dev 5:1
cat /sys/class/tty/ttyprintk/dev 5:3
cat /sys/class/vtconsole/vtcon0/bind 0
cat /sys/class/vtconsole/vtcon0/name (S) dummy device
cat /sys/class/vtconsole/vtcon1/bind 1
cat /sys/class/vtconsole/vtcon1/name (M) frame buffer device
cat /sys/class/tty/ttyS0/console N
cat /sys/class/tty/ttyS0/dev 4:64
cat /sys/class/tty/ttyS0/port 0x3F8
cat /sys/class/tty/ttyS0/type 0
readlink -f /sys/class/tty/ttyS0/device /sys/devices/platform/serial8250/serial8250:0/serial8250:0.0
readlink -f /sys/bus/pci/drivers/serial/module /sys/module/8250_pci
ls /sys/bus/pci/drivers/i915/ 0000:00:02.0
/sys/bus/pci/drivers/vfio-pci/ -

Bash:
cat /sys/class/tty/console/active tty0
cat /sys/class/tty/console/dev 5:1
cat /sys/class/tty/ttyprintk/dev 5:3
cat /sys/class/vtconsole/vtcon0/bind 1
cat /sys/class/vtconsole/vtcon0/name (S) dummy device
cat /sys/class/vtconsole/vtcon1/bind 0
cat /sys/class/vtconsole/vtcon1/name (M) frame buffer device
cat /sys/class/tty/ttyS0/console N
cat /sys/class/tty/ttyS0/dev 4:64
cat /sys/class/tty/ttyS0/port 0x3F8
cat /sys/class/tty/ttyS0/type 0
readlink -f /sys/class/tty/ttyS0/device /sys/devices/platform/serial8250/serial8250:0/serial8250:0.0
readlink -f /sys/bus/pci/drivers/serial/module /sys/module/8250_pci
ls /sys/bus/pci/drivers/i915/ -
/sys/bus/pci/drivers/vfio-pci/ 0000:00:02.0

Bash:
/sys/class/tty/console/active tty0
cat /sys/class/tty/console/dev 5:1
cat /sys/class/tty/ttyprintk/dev 5:3
cat /sys/class/vtconsole/vtcon0/bind 0
cat /sys/class/vtconsole/vtcon0/name (S) dummy device
cat /sys/class/vtconsole/vtcon1/bind 1
cat /sys/class/vtconsole/vtcon1/name (M) frame buffer device
cat /sys/class/tty/ttyS0/console N
cat /sys/class/tty/ttyS0/dev 4:64
cat /sys/class/tty/ttyS0/port 0x3F8
cat /sys/class/tty/ttyS0/type 0
readlink -f /sys/class/tty/ttyS0/device /sys/devices/platform/serial8250/serial8250:0/serial8250:0.0
readlink -f /sys/bus/pci/drivers/serial/module /sys/module/8250_pci
ls /sys/bus/pci/drivers/i915/ 0000:00:02.0  bind  module  new_id  remove_id  uevent  unbind
/sys/bus/pci/drivers/vfio-pci/ -

Bash:
[    0.267297] printk: legacy console [tty0] enabled
[    2.563666] i915 0000:00:02.0: vgaarb: deactivate vga console
[    2.761815] fbcon: Deferring console take-over
[    4.996974] fbcon: Taking over console
[    5.990852] systemd[1]: Starting keyboard-setup.service - Set the console keyboard layout...
[    6.014522] systemd[1]: Finished keyboard-setup.service - Set the console keyboard layout.
[  195.832765] vfio-pci 0000:00:02.0: vgaarb: deactivate vga console
[  250.169103] lenovo 0003:17EF:60EE.0007: input,hiddev0,hidraw3: USB HID v1.11 Mouse [Lenovo TrackPoint Keyboard II] on usb-0000:00:14.0-1/input1
[  250.171312] lenovo 0003:17EF:60EE.0008: hiddev1,hidraw4: USB HID v1.11 Device [Lenovo TrackPoint Keyboard II] on usb-0000:00:14.0-1/input2
[  430.791643] vfio-pci 0000:00:02.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[  457.787751] i915 0000:00:02.0: [drm] Found coffeelake/ult (device ID 3ea0) integrated display version 9.00 stepping N/A
[  457.788582] i915 0000:00:02.0: [drm] VT-d active for gfx access
[  457.788604] i915 0000:00:02.0: vgaarb: deactivate vga console
[  457.788641] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[  457.800716] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
[  458.049161] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
[  458.050640] i915 0000:00:02.0: [drm] Registered 3 planes with drm panic
[  458.050643] [drm] Initialized i915 1.6.0 for 0000:00:02.0 on minor 0
[  458.054033] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[  458.054249] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input34
[  458.950254] fbcon: i915drmfb (fb0) is primary device
[  459.275009] Console: switching to colour frame buffer device 240x67
[  459.292316] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
 
Bash:
echo 0 > /sys/class/vtconsole/vtcon0/bind
wait
echo 1 > /sys/class/vtconsole/vtcon1/bind
I use echo 0 | tee /sys/class/vtconsole/vtcon*/bind >/dev/null to close the console(s) before the passthrough not after.
Afterwards (after unbinding vfio-pci and binding the actual driver like you do) I use echo 1 >/sys/class/vtconsole/vtcon0/bind to get a new console on the host.
EDIT: So I think you should do those two commands slightly different but I have different hardware. Then again, these commands line hardware agnostic to me.
 
Last edited:
I use echo 0 | tee /sys/class/vtconsole/vtcon*/bind >/dev/null to close the console(s) before the passthrough not after.
Afterwards (after unbinding vfio-pci and binding the actual driver like you do) I use echo 1 >/sys/class/vtconsole/vtcon0/bind to get a new console on the host.
EDIT: So I think you should do those two commands slightly different but I have different hardware. Then again, these commands line hardware agnostic to me.

I've attached the following hook to my VM, and the result is just like it was before with manual commands (be it vtcon0 or vtcon1) - upon shutting down VM, I do get laptop proxmox console on external HDMI display, but not on integrated laptop display as desired(

Bash:
#!/bin/bash
phase="$2"
echo "Phase is $phase"
#from https://forum.proxmox.com/threads/working-amd-rx-9070xt-support.163370/
if [ "$phase" == "pre-start" ]; then
    # disable consoles
    echo 0 | tee /sys/class/vtconsole/vtcon*/bind >/dev/null
    sleep 2
    # Unbind gpu from  i915 gpu
    echo "0000:00:02.0" > /sys/bus/pci/drivers/i915/unbind 2>/dev/null
    #sleep 2
    # Resize the GPU's BAR2 memory region (useful for PCI passthrough), no such resource in i915
    #echo 3 > /sys/bus/pci/devices/0000:0f:00.0/resource2_resize
    sleep 2
elif [ "$phase" == "post-stop" ]; then
    # Unbind gpu from vfio-pci
    sleep 5
    echo "0000:00:02.0" > /sys/bus/pci/drivers/vfio-pci/unbind 2>/dev/null
    sleep 2
    # Bind i915
    echo "0000:00:02.0" > /sys/bus/pci/drivers/i915/bind 2>/dev/null
    sleep 2
    # rebind consoles
    echo 1 >/sys/class/vtconsole/vtcon0/bind
    sleep 2
fi
 
Last edited: