-
Notifications
You must be signed in to change notification settings - Fork 822
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
Running VS Code native in WSL #2293
Comments
I have got past this error now and have no more hard errors showing in the verbose output but it still doesn't show in the X Interface, I don't know why as most other apps I try do. I should point out that to get past the UDEV monitor issue I followed instructions to install libudev-stub at https://github.com/therealkenc/libudev-stub |
Just wanted to say I'm at exactly the same point and can't get past it. Steps to reproduce (from a clean WSL Ubuntu install):
Yields:
Trying with the --disable-gpu flag gets rid of the libGL error but nothing more. This is with version: 1.16.0-insider d0d00e882437092f521d2d7893cc56ee296d278f |
@corford - Try |
@sunilmut Thanks! Sadly, still gets stuck in the same place (but dbus message is now gone 👍 )
|
This issue remains an abject dupe of #1233. The udev stub is obsolete as of 16275, FWIW. Which changes nothing regarding VSCode, because VSCode does not work for reasons unrelated to udev (or dbus). |
Yep, apologies for resurrecting it. Looks like VSCode under WSL is still a way off (if it happens at all). |
Maybe. Maybe not. The reason VSCode does not light up is because the IPC message to fire the method that launches the window never makes it, or never gets sent in the first place. That could be for lots of reasons. Sunil might find and fix the problem next week, given a tight repro. Maybe it's a one liner bug. Or it might take another nine months, based on the fact that the same issue has existed for the last nine months. Absent a tight repro, getting the libuv test suite to pass (#1744 May 1 message) is a good place to start. See also honourable mention in #1910. #2333 would go a long way too, and is being looked at. |
Did somebody try to get xpra under wsl to work? This might be another alternative. |
The vscode blocker(s) is(are) not display related. |
I digged a little bit into this and I found the reason why VS Code is not starting up. It is as follows: for some reason which I don't know the async callbacks passed to Node API calls aren't invoked. Since VS Code main code and loader heavily depends on async file reads and other async Node API the main process is pretty early waiting for callbacks which never fire. This can easily be reproduced / demoed using the electron starter app:
console.log('In createWindow')
setInterval(function() {
console.log('Event loop is running')
}, 1000)
Observe: the electron app starts but no This is not a general problem of the electron / node under WSL. If you run electron as pure node everything works. To check do the following:
I have to say that I am not a WSL or C / Chromium / Node / Electron expert so I have no idea of why the event loop is not running (so I guess some native event is missing to make it go :-)). If someone fixes this I am happy to continue getting VS Code up on WSL. |
Even though the team that works on VSCode may be small, promoting VSCode to run on various platforms EXCEPT window's own WSL seems a bit strange to me. One of the reasons for WSL is to attract developers to a Windows base system. The two teams, i.e., VSCode and WSL, should drink some coffee to fix this issue. Being able to run VSCode within WSL would make many happy. |
That was brought up here. 31 unanimous down-votes as of this writing. If it seems "strange" to you, please re-read the WSL FAQ and the post above yours. Fun fact: Electron is not a MSFT product. It is maintained by GitHub (and others), and is based on code from Google (and others). GitHub and Google could in theory expend development resources to find out why their stuff doesn't work on WSL. But then they probably read Microsoft's WSL FAQ and decided they had plenty of their own Electron and Chromium bugs to fix instead. I started taking another run at it (now that #2333 is squashed), but the recipe I have been using to build electron from source is failing with 1.7.9 for some reason unrelated to WSL. I hadn't considered that drinking coffee might fix the issue, so I'm out to Starbucks now. |
Okay so I've confirmed the suspicion I've alluded to previously. The problem relates to an For background, the reason Dirk's Why, precisely, it is stuck I can't tell you right now. But anyway "there's your problem". The relevant code in the backtrace is I did the test with electron off master (which is v1.8.2-beta.2-ish) because I never did get 1.7.9 compiling. But it doesn't matter for our purposes because the basic structure has remained the same since the beginning of time. The test case I am using is stripped down a little further than Dirk's. It does not actually launch a GTK window, and thus avoids a lot of superfluous syscall verbosity loading an html page and painting. CLI use case. Or something.
On Real Linux™ it will spit out Real Linux strace output here and WSL strace output here. But I mostly recommend against bothering because there are no hard fails (
|
Consolidated repro notes for anyone one who feels inclined to play along and does not want to scour the Interwebs. |
So my understanding of this issue is that if it were fixed, we would have a universe where we:
No doubt, that's a huge leap forward and establishes ever closer parity from WSL to Real Linux(tm) – But I think that might be more ambitious than what this issue actually needs, and I'll beg for @mredbishop 's understanding if this is a hijack of his needs. I think what he, and I, and others really want is: The Holy Grail
As far as I can tell, X is just a hack to get something from WSL land on the screen. Who wants that when The Holy Grail is prettier (although may occasion more work!) Question: Is it conceivable that my holy grail scenario would ever be possible and how hard is it? While the FAQ readily sets the expectation that building and running GUI apps from WSL into Windows via X might not be possible, My interpretation of the FAQ suggests that 1) running a C- and Node-based build process to create a binary executable and 2) executing Windows apps from WSL are reasonable expectations. Use Case: Here's a use case. I'd like to have the vspython plugin for VS code use WSL-configured Python instances for debugging, etc. I'd like to try to write a patch to make that possible. But as it stands, I would have to download and install the native build toolchain instead of simply using the robust toolchain inside of WSL. I want to contribute to VSCode. I want to add in some debugging output and some print statements so that I can learn to contribute. And then I want to get VSCode to work with my Python setup. The limit is the inability to build, in WSL, a VSCode from source. The addition of an X server is obfuscatory. I don't think VSCode would-be hackers are thrilled to run X – they want to get in a code, debug, repair cycle between WSL and WIP-builds of VSCode. Addendum: @therealkenc and @dbaeumer have provided amazing debug output. Output that I'm not fit to appreciate or comment on. I'm trying to follow your steps and learn more. I disagree with the tone of the comment made by another user that @therealkenc linked to. I believe the tone of this individual's comment is what's receiving the thumbs-down, not the dream that it, underneath its mantle of bluster, shares which is, effectively, what I call "The Holy Grail." I'm hoping that my asking this question in a more calm way isolates and clarifies the true goal of these issues Again, my heartfelt gratitude to what you electron -hackers and C-gurus have already discerned. |
When digging into this I was able to compile VS Code from source in WSL using the normal tool chain used to compile VS Code under Linux. However I was not able to run it due to the problems outlined here #2293 (comment) |
Yeah compiling VS Code (or any other node app) is no problem in WSL. Node, npm, tsc, gulp, and the rest of the build bits have worked on WSL for quite some time. You can even remote debug VS Code (the The most constructive thing that can be done here is to reach out to friendly contacts on the Electron / libuv teams, if you have any. Electron#6722 was opened by someone once, but I have been loath to comment over there (for a year); because, asking them to chase known WSL problems is kind of cruel. Again, the |
I'm aware this is not supported yet but obviously a lot of work has been done around it so I thought I'd raise this as it's SOOOO close now! With dbus and various other issues out of the way, the only remaining fatal issue seems to be the check failed issue shown below. I've also raised this in the VS Code github as I am not sure which team it relates to?
Steps to Reproduce:
LIBGL_ALWAYS_INDIRECT=1 DISPLAY=:0 code-insiders --verbose
Reproduces without extensions: Yes
Stack:
The text was updated successfully, but these errors were encountered: