This post contains the kali linux keyboard freeze fix. Kali 2.0 is out, and I’ve installed it on my work pc; one thing I noticed was that the usb keyboard kept becoming un-responsive. It was very annoying.
- Keyboard stops responding randomly for a few seconds, making typing very difficult.
- various messages in /var/log/messages and dmesg about new usb devices (eg the keyboard over and over again)
- the mouse pointer still works, and the mouse still moves around, but you cant click anything and you cant type
- lots of typos as keys randomly stop working in the middle of typing!
kali linux keyboard freeze fix.
After a bit of digging around, I figured out the freezing was because the keyboard was being ‘unplugged’ and ‘re-plugged’ – I wasnt actually unplugging it, it just looked that way in the log. After some google-fu I figured it was with the new kernels usb autosuspend state in usbcore, and found an answer on stackexchange that fixed it for me (link to original thread at the end of this post), I added the details to my blog so that I wouldnt forget
cat /var/log/messages and dmesg had lots of stuff about usbcore and the keyboard being found over and over
Run the following command:
cat /var/log/messages | grep usb
dmesg | grep usb
if you get lots of repeating information about usbcore and your keyboard (I had my apple usb keyboard being added 78 times) run the following command:
if the result is not -1, then you should try the fix. Essentially you add a parameter to grub, update-grub and reboot and its fixed
I found this fix on stackexchange (link to original thread at the end of this post), it works for kali 2.0 as its based on debian.
For Ubuntu and Debian, usbcore is compiled in the kernel, so create entries on /etc/modprobe.d will NOT work: we need to change the kernel boot parameters.
Edit the /etc/default/grub file and change the GRUB_CMDLINE_LINUX_DEFAULT line to add the usbcore.autosuspend=-1 option:
Note that quit was already present. So keep other options you have too.
After saving the file, update grub and reboot
sudo update-grub reboot
Now check autosuspend value:
And it should display -1.