I am using win-kex on WSL2 trying to use the GUI, but I have a known connection problem, so I need to run this command before to successfully connect:
sudo mount -o remount rw /tmp/.X11-unix
I added this to sudoers
as end line of file:
myusername ALL=(ALL) NOPASSWD: /tmp/.X11-unix mount -o remount rw /tmp/.X11-unix
But it keeps asking me for the password. Why? I don't want to avoid all sudo passwords request, just that command. But that doesn't work.
.X11-unix
should be a file, not a mount, so why the remount?remount
andrw
and why is/tmp/.X11-unix
appended to the command? Do you run/tmp/.X11-unix mount -o remount,rw /tmp/.X11-unix
or justmount -o remount,rw /tmp/.X11-unix
? I ask because they are not the same andsudoers
will not treat them the same. You need to comma separate different commands.myusername ALL=(ALL) NOPASSWD: mount -o remount\,rw /tmp/.X11-unix
(note escaped comma, as perman sudoers
)