A list of puns related to "Evdev"
I tried using this method for adding evdev input passthrough which gave me this error:
Error changing VM configuration: unsupported configuration: unknown input device type 'evdev'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/addhardware.py", line 337, in change_config_helper
define_func(**define_args)
File "/usr/share/virt-manager/virtManager/details/details.py", line 1380, in change_cb
return self.vm.define_xml(newxml)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 339, in define_xml
self._redefine_xml_internal(origxml, newxml)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 366, in _redefine_xml_internal
self._define(newxml)
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1064, in _define
self.conn.define_domain(xml)
File "/usr/share/virt-manager/virtManager/connection.py", line 554, in define_domain
return self._backend.defineXML(xml)
File "/usr/lib/python3/dist-packages/libvirt.py", line 4380, in defineXML
raise libvirtError('virDomainDefineXML() failed')
libvirt.libvirtError: unsupported configuration: unknown input device type 'evdev'
Next, I tried this method to see if I would get the same error but I ran into another issue where the XML file gets reverted if I edit the line at the top from <domain type="kvm">
to <domain type='kvm' id='1' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
. I tried the editor in virt-manager as well as on the commandline and it doesn't give an error or anything, It just doesn't save the changes or instantly reverts them. I'm sure there's something simple that I've missed but I haven't found anyone else with the same problem and I haven't been able to figure it out on my own.
Hello all,
I am running an Arch KDE vfio VM on an Arch host. I am passing keyboard and mouse vie evdev. Everything on the VM works perfectly, except for some funkiness with the keyboard.
I have a mechanical Night Typist keyboard, which is basically a 104 kbd with an addnl 4 keys upper right (calc, mute Vol up, Vol down). Basically there are two sets of problems when passing this keyboard.
In general: Numlock and caps lock keys toggle their functions, but the LEDs for each do not behave. Numlock is stuck constantly on, while caps lock is constantly off. I have also seen where the toggled on state is not reliable (e.g. typing numbers with mumpad, and then no numbers.)
For KDE specifically: These keys are not natively recognized by KDE, but one can use System Settings / Shortcuts to map them to their respective functions. I can do this on a physical instance of KDE (e.g. my laptop), but on the evdev keyboard they are unrecognized when I try to do this mapping. I can do different mapping of course, but my one attempt at that overwrote some other hot key behavior. Ideally these keys could be mapped to their intended purpose directly.
Ive looked at evsieve and python-evdev and both seem a little overkill, and anyway dont seem relevant to this problem.
Another option is to hook up separate cheap mouse and keyboard for the host, and pass the good stuff as USB devices to the VM. (I spend most of my time in the VM and ssh to the server).
Any suggestions on how to fix these problems with evdev passthrough?
Thanks
Edit: I am passing the keyboard thus:
<input type='evdev'><source dev='/dev/input/by-id/usb-04d9_USB-HID_Keyboard-event-kbd' grab='all' repeat='on'/></input>
Edit 2: I have also defined virtio keyboard and mouse, as suggested in the Arch Wiki on PCI Passthrough:
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
</input>
Hey everyone,
I wrote a library that allows a .NET 6 program to work with Linux evdev. The project can be found here.
It is a fork from this project which includes all the complex P/Invoke codes (many thanks to the author). I changed the project structure, files, namings and most importantly I added events to it.
My guess is that this library will be great for embedded, robotics and IoT projects. For example controlling the PWM signal of a motor with the trigger button of an XBox controller is an easy task with this library.
This is my first GitHub project/contribution and I would love to have your feedback.
Thanks,
Hello,
I use this python code for keyboard passthrough using evdev:
https://pastebin.com/raw/5Lj0wUGx
but when I run it I get that get_event_loop is deprecated, so I get errors on line 73 and 75, like:
RuntimeError: no running event loop
I'm not python developer, so I really don't know what is happening :/
Hi guys! I've been trying to set up a VM today as i reset my machine. Everything works fine, except i can't seem to get evdev passthrough to work. Here are my relevant qemu.conf file lines:
user = "evdev"
group = "evdev"
cgroup_controllers = [ "cpu", "devices", "memory", "blkio", "cpuset", "cpuacct" ]
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm",
"/dev/rtc","/dev/hpet",
"/dev/input/by-id/ckb-Corsair_K70_RGB_Gaming_Keyboard_vKB_-event",
"/dev/input/by-id/ckb-Corsair_M65_RGB_Gaming_Mouse_vM_-event"
]
And here are the users and groups:
andreas@pop-os:~$ groups andreas
andreas : andreas adm sudo plugdev input lpadmin libvirt
andreas@pop-os:~$ groups evdev
evdev : evdev plugdev input
The output for ls -g /dev/input/by-id/ and ls -g /dev/input/:
andreas@pop-os:~$ sudo ls -g /dev/input/by-id/
total 0
lrwxrwxrwx 1 root 9 Dec 2 07:02 ckb-Corsair_K70_RGB_Gaming_Keyboard_vKB_-event -> ../event2
lrwxrwxrwx 1 root 9 Dec 2 07:02 ckb-Corsair_K70_RGB_Gaming_Keyboard_vM_-event -> ../event3
lrwxrwxrwx 1 root 9 Dec 2 07:02 ckb-Corsair_M65_RGB_Gaming_Mouse_vKB_-event -> ../event4
lrwxrwxrwx 1 root 10 Dec 2 07:02 ckb-Corsair_M65_RGB_Gaming_Mouse_vM_-event -> ../event21
lrwxrwxrwx 1 root 10 Dec 2 07:02 usb-SunplusIT_Inc_FHD_Camera_Microphone_01.00.00-event-if00 -> ../event20
andreas@pop-os:~$ sudo ls -g /dev/input/
total 0
drwxr-xr-x 2 root 140 Dec 2 07:02 by-id
drwxr-xr-x 2 root 80 Dec 2 07:02 by-path
drwxr-xr-x 2 root 100 Dec 2 07:02 ckb0
drwxr-xr-x 2 root 260 Dec 2 07:02 ckb1
drwxr-xr-x 2 root 260 Dec 2 07:02 ckb2
crw-rw---- 1 input 13, 64 Dec 2 07:02 event0
crw-rw---- 1 input 13, 65 Dec 2 07:02 event1
crw-rw---- 1 input 13, 74 Dec 2 07:02 event10
crw-rw---- 1 input 13, 75 Dec 2 07:02 event11
crw-rw---- 1 input 13, 76 Dec 2 07:02 event12
crw-rw---- 1 input 13, 77 Dec 2 07:02 event13
...
And also the XML i use:
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
...
<qemu:commandline>
<qemu:arg value="-object"/>
<qemu:arg value="input-linux,id=mouse1,evdev=/dev/input/by-id/ckb-Corsair_M65_RGB_Gaming_Mouse_vM_-event"/>
<qemu:arg value="-object"/>
<qemu:arg
... keep reading on reddit β‘Hi, I'd like to go back to evdev because my mouse was much better with it than with libinput.
evdev:
$ sudo xinput --get-feedbacks 13
1 feedback class
PtrFeedbackClass id=0
accelNum is 10
accelDenom is 1
threshold is 1
$ sudo xinput list-props 13
Device 'USB Optical Mouse':
Device Enabled (176): 1
Coordinate Transformation Matrix (178): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (307): 0
Device Accel Constant Deceleration (308): 1.000000
Device Accel Adaptive Deceleration (309): 1.000000
Device Accel Velocity Scaling (310): 10.000000
Device Product ID (296): 7119, 5
Device Node (297): "/dev/input/event20"
Evdev Axis Inversion (311): 0, 0
Evdev Axes Swap (313): 0
Axis Labels (314): "Rel X" (186), "Rel Y" (187), "Rel Horiz Wheel" (305), "Rel Vert Wheel" (306), "None" (0), "None" (0)
Button Labels (315): "Button Left" (179), "Button Middle" (180), "Button Right" (181), "Button Wheel Up" (182), "Button Wheel Down" (183), "Button Horiz Wheel Left" (184), "Button Horiz Wheel Right" (185), "Button Side" (300), "Button Extra" (301), "Button Unknown" (299), "Button Unknown" (299), "Button Unknown" (299), "Button Unknown" (299)
Evdev Scrolling Distance (316): 1, 1, 1
Evdev Middle Button Emulation (317): 0
Evdev Middle Button Timeout (318): 50
Evdev Middle Button Button (319): 2
Evdev Third Button Emulation (320): 0
Evdev Third Button Emulation Timeout (321): 1000
Evdev Third Button Emulation Button (322): 3
Evdev Third Button Emulation Threshold (323): 20
Evdev Wheel Emulation (324): 0
Evdev Wheel Emulation Axes (325): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (326): 10
Evdev Wheel Emulation Timeout (327): 200
Evdev Wheel Emulation Button (328): 4
Evdev Drag Lock Buttons (329): 0
libinput:
$ xinput --get-feedbacks 21
1 feedback class
PtrFeedbackClass id=0
accelNum is 2
accelDenom is 1
threshold is 4
$ xinput list-props 21
Device 'USB Optical Mouse':
Device Enabled (164): 1
Coordinate Transformation Matrix (166): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (300): 0
libinput Natural Scrolling Enabled Default (301): 0
libinput Scroll Methods Available (302): 0, 0, 1
libinput Scroll Method Enabl
... keep reading on reddit β‘Hi, I am running Pop OS 21.04, with Pipewire & Jack.
This is my current config, and I am unable to use this (the intended config) because of a error: unsupported configuration: unknown audio type 'jack'
error.
I am not sure how to verify if I have QEMU built with Jack support. I didn't find info for debian setups. I was also unable to get PA working as well.
I added this into /etc/apparmor.d/local/abstractions/libvirt-qemu
# PipeWire/JACK
/etc/pipewire/* r,
/usr/share/pipewire/* r,
/run/user/1000/pipewire-0 rw,
As for passing keyboard issues via evdev, I was able to get the mouse working, just not keyboard;
Output by-id & event;
ls -l /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 Nov 9 02:58 usb-04d9_USB_Gaming_Mouse-event-if02 -> ../event9
lrwxrwxrwx 1 root root 9 Nov 9 02:58 usb-04d9_USB_Gaming_Mouse-event-mouse -> ../event6
lrwxrwxrwx 1 root root 9 Nov 9 02:58 usb-04d9_USB_Gaming_Mouse-if01-event-kbd -> ../event7
lrwxrwxrwx 1 root root 9 Nov 9 02:58 usb-04d9_USB_Gaming_Mouse-mouse -> ../mouse2
lrwxrwxrwx 1 root root 10 Nov 9 02:58 usb-0c76_USB_PnP_Audio_Device-event-if03 -> ../event10
lrwxrwxrwx 1 root root 10 Nov 9 02:58 usb-BY_Tech_Gaming_Keyboard-event-if01 -> ../event21
lrwxrwxrwx 1 root root 10 Nov 9 02:58 usb-BY_Tech_Gaming_Keyboard-event-kbd -> ../event18
lrwxrwxrwx 1 root root 10 Nov 9 02:58 usb-BY_Tech_Gaming_Keyboard-if01-event-mouse -> ../event22
lrwxrwxrwx 1 root root 9 Nov 9 02:58 usb-BY_Tech_Gaming_Keyboard-if01-mouse -> ../mouse3
lrwxrwxrwx 1 root root 10 Nov 9 02:58 usb-Generic_Integrated_Camera_0001-event-if00 -> ../event12
My QEMU XML. See my VM XML in the links above.
I have tried passing all the keyboard events (BY_Tech), and also tried passing event numbers as well, to no avail.
Also, incase it's useful;
Output of id:
uid=1000(crxssrazr93) gid=1000(crxssrazr93) groups=1000(crxssrazr93),4(adm),27(sudo),107(input),108(kvm),119(lpadmin),132(libvirt)
Thanks in advance.
I got errors from qemu-system-x86_64 like: "Could not open β/dev/input/event7β: No such file or directory".
After long investigation i realized i can't have 2 separate entries in apparmor configuration to allow access to input devices (mouse and keyboard). After i allowed whole directory in /etc/AppArmor.d/abstractions/libvirt-qemu in one rule, t started working.
I hope this will prevent such waste of time for someone..
Hey all.
I'm setting up my gaming VM again after a wipe and a fresh install of Linux. Something else has changed, though, and it has unintended consequences. I grabbed a Drop ALT keyboard... and the bloody thing has no right Control Key. That said... how should I go about modifying the default LCtrl+RCtrl keyboard shortcut? Or is there another, perhaps less convenient way to trigger the switch?
Any pointers are welcome and appreciated. =)
SOLUTION:
Updating this in case someone else comes looking. Both of the links I posted below are pointing in the right direction, but the one on the Gentoo subreddit is a touch out of date. Those parameters are no longer QEMU command line exclusive. What I put into my XML config was this:
<input type="evdev">
<source dev="/dev/input/by-id/usb-Logitech\_USB\_Receiver-if02-event-mouse"/>
</input>
<input type="evdev">
<source dev="/dev/input/by-id/usb-Massdrop\_Inc.\_ALT\_Keyboard\_1551771897-event-kbd" grab="all" grabToggle="scrolllock" repeat="on"/>
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
What's noteworthy here is simply the grabToggle="scrolllock"
entry. The libvirt docs cover the configurable options: https://libvirt.org/formatdomain.html#input-devices
The default keybinding seems to be Control_L and Control_R at the same time, but unfortunately my keyboard does not have a right control. Is there any way to change this behavior?
So a bit of an intro here. I've been following this guide which I will post below as I'm relatively new to vfio and linux but with the help of my brother who's done vfio before I managed to passthrough my video card and get it working with other inputs in 8-10 hours. I'm aiming for a relatively seamless setup where I can swap between Linux and Windows with a single press of a button using the same keyboard and mouse.
https://passthroughpo.st/using-evdev-passthrough-seamless-vm-input/
I 'm getting an error where it can't find either the mouse or keyboard device files even though they are all there.
https://preview.redd.it/oe0gj11ljti71.png?width=767&format=png&auto=webp&s=fa20ba030524294ddc3281fc71b97d3bd3703fe0
Here's all the error logs with all the devices that managed to produce garbled text in the terminal.
Error #1
Error starting domain: internal error: process exited while connecting to monitor: 2021-08-22T02:09:20.744697Z qemu-system-x86_64: -object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Logitech_Gaming_Mouse_G402_878207895554-event-mouse: Could not open '/dev/input/by-id/usb-Logitech_Gaming_Mouse_G402_878207895554-event-mouse': No such file or directory
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
callback(*args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
ret = fn(self, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
self._backend.create()
File "/usr/lib/python3/dist-packages/libvirt.py", line 1234, in create
if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2021-08-22T02:09:20.744697Z qemu-system-x86_64: -object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Logitech_Gaming_Mouse_G402_878207895554-event-mouse: Could not open '/dev/input/by-id/usb-Logitech_Gaming_Mouse_G402_878207895554-event-mouse': No such file or directory
Error #2
Error starting domain: internal error: process exited while connecting to monitor: 2021-08-22T02:21:19.076725Z qemu-system-x86_64: -
... keep reading on reddit β‘First VM, all works fine and out of the box!
However, I'm getting some troubles getting a convenient mouse/keyboard forward. evdev
works fine at first, but I have my mouse/keyboard connected via something like a KVM-switch (to share them between 2 physical machines) and the double-ctrl forward hotkey stops working the input devices are disconnected and connected back.
Is there a solution for it?
In principle it should be possible to make a fake device using cuse
and dynamically detect the real evdev device to forward the data from, but it may get complicated if there are some funny sysctl
s happening, other than just reading from the char device.
"You could just forward the usb device!" -- right, also tried that. Win10 refuses to understand my forwarded "logitech everywhere" receiver, unless it was forwarded before the VM was started. Wasn't able to find any mentions of this problem anywhere else, and if anyone has a solution, that would be great!
I have a working Win10 VM XML that uses EvDev to share my laptop's keyboard used on Linux host with Win10 VM. Since I cannot seem to get the trackpad to work successfully with EvDev, I've resorted to using an external mouse. EvDev is working fine.
However, there are times when I'd prefer NOT to use EvDev, and just use an external mouse and keyboard that is exclusive to the VM always. This is so I can avoid accidental inputs on either the host or guest, if I have something important running and want to avoid forgetting the current state of input focus (on host or guest), then messing something up by accident. For those situations, I'd rather not use EvDev.
Is there a way to somehow pass a parameter to the xml and depending on that passed value, the EvDev lines can either be processed or ignored? I'm using virt-manager. Would there be a way to over-ride from the command-line? Or would my best bet be to create a copy of the xml without the EvDev lines and run virt-manager and point to the desire xml from the command line (if that's possible)?
My second question: Does anyone know if EvDev is supposed to support touch/trackpads on laptops? My laptop keybard works fine with EvDev but I don't see a mouse pointer and gestures don't do anything when I use the trackpad in Win10 VM. I did confirm I have the right /dev/input/by-id file for the trackpad by running cat on it and then moving the trackpad and seeing garbage characters spit out onto terminial.
Thanks in advance for your help.
I seem to see postings indicating evdev supports laptop trackpads, but found some post also saying it just doesn't work.
I have an ASUS Zephyrus G15 laptop and run Win10 VM using Qemu/vfio. Evdev works fine with the laptop keyboard. I can easily switch from using the keyboard in the guest VM or linux host. The trackpad on the other hand doesn't work in the VM. I did test to make sure I had the right file by performing cat <file> on the "mouse" event in "/by-id" sub-directory and when I moved my finger across the trackpad the terminal output garbage, confirming I had the right file.
Iβm about to buy new desktop computer(with Linux) and Iβm intending to use VFIO to play Windows-based games and BFRC-based interpolated videos.
Last configuration I used was with the monitor having KVM switch feature. This makes change the input source(or to/from PIP/PBP mode) and selected USB upstream by running DDC/CI-based scripts(usually independent KVM switches require keyboard hotkey interception, so cannot be controlled by scripts).
However, this time I want to try Looking Glass + EVDEV passthrough method for two reasons: 1. Donβt want to buy expansive monitor with KVM switch, 2. I want more seamless experience(use Windows in Linux GUI window) then changing whole input source or using monitorβs PIP/PBP feature.
Iβve never used Looking Glass or EVDEV passthrough. So I want to know how much their latencies are bad before buying monitor. How are they?
It doesn't appear as though input devices connected via Bluetooth have permanent paths in /dev/input/by-path
or/dev/input/by-id
, and are instead created on-the-fly with only a node in /dev/input/event$
.
Since those device paths aren't stable, they're not suitable for putting in static configuration, like libvirt machine XML definitions.
There does seem to be /dev/input/mice
which looks like it'll do the job and multiplex all mouse output, but I don't see a similar one for keyboards.
On a highly related note, since QEMU expects a device path, if you unplug the device while QEMU is running it loses it until the VM is restarted, which is not ideal.
So is there a way to have an abstract evdev device that will multiplex all keyboards into one node, like what seems to exist for mice?
I have a working vfio/gpu-passthrough/qemu setup using looking-glass. Now I want to use evdev so I can use my laptop's keyboard and mouse in my VM's, and switch to use those devices on my Fedora Linux host as needed by using CTRL-L and CTRL-R hot keys.
Setup instructions seemed pretty straight forward. I modified qemu.conf and my qemu win10 xml accordingly, then tried to run the VM and got a permission denied warning. I resolved that by adding a rule to SELinux by creating a .pp module and running a command to add the module to put it into effect. After that, I no longer got permission denied message but now get a message about the keyboard device not being an evdev device.
I have confirmed by using cat command in terminal to confirm that the below device is correct. As I typed on my keyboard I saw garbage output displayed in terminal where the cat command was executed.
both my win10 xml and qemu.conf point to the device name below which is symbolic link to the event. In the xml, I use qemu arg value method to do this. When I try instead to use this method:
<input type='evdev'>
<source dev='/dev/input/by-id/usb-ASUSTeK\\\_Computer\\\_Inc.\\\_N-KEY\\\_Device-if02-event-kbd' grab='all' repeat='on'/>
</input>
I get a an error message about "unknown input device type: evdev" when I attempt to add the above and save changes to the xml. Could Fedora 34 require explicit installation of some evdev dependency/package? I read that support for evdev is built into the kernel.
I confirmed the actual event (event7) has group permission 'input' set, and that my user is added to group 'input'. I also tried adding user 'qemu' to group input to no avail.
I also tried pointing directly to the event rather than the symbolic link below.
In all cases, I continue to run into the below error message.
So, I am wondering if I need to install evdev packages under Fedora 34 + Wayland, or if it should be working "right out of the box"?
I did make sure I either rebooted or restarted libvirtd after making my changes.
At this point, I am at a loss as to what the problem is.
Any help would be greatly appreciated! Due to greater latency, I would prefer not having to resort ot using spice or barrier/synergy.
https://preview.redd.it/vzcaatpe4vh71.png?width=393&format=png&auto=webp&s=e49b68076f76dd76e7adf20b631f13ece9c8f3c0
This is an odd situation that I'm hoping is down to some mis-set options.
For set up - I have a Debian (Actually LMDE) host running a Win10 guest. The Win10 guest is purely for playing games, so I have a GTX 1060 passthrough, and I share the keyboard/mouse between them using evdev so that I only need one keyboard and mouse. The OS is stored in a raw image on an SSD, and games in a raw image on an NVME drive (I.E *.iso files created by virt-manager, not an actual direct passthrough). In general this works well.
What I am noticing, though, is that every so often the keyboard will get "stuck" - that is, if I press "A" in a game to move right, and then release the key, my character will continue to move right as if the key is still held down. Pressing and releasing the key again clears this issue up. This does only seem to happen in games - I have not noticed it occurring when on the desktop, though I also haven't spent much time testing it there.
This in general seems to happen most often when things like textures are opening in. I followed this guide to get evdev set up, and also their recommendations on dealing with poor performance in games by setting all disk IO devices to "threads" since they mentioned the watchdog thread getting bogged down (with things like loading textures) can cause this issue. This helped, but did not solve, the issue. My setup is basically a copy/paste of what is on there except with the required substitutions.
So far I've only tried this on Mass Effect 1 in the legendary edition, so I suppose it is possible that it's an ME1 issue, but I figured I'd ask to see if this is a known issue and has a known solution.
FWIW, I do not (yet) have things like hugepages turned on. I basically followed this guide to get things up and running and have just been testing the setup out to see if it'll work or if I'll need to do a traditional dual boot to get decent performance. In general it seems to work well, though I haven't tested VR yet, so this is really the last issue I'm trying to solve.
After a recent update to my Arch system, suddenly evdev doesn't seem to pass my keyboard anymore to my years-old Win10 gpu-passthru VM. No errors from qemu on run, nothing in the journalctl -u libvirtd
either; just get no input from the keyboard after the VM boots (the mouse still seems to passthru ok). The keyboard stays bound in the host OS and works as normal.
I can kinda work around it thanks to Spice; this allows me to send keystrokes if I focus the VM window spawned by virt-manager
. But this doesn't seem to provide anyway to free my mouse from the VM, and I'm sure will have the same polling problems in games that made be switch to evdev in the first place.
I'm wondering if anyone else has seen a similar issue or has any idea what else I can try to debug it.
Things I've tried so far:
/dev/input
and that cgroup_device_acl
in qemu.conf
are correctevent*
directly instead of by-id
(same result; mouse works keyboard doesn't)if01
input for my keyboard both instead and in-addition-to (this doesn't show anything when I cat
and press keys, but I thought I'd try anyway... same result.)virsh
, both as my normal user and as root with sudo
group=kvm
from qemu.conf
(saw this as a possibility in another thread, but no change for me)/var/log/libvirt/
; no relevant lines.Posting what I think are the relevant parts of the config to keep down noise -- happy to post full versions or other files/commands if that will assist. This has been puzzling me for a couple days, so much thanks for any help anyone can provide!
Here's virsh dumpxml
:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
...
<qemu:commandline>
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Logitech_Gaming_Mouse_G502_057B34543738-event-mouse'/>
... keep reading on reddit β‘Which program has the best latency for passing through a mouse and keyboard for gaming. Also, which one seems to work the best?
Might be the wrong place, but I have been having issues with various custom keyboard firmwares and stuck keys (qmk,tmk, soarer) when being passed through to a vm via evdev. Specifically, the keyboard is using a teensy2.0 with any of those listed firmwares and certain keys will get stuck (typically modifiers) while on my main Linux os those issues are present. Anyone have suggestions to what might be the cause or at least suggestions for providing more useful information to determining the cause?
My host is Manjaro with RX 5700 XT connected to 2 monitors using DP and i have a few VMs (FreeBSD, different Linux flavours, several macOS versions, Windows 10) with a GT 710 passed through connected to HDMI. I always only run one VM at a time, because they share the same GPU.
I also use `evdev` keyboard and mouse, so I simply press left+right ctrl to switch the input target. Now i just stumbled accross `ddcontrol` and am now able to switch the input source of my monitors in the terminal (HP Z27n G2, not in the ddcontrol db, but still works).
Is it possible to react to the evdev input switch event and run a script, so not only the keyboard and mouse target switches, but also the monitor input source?
Got a new keyboard last week started up my windows 10 VM got error telling me it cloud not find my keyboard makes sense the one it was looking for was not plugged in so edit to the xml to use the id of my new keyboard but i just can not get it to work, i have tried put full id, i have tired, passing just the event what the is is a symink to, i even tried making a new symlink to the keyboard that my user owns, but what ever i try i always get the operation not permitted error, i even tired different usb ports, plugged my old keyboard back in and set the xml to the id of that and it just works is it just corsair keyboard dont play well with evdev or am i missing something?
I wanted to be able to change my monitor input when I switched my keyboard and mouse between my host and guest, but haven't been able to find any clean way to handle it, so I wrote a service to do it and thought I'd share. There's also a PKGBUILD for Arch users.
When it detects a change it toggles the input and sends a D-Bus signal. There's an example in the repo to show how to use it. This is based on my personal script that switches my monitor and makes some changes to my window manager layout when I toggle between the host and guest.
If there's enough interest, I was thinking about adding functionality to create virtual devices that combine several real devices, and maybe putting the package in the AUR.
I was just scratching an itch, but I hope someone else finds it useful!
I've read dozens of pages about switching from libinput to evdev to get the Mouse -> Advanced tab back.
I manged to load the evdev driver for my mouse (both Xorg logs and xinput list-props
confirm this), but I still see useless mouse settings without the Advanced tab.
Hello everyone, i have a Drevo Blademaster 87 that i use for both my host and VMs through evdev.
Until a couple of weeks ago, the media controls (the knob on the left) were not handled by /dev/input/by-id/usb-DREVO.Inc_BladeMaster_TE_87K-event-kbd
but by a second device called event-mouse
, so by not adding that in the qemu args i could make the host handle all the volume keys, even after pressing LCTRL+RCTRL to switch inputs (i route my audio through pipewire-pulse so i like having that global control).
After updating to linux 5.12 and qemu 6 the media key presses are sent through the event-kbd
and not through /dev/input/by-id/usb-DREVO.Inc_BladeMaster_TE_87K-event-mouse
so they end up being handled by the vm and i have no way to exclude them. Is there a way to fix it?
Since passing a graphics card to a Windows VM I needed to also (to avoid secondary devices) pass my keyboard and mouse using evdev. But my bluetooth mouse and keyboard do not show under the by-id or by-path directories, only under /dev/input/eventXX. Configuring my VM xml and qemu.conmf to refer to the eventXX devices works and allows me to use them in the VM and host concurrently (using L-CTRL and R-CTRL) but, as warned, when I reboot one or both are located under a different eventXX number which breaks my configurations.
Should this be working by default in Fedora 34? Regardless, does anyone know what udev rules I might be able to manually create to automatically set the by-id and by-path files so this doesn't break after each reboot?
Basically I have everything working except I want to pass through my host keyboard and mouse via evdev and the guide I followed (since I've had no success on my own) doesn't seem to work.
Heres the guide = https://github.com/ethannij/VFIO-GPU-PASSTHROUGH-KVM-GUIDE
When I add the following to /etc/libvirt/qemu.conf libvirtd fails to start and I never get a prompt to put in my password to show the virtual machines in virt-manager.
cgroup_device_acl = [
"/dev/kvm",
"/dev/input/by-id/KEYBOARD_NAME",
"/dev/input/by-id/MOUSE_NAME",
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet", "/dev/sev"
]
I replaced the placeholder names with what I think are the appropriate ones for my mouse and keyboard but it doesn't work unless I uncomment all of the above.
Here's what I have in there now...
cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm"
"/dev/rtc","/dev/hpet", "/dev/sev"
"/dev/input/by-id/ckb-Corsair_Gaming_K70_LUX_RGB_Keyboard_vKB_-event",
"/dev/input/by-id/ckb-CORSAIR_M65_RGB_ELITE_Gaming_Mouse_vM_-event"
]
The guide also mentions adding in a user and a group to the .conf file but it doesn't say where or what exactly I need to add. Does anyone know more about that?
I'm trying to configure audio passthrough with pipewire. I've got it working with this configuration:
<qemu:arg value="-device"/>
<qemu:arg value="ich9-intel-hda,bus=pcie.0,addr=0x1b"/>
<qemu:arg value="-device"/>
<qemu:arg value="hda-micro,audiodev=hda"/>
<qemu:arg value="-audiodev"/>
<qemu:arg value="pa,id=hda,server=/run/user/1000/pulse/native"/>
or this:
<qemu:arg value="-device"/>
<qemu:arg value="usb-audio,audiodev=usb"/>
<qemu:arg value="-audiodev"/>
<qemu:arg value="pa,id=usb,server=/run/user/1000/pulse/native"/>
But both show the same issue: whenever I switch context using evdev, the vm audio stutters for a second. What can I try to mitigate stutters with evdev?
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.