laptop keyboard+touchpad passthough to a VM

aixz

Member
Mar 28, 2022
11
1
8
Hello,

I installed proxmox 8 on an old laptop (i7 4600U)

My goal is to use a VM directly on this laptop.

I created an Ubuntu VM, passed the IGPU successfully (i915), usb ports, audio .... but I cannot use the integrated keyboard/touchpad, as it doesn't appear in the devices I can passthough:

GRUB command line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1 iommu=pt pcie_acs_override=downstream,multifunction video=efifb:eek:ff video=vesa:eek:ff vfio_io>

Code:
lspci

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 0b)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:16.3 Serial controller: Intel Corporation 8 Series HECI KT (rev 04)
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-LM (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4)
00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 5 (rev e4)
00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)
03:00.0 SD Host controller: O2 Micro, Inc. SD/MMC Card Reader Controller (rev 01)

When I list devices I can see the keyboard, buttons, touchpad ... but I don't know how to use them in the VM.
Is it possible ?

Code:
cat /proc/bus/input/devices

I: Bus=0019 Vendor=0000 Product=0005 Version=0000
N: Name="Lid Switch"
P: Phys=PNP0C0D/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=21
B: SW=1

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

I: Bus=0019 Vendor=0000 Product=0003 Version=0000
N: Name="Sleep Button"
P: Phys=PNP0C0E/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input2
U: Uniq=
H: Handlers=kbd event2
B: PROP=0
B: EV=3
B: KEY=4000 0 0

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input4
U: Uniq=
H: Handlers=sysrq kbd event4 leds
B: PROP=0
B: EV=120013
B: KEY=1100f02902000 8380307cf910f001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7

I: Bus=0011 Vendor=0002 Product=0008 Version=0310
N: Name="AlpsPS/2 ALPS DualPoint Stick"
P: Phys=isa0060/serio1/input1
S: Sysfs=/devices/platform/i8042/serio1/input/input7
U: Uniq=
H: Handlers=mouse0 event5
B: PROP=21
B: EV=f
B: KEY=70000 0 0 0 0
B: REL=3
B: ABS=1000000

I: Bus=0011 Vendor=0002 Product=0008 Version=0310
N: Name="AlpsPS/2 ALPS DualPoint TouchPad"
P: Phys=isa0060/serio1/input0
S: Sysfs=/devices/platform/i8042/serio1/input/input6
U: Uniq=
H: Handlers=mouse1 event6
B: PROP=9
B: EV=b
B: KEY=e420 70000 0 0 0 0
B: ABS=260800001000003

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input8
U: Uniq=
H: Handlers=kbd event7
B: PROP=0
B: EV=40001
B: SND=6

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="Dell WMI hotkeys"
P: Phys=
S: Sysfs=/devices/platform/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/9DBB5994-A997-11DA-B012-B622A1EF5492/input/input9
U: Uniq=
H: Handlers=rfkill kbd event8
B: PROP=0
B: EV=13
B: KEY=800000000000 0 0 1500b00000c00 4000000200300000 e000000000000 0
B: MSC=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Dock Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input10
U: Uniq=
H: Handlers=event9
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Dock Line Out"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input11
U: Uniq=
H: Handlers=event10
B: PROP=0
B: EV=21
B: SW=40

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Front Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input12
U: Uniq=
H: Handlers=event11
B: PROP=0
B: EV=21
B: SW=4

I: Bus=0003 Vendor=1bcf Product=2985 Version=3513
N: Name="Laptop_Integrated_Webcam_HD: In"
P: Phys=usb-0000:00:14.0-4/button
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0/input/input13
U: Uniq=
H: Handlers=kbd event12
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0019 Vendor=0000 Product=0006 Version=0000
N: Name="Video Bus"
P: Phys=LNXVIDEO/video/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input14
U: Uniq=
H: Handlers=kbd event13
B: PROP=0
B: EV=3
B: KEY=3e000b00000000 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=3"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input15
U: Uniq=
H: Handlers=event14
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=7"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input16
U: Uniq=
H: Handlers=event15
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=8"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input17
U: Uniq=
H: Handlers=event16
B: PROP=0
B: EV=21
B: SW=140
 
