nbdd0121 / wsld

WSL Daemon - Stable X11 connection and time synchronisation for WSL2
Apache License 2.0
299 stars 26 forks source link

WSLD with no admin rights using VMID from registry #31

Closed PauliusMorku closed 1 year ago

PauliusMorku commented 1 year ago

Hello, I started working on a corporate PC and need to run WSLD with normal user rights. It seems like this feature is not supported currently, but I managed to make it work by providing WSLD with VMID like so: wsldhost.exe AB4A63F1-79B4-482E-AB9E-2CCD11314700. I was about to write a script that gets VMID from registry like described here and passes it as an argument to wsldhost.exe. But then I realized that WSLD already has code that is supposed to do that. However, when I simply run wsldhost.exe with no elevated rights I get this image Its seems like WSLD could easily run with no elevated rights, but there is some unwanted feature/bug that prevents it from doing so. Would it be possible to fix it? That would be such a great feature to allow this brilliant tool to run without admin rights. Best, Paulius

nbdd0121 commented 1 year ago

The registry-based VMID discovery is a bit unreliable when there are other Hyper-V users in the system so I changed the discovery method to fallback, but apparently the fallback mechanism is a bit broken.

Can you check the code on issue-31 branch work for you? Build artifacts can be found here: https://github.com/nbdd0121/wsld/actions/runs/4563539853.

PauliusMorku commented 1 year ago

That one seems to launch fine without providing anything. However, if WSL is restarted then WSLD does not seem to refresh, and if it is launched without WSL running then it freaks out. image It would be an awesome feature if it could monitor/poll registry and refresh itself if the VMID is present and just idle otherwise.

nbdd0121 commented 1 year ago

There is already a --daemon flag that does the regular polling.

PauliusMorku commented 1 year ago

My bad, forgot to try it :) Tested and seems to work fine!