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-unixshould be a file, not a mount, so why the remount?
rwand why is
/tmp/.X11-unixappended to the command? Do you run
/tmp/.X11-unix mount -o remount,rw /tmp/.X11-unixor just
mount -o remount,rw /tmp/.X11-unix? I ask because they are not the same and
sudoerswill 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 per