I created an Ubuntu VM, passed the IGPU successfully (i915), usb ports, audio .... but I cannot use the integrated keyboard/touchpad, as it doesn't appear in the devices I can passthough:
That's because keyboard and mice/touchpad are not PCI(e) devices. External ones are usually regular USB devices with you can USB-passthrough.
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1 iommu=pt pcie_acs_override=downstream,multifunction video=efifb:eek:ff video=vesa:eek:ff vfio_io>
Note that video=efifb:off video=vesa:off does nothing on Proxmox anymore and I advise against pcie_acs_override if you don't need it. And the rest is cut off, but it probably work fine for you. Use cat /proc/cmdline to see your currently active kernel parameters.
When I list devices I can see the keyboard, buttons, touchpad ... but I don't know how to use them in the VM.
Is it possible ?
It's probably possible with evdev passthrough (see the QEMU documentation) and add the relevant parameters to the VM in the args: setting.
I don't have the right links and all the details available for you now, but I hope that this will get you started.

EDIT: Maybe this helps (except that Proxmox does not use XML): https://passthroughpo.st/using-evdev-passthrough-seamless-vm-input/
 
Last edited:
Thanks for the hint :)
but it's beyond my skills, I tried to add a 'args:' line in my vm.conf, like this:

Code:
args: -device 'Bus=0011,Vendor=0001,Product=0001,Version=ab41,Name="AT Translated Set 2 keyboard",Phys=isa0060/serio0/input0,Sysfs=/devices/platform/i8042/serio0/input/input4,Uniq=,'Handlers=sysrq kbd event4 leds',PROP=0,EV=120013,'KEY=1100f02902000 8380307cf910f001 feffffdfffefffff fffffffffffffffe',MSC=10,LED=7

based on this :

Code:
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input4
U: Uniq=
H: Handlers=sysrq kbd event4 leds
B: PROP=0
B: EV=120013
B: KEY=1100f02902000 8380307cf910f001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7

without success
 
Code:
args: -device 'Bus=0011,Vendor=0001,Product=0001,Version=ab41,Name="AT Translated Set 2 keyboard",Phys=isa0060/serio0/input0,Sysfs=/devices/platform/i8042/serio0/input/input4,Uniq=,'Handlers=sysrq kbd event4 leds',PROP=0,EV=120013,'KEY=1100f02902000 8380307cf910f001 feffffdfffefffff fffffffffffffffe',MSC=10,LED=7
This does not look like anything from the QEMU documentation. Did you look at the link I added later?
without success
Maybe something like args: -object input-linux,id=mouse1,evdev=/dev/input/by-id/MOUSE_NAME -object input-linux,id=kbd1,evdev=/dev/input/by-id/KEYBOARD_NAME,grab_all=on,repeat=on? You'll have to figure out the MOUSE_NAME and KEYBOARD_NAME yourself (or search some more).
 
i've nothing related to kb & mouse , but there's something in by-path, so I changed your args line:
Code:
args: -object input-linux,id=mouse1,evdev=/dev/input/by-path/event5 -object input-linux,id=kbd1,evdev=/dev/input/by-path/event4,grab_all=on,repeat=on

output from starting the VM: kvm: Could not open '/dev/input/by-path/event5': No such file or directory

here's my input directory:

Code:
/dev/input# ls -la
total 0
drwxr-xr-x  4 root root     480 Oct 24 17:50 .
drwxr-xr-x 21 root root    4580 Oct 24 17:50 ..
drwxr-xr-x  2 root root      60 Oct 24 17:50 by-id
drwxr-xr-x  2 root root     160 Oct 24 17:50 by-path
crw-rw----  1 root input 13, 64 Oct 24 17:50 event0
crw-rw----  1 root input 13, 65 Oct 24 17:50 event1
crw-rw----  1 root input 13, 74 Oct 24 17:50 event10
crw-rw----  1 root input 13, 75 Oct 24 17:50 event11
crw-rw----  1 root input 13, 76 Oct 24 17:50 event12
crw-rw----  1 root input 13, 77 Oct 24 17:50 event13
crw-rw----  1 root input 13, 78 Oct 24 17:50 event14
crw-rw----  1 root input 13, 79 Oct 24 17:50 event15
crw-rw----  1 root input 13, 80 Oct 24 17:50 event16
crw-rw----  1 root input 13, 66 Oct 24 17:50 event2
crw-rw----  1 root input 13, 67 Oct 24 17:50 event3
crw-rw----  1 root input 13, 68 Oct 24 17:50 event4
crw-rw----  1 root input 13, 69 Oct 24 17:50 event5
crw-rw----  1 root input 13, 70 Oct 24 17:50 event6
crw-rw----  1 root input 13, 71 Oct 24 17:50 event7
crw-rw----  1 root input 13, 72 Oct 24 17:50 event8
crw-rw----  1 root input 13, 73 Oct 24 17:50 event9
crw-rw----  1 root input 13, 63 Oct 24 17:50 mice
crw-rw----  1 root input 13, 32 Oct 24 17:50 mouse0
crw-rw----  1 root input 13, 33 Oct 24 17:50 mouse1

Code:
/dev/input/by-id# ls -la
total 0
drwxr-xr-x 2 root root  60 Oct 24 17:50 .
drwxr-xr-x 4 root root 480 Oct 24 17:50 ..
lrwxrwxrwx 1 root root   9 Oct 24 17:50 usb-SunplusIT_Inc_Laptop_Integrated_Webcam_HD-event-if00 -> ../event8

Code:
/dev/input/by-path# ls -la
total 0
drwxr-xr-x 2 root root 160 Oct 24 17:50 .
drwxr-xr-x 4 root root 480 Oct 24 17:50 ..
lrwxrwxrwx 1 root root   9 Oct 24 17:50 pci-0000:00:14.0-usb-0:4:1.0-event -> ../event8
lrwxrwxrwx 1 root root   9 Oct 24 17:50 platform-i8042-serio-0-event-kbd -> ../event4
lrwxrwxrwx 1 root root   9 Oct 24 17:50 platform-i8042-serio-1-event-mouse -> ../event5
lrwxrwxrwx 1 root root   9 Oct 24 17:50 platform-i8042-serio-1-mouse -> ../mouse0
lrwxrwxrwx 1 root root   9 Oct 24 17:50 platform-pcspkr-event-spkr -> ../event7
lrwxrwxrwx 1 root root   9 Oct 24 17:50 platform-PNP0C14:00-event -> ../event9
 
i've nothing related to kb & mouse , but there's something in by-path, so I changed your args line:
Code:
args: -object input-linux,id=mouse1,evdev=/dev/input/by-path/event5 -object input-linux,id=kbd1,evdev=/dev/input/by-path/event4,grab_all=on,repeat=on

output from starting the VM: kvm: Could not open '/dev/input/by-path/event5': No such file or directory
The error message seems correct since event5 exists one directory up.
Maybe try args: -object input-linux,id=mouse1,evdev=/dev/input/by-path/platform-i8042-serio-1-event-mouse -object input-linux,id=kbd1,evdev=/dev/input/by-path/platform-i8042-serio-0-event-kbd,grab_all=on,repeat=on instead.
 
SOLVED ! it's working perfectly for the keyboard, for the mouse only the trackpoint is working, not the touchpad. I tried to change events for the mouse but it's not working. anyway, having an usb mouse is ok for my config.
THANKS AGAIN !
 
SOLVED ! it's working perfectly for the keyboard, for the mouse only the trackpoint is working, not the touchpad. I tried to change events for the mouse but it's not working. anyway, having an usb mouse is ok for my config.
THANKS AGAIN !
Try /dev/input/mouse1 instead of /dev/input/by-path/platform-i8042-serio-1-event-mouse?
 
i tried these, kvm error says they are not evdev devices

/dev/input/mouse1
/dev/input/mice
/dev/input/mouse0
/dev/input/by-path/platform-i8042-serio-1-mouse
/dev/input/by-path/pci-0000:00:14.0-usb-0:4:1.0-event

with
/dev/input/by-path/platform-PNP0C14:00-event, VM starts but I have no idea of it's purpose
 
Code:
lsusb
Bus 001 Device 004: ID 0a5c:5801 Broadcom Corp. BCM5880 Secure Applications Processor with fingerprint swipe sensor
Bus 001 Device 003: ID 8087:07dc Intel Corp. Bluetooth wireless interface
Bus 001 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 413c:81a3 Dell Computer Corp. Hub of E-Port Replicator
Bus 002 Device 003: ID 046d:c52f Logitech, Inc. Unifying Receiver
Bus 002 Device 002: ID 1bcf:2985 Sunplus Innovation Technology Inc. Laptop Integrated Webcam HD
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

EDIT: adding usb device 'Bus 002 Device 002: ID 1bcf:2985 Sunplus Innovation Technology Inc. Laptop Integrated Webcam HD' makes the touchpad work.
Whith strange behavior though: cursor appears where i press my finger, i cannot reach the corners of the screen. Passing usb mouse is OK.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!