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
Can't connect to Linux Target using Connection Manager #132
Comments
Since your target looks like its not a x86/64, I wonder if your issue is similar to the arm8 one. #110 (comment) |
I have similar issue: The same OS with X Windows works fine. Is their any log produced by "Connect to Remote System"? Thank you. |
The same here - trying to connect to HP ThinPro 6.1 (which is their distro of Ubuntu 14.04.3 LTS, AFAIK). WinSCP & PuTTY both work with the IP:PORT + account info (I am using Authentication type = Password). VS info: |
I have similar issue. PuTTY works fine. devenv_exe_linux_connection_error_104344_080217.log liblinux.Ssh.Common.SshException: Channel was closed. |
I resolve this issue after install OpenSSH with SFTP support (from Dropbear). #!/bin/bash if [ "$1" == "-m" ] For more info see liblinux.dll DistributionId.GetSystemHardwarePlatform method |
I am also having this problem. x893, I am happy that you solved it. However your explination of how you fixed it is a bit beyond my comprehension. Can you please go into a bit more detail? How/where did you install OpenSSH (I downloaded/extracted the openssh-7.5.tar.gz file but don't see any executables or applications in it) Is there a special version of OpenSSH that has SFTP support (I didn't see any)? How do I get Visual Studio to use OpenSSH once it is installed? Where/how do I rename the uname -m response? I would be very grateful if you could help me with this. Thank you in advance. |
@jazzatar @gvd1024 @PaloMraz @gvd1024 Please use the package manager of your Linux distribution for installing ssh support on your Linux machine, e.g. |
I have a similar issue. I have verified openssh-sftp-server is installed. |
@rblinton could you please report the information related to the remote machine so that would allow us to reproduce the problem? e.g. distro name and version, list of packages installed along with version, thanks. |
You guys have a conflict with port 22. I solved the problem using this: https://superuser.com/questions/1123552/how-to-ssh-into-wsl Ubuntu 16.04.4 (Linux version 4.4.0-43-Microsoft) |
@jazzatar @rblinton @0x79696e67 I am also facing the same issue in VS2017 where I am able to connect to Linux Target via putty, other clients. But, when I try to connect target using CrossPlatform connection manager in VC2017, redbox appears on the host label and I get the following logs . Has this issue been solved ? Please point me to the right answer thread as I am not able to resolve this. Logs :- |
@jdsarode could you please provide more information about your setup? For example, if you are trying to connect to a Debian-like distribution on a remote Linux box (non WSL), please check whether you installed the package "openssh-sftp-server" with apt. |
@lukka :- I think there has to be "openssh-sftp-server" package as I am able to log in to the system using other ssh applications such as putty, tera term. |
@jdsarode please run 'dpkg -l | grep sftp' and report the output of the command. Then we could verify whether that package is missing. |
@lukka - after investigating my system, I see that openssh-sftp-server package is NOT included in the system. Would it mandatory from system side to add this support ? OR is there any other way that we can do this on MSVC side. |
@jdsarode the "sftp over ssh" support must be available on the Linux machine, it is an extension of the SSH protocol. It can be either that:
Which distribution of Linux are you using? |
@lukka confirm, got same issue here. FileZilla, putty and TerraTerm authenticate just fine. Tried using docker and on a remote machine, same effect. To Reproduce:Grab a container from my dockerHub docker run -p 2222:2222 -d clumsypilot/dotnetdebug:vs2017_connect_issue You will find that you can connect using username root and pwd Docker! with putty, but not with VS2017 See the repo for a private key (can also be used) and for the docker files. It's openssh with mostly default settings |
@VladimirAkopyan |
@lukka my bad, I misunderstood openSSH docs, and thoughts that |
@VladimirAkopyan we need to improve our error message indeed. |
Yep, the issue is gone now |
@lukka Hello, I still have this problem, would you please help me? Thank you. My environment is: I have checked the sftp in sshd_config, and it's enabled I think. # override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server Where I can get more logs for this error? I chcked Aug 13 11:07:57 chengdudev245 sshd[3040]: Received disconnect from 10.0.2.2 port 50960:11: Connection terminated by the client.
Aug 13 11:07:57 chengdudev245 sshd[3040]: Disconnected from 10.0.2.2 port 50960
Aug 13 11:07:57 chengdudev245 sshd[3032]: pam_unix(sshd:session): session closed for user hzhao
Aug 13 11:08:14 chengdudev245 sshd[3079]: Accepted password for hzhao from 10.0.2.2 port 50995 ssh2
Aug 13 11:08:14 chengdudev245 sshd[3083]: Accepted password for hzhao from 10.0.2.2 port 50996 ssh2
Aug 13 11:08:14 chengdudev245 sshd[3079]: pam_unix(sshd:session): session opened for user hzhao by (uid=0)
Aug 13 11:08:14 chengdudev245 sshd[3083]: pam_unix(sshd:session): session opened for user hzhao by (uid=0)
Aug 13 11:10:23 chengdudev245 sudo: hzhao : TTY=pts/1 ; PWD=/home/hzhao ; USER=root ; COMMAND=/bin/vim /etc/ssh/sshd_config
Aug 13 11:12:06 chengdudev245 sshd[3087]: Received disconnect from 10.0.2.2 port 50995:11: Connection terminated by the client.
Aug 13 11:12:06 chengdudev245 sshd[3087]: Disconnected from 10.0.2.2 port 50995
Aug 13 11:12:06 chengdudev245 sshd[3079]: pam_unix(sshd:session): session closed for user hzhao |
@lukka Sorry for disturbing. No need to investigate it now. It's caused by one of our system setting. I don't know the reason at this moment, but when I comment out our specified setting in .bashrc, it works. |
@jainyzau thanks for the report. |
I have the same problem. and the following for Visual Studio: (only one line) That makes me believe that Visual Studio does something wrong. |
I set sshd log level to maximum (DEBUG3) and here is the result: |
Same issue, all ssh clients work except visual studio VS version: 15.8.5 |
I have resolved my issue but with some trickery:
|
Hi, we are working on adding additional logging specially for SSH, and we'll be sure we log that here, please let me know if there are any issues here, and I'd happily reactivate and look into it, we are trying to get the issue list number down, so tentatively closing |
If anyone stumbles across that issue again:
|
Encountered this issue using both Visual Studio 2019 (and 2017). Could not not connect to Ubuntu 18.04 running in Hyper-V (created using Microsoft provided image). Finally got it to work by disabling Pam authentication, and enabling password authentication: sudo nano /etc/ssh/sshd_config PasswordAuthentication yes Figured this out by enabling DEBUG logging in sshd_config, then using the following command to view messages: sudo journalctl -u ssh Log entries showed ssh authentication working, but PAM authentication failing. |
@lukka Sorry for late reply. I missed the notifications. I'm now using 'rsync' to sync source code to Linux box, and it works great. One problem is that the 'rsync' shipped with VS2017 can't handle symbol links. We have several symbol links in git repo, when copying source code from Windows to Linux, these symbol links always block copying more files and thus can't build. A workaround is we can remove these symbol links in Windows, and create them later before building by configuring 'remotePrebuildCommand'. |
@jainyzau thanks a lot for the feedback. Please create a ticket on Developer Community suggesting that we should deal properly with file system links. Thanks a lot for your support! |
@lukka Sorry for late reply. I have just created a ticket in Developer Community. |
I had the same problem. It occurred that 'MaxSession' setting in the target Linux machine' sshd_config was set to 1. Setting it to 10 fixed the issue. |
@pdoykov thanks for letting us know. You can always create a ticket or a suggestion on developercommunity to ask for support in case you need it, thanks! |
Has anyone been able to get this to work on YOCTO? I've attempted most answers above. I consistently get the same error in "devenv_exe_linux_correction_error": liblinux.Ssh.Common.SshException: Channel was closed. |
Hi @aaastanciu, Adding Tested with yocto Dunfell 3.1.9 |
Just happened to have the same issue with Visual Studio 2022 and Azure Linux VM. Was able to ssh into it with everything but VS. I checked the ssh logs on the server and noticed this: So updating the |
A brief description
Trying to add a remote SSH connection to connection manager in VS2017 fails.
Expected results
Connection is added successfully
Actual results (with build output window contents if applicable)
Red box appears around IP address in "Connect to Remote System" window
VC++ version, Linux system name and version, GCC/GDB/gdbserver version, CPU arch, etc. If you are using a specific version of Linux on an embedded board, we might need to know about it to get a repro on similar hardware
Microsoft Visual Studio Professional 2017
Version 15.1 (26403.3) Release
VisualStudio.15.Release/15.1.0+26403.3
Microsoft .NET Framework
Version 4.6.01055
Installed Version: Professional
Visual C++ 2017 00369-60000-00001-AA090
Microsoft Visual C++ 2017
Visual C++ for Linux Development 1.0.6
Visual C++ for Linux Development
Target Info
Linux AB3SN 3.12.37-rt51 #1 SMP Wed Apr 12 11:11:26 PDT 2017 ppc64 GNU/Linux
OpenSSH_7.1p2, OpenSSL 1.0.1i 6 Aug 2014
Steps required to reproduce the error
Go to Tools menu, select Options, Select Cross Platform > Connection Manager from list on Left. Click "Add Button" and supplied all information
Required packages and commands to install
Additional notes
I am able to connect using WinSCP with SCP and SFTP, as well as Putty. All with the same account and IP information supplied in Visual Studio.
I want to note I am able to set up a connection to an x64 Fedora System successfully. I've copied the sshd_config from the working system to the target that is not working as a troubleshooting step.
Thanks for help - I'm excited to get this toolchain working as Visual Studio is my preferred IDE!
The text was updated successfully, but these errors were encountered: