-
Notifications
You must be signed in to change notification settings - Fork 846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2: hyper-v sockets, and VMID #4131
Comments
@Biswa96 You wrote the WslReverse thing right ? it's awesome ! I did not find anything about the VMID in the LxssManager COM interfaces though, have you ? |
We are working on a better host / guest communication channel that does not rely on hvsocket. I would not suggest taking a dependency on undocumented COM APIs because a certain dev (who happens to have a very handsome dog as his profile picture) tends to change them with wanton disregard. |
I have a semi-documented method. Use [
{
"Id": "WSL-03697A70-A16F-4AE6-BC91-73A1AD28E55B",
"SystemType": "VirtualMachine",
"Owner": "WSL",
"RuntimeId": "89d139ca-2324-5976-8706-dd7fd705ef16",
"State": "Running"
}
] More in my hvtool toy. |
That is what we do in Docker Desktop for now. Problem is: if there are multiple user sessions active at the same time running wsl, you have no way to know which VM belongs to which user. Also, this API requires elevated privileges |
The VMID is same with multiple distribution.
You can wrap those functions and run it as a service, just like LxssManager does. |
Again that is what we do. |
I worked with @simonferquel offline and this is no longer a requirement for Docker. |
Is there any source available to see the change? |
@Biswa96 no source code, but the approach is simple: instead of using hv socks for win32/Linux process communication, we wrote a bridge witch exposes our unix sockets in the Linux world as windows named pipes and vice versa. It is surprisingly scalable enough for all docker desktop needs. |
This is many times more work than if a simple a GUID available to users since WSL2 introduction. |
This is if you need to do multiplexing. If you just need to connect to a unix socket from windows, you can just |
Please fill out the below information:
Your Windows build number: Microsoft Windows [Version 10.0.18917.1000]
What you're doing and what's happening:
I am a member of the Docker Desktop team, working on integration with WSL2. We are using Hyper-V socket as a way to communicate between Windows and Linux processes (as cross-os unix sockets are not available yet on WSL 2). Everything works fine, but retrieving the VMID for setting up the HV-Socket connection requires admin privileges, and finding which running VM is hosting the current user's WSL distros.
What's wrong / what should be happening instead:
We need an API for getting this VMID reliably without admin privileges.
The text was updated successfully, but these errors were encountered: