3

I have a Logitech M315 mouse with a nano receiver and have Solaar installed so that I can use it on mu Lubuntu laptop. Solaar runs on startup like I would expect it to, but whenever I plug in my nano receiver Solaar says:

Found a Logitech Receiver (/dev/hidraw1), but did not have permission to open it.

If you've just installed Solaar, try removing the receiver and plugging it back in.

The only way for this message to disappear and get Solaar to work correctly is to open a terminal and runsudo solaar. I take this to mean that it requires root permission to open the USB device read/write. I use Solaar to pair/unpair my devices so having a terminal hanging around all the time is both annoying and RAM-consuming (my laptop only has 512MB physical RAM).

The only way I know how to fix this is from back in my UNIX days where you put it in /etc/profile, but this only runs in Linux is the user logs in at a text mode shell (via a terminal or Ctrl-Alt-F2). Is there another way to give Solaar root permission at startup so that my mouse will work and I can get this annoying message out of my face?

nkeck72
  • 173

1 Answers1

3

You can use a udev rule to give the current seated* user read/write privileges to the HID device representing the Logitech Unifying USB receiver. An example of such a rule can be found in the Solaar rules.d/42-logitech-unify-permissions.rule file.

You mentioned (un)pairing and a M315 mouse. If that is all you need, you can also try the solaar-cli tool which immediately exits after pairing. Alternatively, you can use the small ltunify utility which is describes at this page (basic invocation: ltunify pair and ltunify unpair).

As an additional note on file permissions, do note that anyone who can read from the hidraw device is able to intercept your mouse motions (and keyboard strokes if you have a wireless keyboard). If you are worried about that, do not install the udev rule and instead stick to sudo.

*) seated means the user who is physically at the computer. This excludes SSH users for example who are not physically logged in.

Lekensteyn
  • 174,277
  • I copied the contents from GitHub to the file in rules.d and it still doesn't work. Am I missing something? – nkeck72 Dec 19 '15 at 22:42
  • @nkeck72 What Ubuntu version are you using? For really old versions (Ubuntu 12.10 and older) you have to uncomment line 36. If you are not yet in the "plugdev" group, either change it to your username or add yourself to it. – Lekensteyn Dec 20 '15 at 12:19
  • I'm using lubuntu 15.10 – nkeck72 Dec 20 '15 at 14:51
  • And what does "not working" mean? You still get the error even after placing it in /etc/udev/rules.d/ and re-inserting the USB receiver? – Lekensteyn Dec 20 '15 at 16:13
  • Yes, that's what I mean – nkeck72 Dec 20 '15 at 16:14
  • I have added myself to the plugdev group, but I am still getting the error message. I added myself through the GUI (on Lubuntu: System Tools > Users and Groups). I have rebooted my laptop and am still getting the error. Suggestions? – nkeck72 Dec 20 '15 at 16:29
  • Can you invoke the lsusb -d 046d: command? The product id (c52b for Logitech Unifying receivers) should appear in the rules file. Can you also check the permissions for the USB device? ls -l /dev/hidraw1 should show show a different group (if you uncommented that) or crw-rw-----+ for the permissions (when you have the uaccess tag enabled, the + signifies the application of an ACL). With getfacl /dev/hidraw1 you should then see a line such as user:yourusername:rw-. – Lekensteyn Dec 21 '15 at 22:06
  • I had the file in the wrong directory, I placed it in udev instead of in udev/rules.d – nkeck72 Dec 29 '15 at 21:12