How to reliably check if keyboard/touchpad are PS/2 internal or something similar?

How to reliably check if keyboard/touchpad is connected in such way, that problems with sys-usb do not affect them? There are modern laptops (like Thinkpads) that have such feature. I am not sure, maybe they use PS/2 internally or something. How to check on laptop that it is the case?

I mean there is probably a way to examine logs, or ls-usb/ls-pci output, but I want something simple to recommend other people for HCL.

Maybe something like:

qvm-pause sys-usb && echo 'Paused' && sleep 10 && qvm-unpause sys-usb

is a good way to check?
Is it working and are there any other good ways to check?

2 Likes

Maybe parse output of this command in dom0:

sudo libinput list-devices

But I don’t know if it’ll be different for hardware PS/2 devices and virtual PS/2 devices created from USB ones.

1 Like

The output of this command does not include the kind of info @balko was looking for :thinking:

Unrelated (bonus!) - running the command (piped to less) made my test 4.2rc5 Qubes installation to completely crash! … the first time it crashed… The chances it was a random crash are very low. I don’t know why the built-in i915 would go crazy, but it went crazy.

Nov 30 01:49:25 dom0 sudo[10652]: myuser : TTY=pts/6 ; PWD=/home/myuser ; USER=root ; COMMAND=/usr/bin/libinput list-devices
Nov 30 01:49:25 dom0 kernel: audit: type=1101 audit(1701352165.012:492): pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:accounting grantors=pam_unix,pam_loc>
Nov 30 01:49:25 dom0 kernel: audit: type=1123 audit(1701352165.012:493): pid=10652 uid=1000 auid=1000 ses=2 msg='cwd=“/home/myuser” cmd=6C6962696E707574206C6>
Nov 30 01:49:25 dom0 kernel: audit: type=1110 audit(1701352165.013:494): pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_env,pam_localus>
Nov 30 01:49:25 dom0 audit[10652]: CRED_REFR pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_env,pam_locamyuser,pam_unix acct=“root” exe=>
Nov 30 01:49:25 dom0 sudo[10652]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Nov 30 01:49:25 dom0 kernel: audit: type=1105 audit(1701352165.018:495): pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:session_open grantors=pam_keyinit,pa>
Nov 30 01:49:25 dom0 audit[10652]: USER_START pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_li>
Nov 30 01:49:25 dom0 kernel: audit: type=1106 audit(1701352165.302:496): pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:session_close grantors=pam_keyinit,p>
Nov 30 01:49:25 dom0 audit[10652]: USER_END pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_lim>
Nov 30 01:49:25 dom0 sudo[10652]: pam_unix(sudo:session): session closed for user root
Nov 30 01:49:25 dom0 audit[10652]: CRED_DISP pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_env,pam_locamyuser,pam_unix acct=“root” exe=>
Nov 30 01:49:25 dom0 kernel: audit: type=1104 audit(1701352165.304:497): pid=10652 uid=1000 auid=1000 ses=2 msg='op=PAM:setcred grantors=pam_env,pam_localus>
[…]
Nov 30 01:50:00 dom0 kernel: i915 0000:00:02.0: [drm] Resetting rcs0 for preemption time out
Nov 30 01:50:00 dom0 kernel: i915 0000:00:02.0: [drm] Xorg[3761] context reset due to GPU hang
Nov 30 01:50:00 dom0 kernel: i915 0000:00:02.0: [drm] GPU HANG: ecode 9:1:85dffffb, in Xorg [3761]
Nov 30 01:50:11 dom0 kernel: i915 0000:00:02.0: [drm] ERROR [CRTC:51:pipe A] flip_done timed out
Nov 30 01:50:26 dom0 kernel: i915 0000:00:02.0: [drm] ERROR flip_done timed out
Nov 30 01:50:26 dom0 kernel: i915 0000:00:02.0: [drm] ERROR [CRTC:51:pipe A] commit wait timed out
– Boot XXXXX68beb354b969c78fe4068dXXXXX –

1 Like

Yes, if the instructions are to run this in dom0, while having another terminal open (say, in the “personal” appVM) next to the dom0 terminal, and trying to switch to the “personal” terminal and type something while the dom0 terminal shows “Paused”.

1 Like

If you run

# xinput --list

and get something like

Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
AT Translated Set 2 keyboard id=12 [slave keyboard (3)]

then you should have PS/2 keyboard.

The command would also show you if you have any USB based pointer or keyboard.

Bonus:

https://wiki.osdev.org/"8042"_PS/2_Controller

$ cat /proc/bus/input/devices

1 Like

It’s a good solution, @tempmail … I thought of running something like:

journalctl -b -t kernel | grep -Ei "mouse|keyboard"
…in dom0 and look for the relevant lines, e.g., something like:

dom0 kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3

It’s very technical for a casual HOWTO.

Thank you, if it is the solution (I will have to check some day) it can be automated in the HCL reporting screen to provide value for the cell in the future updated Community Recommended Laptops list.

1 Like

The other way to check this for sure would be at the time of Qubes OS install. If internal keyboard and pointer (or any of them?) are USB, installation would notify you about that while being unable to create sys-usb?

1 Like

OK, we have user how reported this. It has:
AT Translated Set 2 keyboard id=15 [slave keyboard (3)]

So, we expect, that pausing sys-usb should not affect keyboard input, right?

Right

Relevant issue:

1 Like