Visual Studio 2019 remote connection issue on Verdin iMX8M Mini

I’m following the Getting Started Guide (Visual Studio Extension For Torizon).

I have sucessfully:

  1. Loaded Torizon Connected to a Wifi Network with the iMX8
  2. SSH’d into the iMX8
  3. Installed VisualStudio, Docker, and the Torizon Extension
  4. Board shows up Torizon devices (Toradex Verdin iMX8M Mini WB on Verdin Development Board(06894975))
  5. I downloaded base and sdk containers
  6. when I go to build I get “Could not connect to remote system” error

Microsoft Visual Studio Enterprise 2019
Version 16.9.12
Toradex Torizon C/C++ support 1.4.0

What’s interesting is it’s a similar error to what I get when I try TightVNC. “the target machine actively refused it”
Do I have to have a certain container open, or set the expose the API on a certain port?

Log file
11/8/2021 2:37:10 PM
Recoverable
System.AggregateException: One or more errors occurred. —> liblinux.RemoteConnectivityException: Could not connect to the remote system or the connection was lost. —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)
at Renci.SshNet.Session.SocketConnect(String host, Int32 port)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.CreateAndConnectSession()
at Renci.SshNet.BaseClient.Connect()
at liblinux.RemoteSystemBase.ConnectCore()
— End of inner exception stack trace —
at liblinux.RemoteSystemBase.ConnectCore()
at liblinux.RemoteSystemBase.Connect(PasswordConnectionInfo passwordConnectionInfo)
at liblinux.RemoteSystemBase.Connect()
at liblinux.RemoteSystemBase.Connect(ConnectionInfo connectionInfo)
at Microsoft.VisualStudio.Linux.Package.LinuxProjectTracking.<>c__DisplayClass41_0.b__0()
at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass31_0.<b__0>d.MoveNext()
— End of inner exception stack trace —
—> (Inner Exception #0) liblinux.RemoteConnectivityException: Could not connect to the remote system or the connection was lost. —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)
at Renci.SshNet.Session.SocketConnect(String host, Int32 port)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.CreateAndConnectSession()
at Renci.SshNet.BaseClient.Connect()
at liblinux.RemoteSystemBase.ConnectCore()
— End of inner exception stack trace —
at liblinux.RemoteSystemBase.ConnectCore()
at liblinux.RemoteSystemBase.Connect(PasswordConnectionInfo passwordConnectionInfo)
at liblinux.RemoteSystemBase.Connect()
at liblinux.RemoteSystemBase.Connect(ConnectionInfo connectionInfo)
at Microsoft.VisualStudio.Linux.Package.LinuxProjectTracking.<>c__DisplayClass41_0.b__0()
at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.<>c__DisplayClass31_0.<b__0>d.MoveNext()<—

Greetings @jeffbelz,

Just to make sure I understand your setup correctly I have a couple of questions.

  • Your Verdin i.MX8M Mini is connecting to the network via WiFi, is that correct?
  • Do you have antennas attached properly to the WiFi chip on the module?
  • Do you have possibly any firewalls, network configuration, or restrictions that might prevent our VS extension from communicating with the device?

Usually the error No connection could be made because the target machine actively refused it, suggests that the device “exists” but something is preventing the communication like a firewall for example.

Something that may help is enabling the backend console as shown here: Visual Studio Extension For Torizon | Toradex Developer Center

This will provide additional logs and information on what backend calls are being made in the extension.

Best Regards,
Jeremias

Here is the log. Not much there, but maybe it’s a clue for you. Also, no fire walls. I have it connected with ethernet.

Here is some more info on the remote machine…does that look right?

Maybe one more clue. This is from the Torizon Build output:
The error is “Command ‘update’ is not recognized”

Loading application configuration…
Successfully removed connection ‘-1627503859;127.0.0.1 (username=build, port=57952, authentication=Password)’.

Verifying connection with remote system.
Successfully added connection ‘-64964326;127.0.0.1 (username=build, port=57952, authentication=Password)’.

ERROR:
Command ‘update’ is not recognized.

Error during pre-build activity.
Exception: System.Exception: Error 1 returned by connection manager.
at TorizonVSExtension.CPPSolutionManager.SetConnectionInfo(VCProject vcprj, VCConfiguration vccfg, String appconfig, Platform plat, ApplicationSDKContainerAddress addr) in C:\GitLab-Runner\builds\sAyebikf\0\rd\torizon-core\ide-plugins\vs-plugin\TorizonVSExtension\SolutionManagement\CPPSolutionManager.cs:line 1091
at TorizonVSExtension.CPPSolutionManager.<>c__DisplayClass52_0.<<BuildEvents_OnBuildProjConfigBegin>b__0>d.MoveNext() in C:\GitLab-Runner\builds\sAyebikf\0\rd\torizon-core\ide-plugins\vs-plugin\TorizonVSExtension\SolutionManagement\CPPSolutionManager.cs:line 1726

Message:Error 1 returned by connection manager.
Stack trace:

at TorizonVSExtension.CPPSolutionManager.SetConnectionInfo(VCProject vcprj, VCConfiguration vccfg, String appconfig, Platform plat, ApplicationSDKContainerAddress addr) in C:\GitLab-Runner\builds\sAyebikf\0\rd\torizon-core\ide-plugins\vs-plugin\TorizonVSExtension\SolutionManagement\CPPSolutionManager.cs:line 1091
at TorizonVSExtension.CPPSolutionManager.<>c__DisplayClass52_0.<<BuildEvents_OnBuildProjConfigBegin>b__0>d.MoveNext() in C:\GitLab-Runner\builds\sAyebikf\0\rd\torizon-core\ide-plugins\vs-plugin\TorizonVSExtension\SolutionManagement\CPPSolutionManager.cs:line 1726

On the systems that work, what was the backend port number?

Update: I setup Visual Studio Code and that worked with out an issue. Looks like it’s something in the VS extension. The one deference is VS is using arm64v8-debian_bullseye and VS code is using arm64v8-debian-no-ssh_bullseye.

Both extensions use the same backend. Perhaps Microsoft updated/changed something in VS that broke compatibility with our extension. I’ll report this for further investigation.

Best Regards,
Jeremias

They are using different platforms. VS code is using a “no-ssh” version. can Visual studio use the no-ssh too?

Update:
I uninstalled 2019 v16.9.12 and reinstalled 2019 v16.11.6. Everything works! Something in v16.9 that the extension does not like.

I uninstalled 2019 v16.9.12 and reinstalled 2019 v16.11.6.

Huh that’s odd, because I was able to reproduce your error but my setup is using V16.11.6. Wonder why V16.11.6 works in your setup, probably some weird Windows/Microsoft thing going on here.

Well glad to hear it works for you now, but I’ll still have the IDE team look into this just in case.

Best Regards,
Jeremias

Well, today it’s not working again I get:
Error calling ApplicationsLoad: Unable to connect to the remote server

It’s a little different . I’m going to install 16.4 and see what happens

Well, v16.4 does not have the option for the extension, then I tried installing v16.7 and the extension insists the Visual C++ for Linux was not installed…but it was because I installed it twice. So then I put v16.11 back on and it worked once then stopped working again. I can only conclude that the extensions is very bug-y and it pains me that I have to use VS code, but that’s what I’ll have to do. If Toradex fixes the issues with the extension let me know, but I’m spent on the Visual Studio route. The fix is just not to use it.

I’m sorry about your experience, we have our extensions team looking into this now. Hopefully a fix will follow soon, assuming the underlying issue isn’t too complex.

Best Regards,
Jeremias

There is now a fix available for our VS extension for this issue. The fix is available via v1.5.147 of the early access variant of our extension. I confirmed that it appears to solve this issue for VS V16.11.X.

Best Regards,
Jeremias

Hey, looks good! You made my day

Glad we could get this fixed! Thank you for reporting it.