-
Notifications
You must be signed in to change notification settings - Fork 25
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
vmsocket with mintty #1
Comments
My grey matter is perforated in that area 😁 So, I'm reading some books.
"I'm sure you've noticed by now" that the PPL restriction is somehow lighter now (except the conversion). So, anyone can make their own init, LxssManager, except need administrator privilege. |
Yeah did notice that 😉 Actually in a more perfect world, there is no need for elevated privilege at all, notwithstanding the unrelated and arguably superfluous step of enabling Hyper-V in the first place.
And there is the rub. Since WSL1 isn't going anywhere (this is a good thing), there is going to remain some unavoidable complexity in the model so everything looks seamless the end users. |
Is this leading to a solution to build a wslbridge alternative for WSL2? |
Answer: This repository 😄 I found some defects:
|
Confused. If it's something similar to wslbridge-frontend and wslbridge-backend, the client would be a cygwin program and not #include <linux/vm_sockets.h>? |
Ohh.. my mistake, I've not add any readme. Now, the code is just a demo to connect WSL2 and Windows. |
That's WSL#4131 |
Probably counts off topic to wslbridge2 (in this one topic repo) but I spent the weekend doing a |
Can you describe a reproducible usage scenario? |
Which of the 4 programs in hvsocket is the a.out in your screenshot? |
I have added the code for "vmsocket with mintty". Compile the hvpty both in cygwin and WSL side with |
Running the client:
(Note the German error description despite Running the server:
If both errors would not happen, how would the backend be started? Can this be automated for a replacement of wslbridge? |
hvpty is for WSL2. This whole discussion is about WSL2. |
Saw your post. First off, very nice work on getting
AF_VSOCK
working.That being said, I am pretty sure
mintty
isn't going to be the killer-app for this. Thing is, we already have a channel. You've probably already also noticed that old/dev/tty1
in WSL1 is now the (infinitely more sensible) new/dev/pts/0
in WSL2.Which is to say: there isn't actually a point to using another channel (be it
AF_INET
on localhost likewsltty
, orAF_VSOCK
in a hypotheticalwsltty2
). But not to discourage you or anyone from doing it for the time-sink value. It just doesn't make much sense when/dev/pts/0
is right there.The fix is going to be along the lines of WSL#3279.
But regarding the mail you cited... If you do take a run at a
wsltty2
, you want MSYS2 viavcpkg
, not Cygwin. MSYS2 apps are otherwise native Windows apps. In particular, they don't pretend to support</sys/socket.h>
(see this thread). You'd just use<winsock2.h>
. All of which to be clear has nothing to do withmintty
, which doesn't care whether the bytes are going over aAF_VSOCK
or a 300 baud modem. And after you've gone and marshaled the bytes overAF_VSOCK
, on the WSL2 side you are going to have to create a (wait for it)/dev/pts/N
just likesshd
ortelnetd
(in your case let's call itwslvsockttyd
). [The pretty screencap with all the sixels is by the way just Git Bash (note the icon) akamintty
with Windows OpenSSH andsshd
doing the pty heavy lifting.]As an aside since I'm here, I also have in my head (but not on paper) an api for marshaling data in and out of WSL2 which is not susceptible to the flawed "sorry the api is in flux" line of reasoning that we've been faced with since 2016. I'm sure you've noticed by now the disappearance of
/dev/lxss
in WSL2. In a more perfect world, that implementation detail wouldn't have changed anything. Think URIs to describe the channel and closed-but-extensible backends to implement the channel. One such backend could be based on vmsocket.The text was updated successfully, but these errors were encountered: