-
Notifications
You must be signed in to change notification settings - Fork 34
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
Adding WSL in Visual Studio fails with "Failed to archive sysroot [...]" #284
Comments
@patrikhuber could you ensure you have the zip tool on your Ubuntu? Just install it with apt if it is missing. Then report back if the problem persists. |
Hi @lukka, I can confirm that |
Okay, this is something very sneaky: The instructions tell you to start the ssh daemon in WSL, on the default port. And it starts, without any warning or error. But: Windows 10 has actually already an ssh daemon running (and on port 22)! This caught me by surprise. So when you (or VS) tries to do "ssh localhost", it connects to the ssh daemon running on Windows 10 (!!!), and not the one running in WSL. The solution is to run the ssh daemon inside WSL on a different port, and then use that port in the VS configuration dialog. Then, everything works. This is not trivial to find out (who would have guessed that Windows runs an ssh daemon by default, and on port 22?). And the VS error message is also very bad and tells you not much about what's going on. I would suggest that Microsoft improves the error messages and documentation on this. Pretty sure I wouldn't be the only one to run into this. I would also question the fact that Windows 10 runs an ssh daemon by default on the system. I am not a security expert, but this smells to me like something one shouldn't be doing. |
It's discussed in the comments to the original blog and if you follow the links you'll see that this workaround has been required for quite some time. |
@stanthomas Forgive me for not reading all the comments in that blog post, there are quite a number of them (and most of them irrelevant). In my opinion this "gotcha" deserves a strong mentioning somewhere in the documentation/blog post - as you can see I am not the only one running into this. Sure, the SU post describes exactly the issue & the solution - hindsight is always 20/20. :-) |
@patrikhuber Hey, I'm not sniping. Just joining you in suggesting Marc updates his blog. |
@stanthomas Ok cool! :-) 👍 |
@patrikhuber unfortunately it's difficult to provide diagnostics because there's not much information available, we can get the identity of the SSH server but that does not say much, and in the end it is presented to us as authentication failure, which is correct. We could see if port 22 is used locally and maybe find the process or service owning it, but that would be hacky |
@itodirel "An error has occured. Failed to archive sysroot [...]" is not an authentication failure though. In hindsight the error is obvious - VSLinux has logged into Windows 10 ssh and executed its "zip" command there, which obviously fails (instead of connecting to the WSL bash, where that command would work). Deducing from this error message that another SSH client is running (from Windows 10, running by default, which I as a user never set up or heard about before!) is quite a stretch. A huge stretch in my opinion. That is why I am saying if it's not possible to improve the situation, then at least the documentation should mention this big gotcha clearly (in a prominent place in my opinion). You know, I've painfully found out and fixed it, so at this point I don't care anymore - I just care for the poor users that come after me and have to figure this out on their own too. |
If the case for when the connection failed or if zip is missing, we already made a fix to tell you exactly why, that one is done, but not yet in one of the currently published Previews |
same issue in centos 6/7. |
It succeed in Ubuntu 16.04, but after upgraded to 18.04 it failed. Zip exists. vs version: 15.7.6 |
can you attach the log? |
|
Hi, I believe this should be now fixed in the latest release, can you try it? |
I'm now using VS 2019 Preview 1.1. It doesn't report this error anymore, but now it sometimes synchronizes the wrong headers... Maybe it's a new issue. |
@Berrysoft could you provide us with a repro? please open a separate issue for the problem you are seeing |
Seems that it works now, and I needn't open a new issue. |
Hi!
I've filed this over at microsoft/WSL/issues/3124 because I wasn't aware of this repository - but I just found it, and I think the issue is a better fit here!
I'm following the instructions here: https://blogs.msdn.microsoft.com/vcblog/2017/02/08/targeting-windows-subsystem-for-linux-from-visual-studio/ to the point.
When going to "Tools > Options > Cross Platform > Connection Manager", entering the details, and clicking "Connect", it results in the following error:
The log file contains the following:
My system:
Windows build number: Microsoft Windows [Version 10.0.16299.402]
WSL installed today (Ubuntu) from Microsoft Store; then did
apt update
&apt upgrade
, addedubuntu-tool-chain-r
repo, installedg++-7
andg++
. (and then the packages from https://blogs.msdn.microsoft.com/vcblog/2017/02/08/targeting-windows-subsystem-for-linux-from-visual-studio/).VS 2017 15.7.0 Preview 4.0 (very latest)
The text was updated successfully, but these errors were encountered: