Open kayg04 opened 3 years ago
Hmm, I guess maybe you couldn't listen on another user's VM's socket? Have you tried to run wsldhost.exe <VMID>
in the standard user under which the WSL2 run?
You're right.
Getting the VMID with hcsdiag list
and then using it as the standard user worked.
I also tested if the session would survive a hibernate or not, and it works beautifully.
But I think there would be an issue when I would reboot my PC, I'll have to manually get the VMID everytime?
Reboot will change VMID so yes.
I believe you don't need to be admin for the API. Can you try to add the standard user into the Hyper-V administrators
group to see if hcsdiag list
can be run without privilege elevation?
I also have this issue using wsl2. I added my account to Hyper-V Administrator group I still got the same error. (10013)
I have an LDAP account, and I tried with a Local Administrator account (which I putted in Hyper-V admins as you suggested, but without success) Any ways I cannot run the program the results is:
wsldhost.exe AB4A63F1-79B4-482E-AB9E-2CCD11314700
Failed to listen: Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée. (os error 10013)
Can you try to add the standard user into the Hyper-V administrators group to see if hcsdiag list can be run without privilege elevation?
It does.
I can also run wsldhost.exe
without admin privileges after adding myself to the Hyper-V administrators
.
Is it possible to just run wsldhost.exe
as admin from a standard user account? I don't want to give my account privileges that are not needed.
It certainly is possible, e.g. by launching a service from admin that just report VMIDs, and let wsldhost retrieve VMID from that service.
Unfortunately this would require significant change and I don't have time for that; I also don't use a setup that allows me to test it.
The VMID is stored in registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HostComputeService\VolatileStore\ComputeSystem
. I found it quite by accident.
I can get the VMID via regedit without admin privileges.
Thanks for the note! I'll have a look.
Latest commit on the master branch has switched the VMID retrieval mechanism to registry.
Hello, as stated in the previous issue. I'm unable to run
wsldhost.exe --daemon
nor am I able to runwsldhost.exe <VMID>
. Both of them result in the same error which is:I have absolutely no idea what could be causing the issue. My own account is a standard account and I have a separate account which is in the administrator group. I am running the command in an elevated powershell prompt opened as an administrator.
EDIT1:
I downloaded the
wsldhost.exe
from the build artifact of your latest commit.wsld
on the WSL2 instance has been installed using the command specified in the README. Additionally, I have tried excluding theexe
from Windows Defender but that hasn't changed the result.EDIT2:
Running
wsld
on the WSL2 instance obviously results in: