wsl-sudo
wsl-sudo copied to clipboard
socket.timeout: timed out when attempting to run any command with wsl-sudo in WSL2
I'm running WSL2 Ubuntu 20.04 on Windows 11. This is a fresh WSL2 installation with barely nothing else installed.
I did a fresh checkout of the current master, which should have #2 merged in. When I run the script, using any command as argument, I get a timeout with the following stack trace:
python3 wsl-sudo.py net.exe
Traceback (most recent call last):
File "wsl-sudo.py", line 335, in <module>
main()
File "wsl-sudo.py", line 331, in main
UnprivilegedClient().main(**vars(args))
File "wsl-sudo.py", line 236, in main
self.sock, acc = listen_socket.accept()
File "/usr/lib/python3.8/socket.py", line 292, in accept
fd, addr = self._accept()
socket.timeout: timed out
Any clues as what might be causing this?
I think your current user is not admin. I have the same problem when elevating from non-admin user...
@highTowerSU, when you say current user, do you mean the Linux user or the Windows user? I seem to be having a similar problem.
I think of was the underlying Win User, but i am unsere...
The error occurs when you run wsl-sudo.py
from a non-default WSL instance. Does it work with this version? Here's an example that works for me:
python wsl-sudo.py "/mnt/c/Program Files (x86)/Vim/vim82/gvim.exe"
(I know vim 9 is out.)
I have the same issue on WSL2 Ubuntu (22.04). I tried applying the changes from this PR that @fenjen mentioned in their comment, but it did not help. Another thing to mention is that my Windows OS has multiple users and the default one is not an Administrator, so when I try to run the python3 ...
command, the login window pops up. Maybe that ahs something to do with this issue.
@spector32 Is the user running the WSL instance an administrator? If not, the login window that pops up (with a pre-filled administrator account asking for a password) is what I would expect.