Visual Studio Code IDE Extension for Torizon : SSH tunnel error 539

Hi,

I setup up the Visual Studio Code on linux host machine.

But while adding the verdin iMX8M module with torizon OS, the target gets added to the Devices with the following error:

Error (539) - SSH tunnel error: Could not establish session to SSH gateway

Torizon Output:

Initializing Torizon Extension
Checking Moses ...
Backend local instance running on port 5000
Torizon Backend version 1.0 API version: 1.0
Checking Docker ...
Docker version 20.10.6 build 8728dd2
Trying connect to Toradex Verdin iMX8M Mini WB on Verdin Development Board(01234567)
ARM emulation enabled.
Toradex Verdin iMX8M Mini WB on Verdin Development Board(01234567) not reached
Torizon: all devices refreshed
Torizon: unreachable devices

Torizon IDE backedn terminal:

Torizon IDE backend Terminal:

Serving on http://localhost:5000
INFO:root:REST -> /api/version
INFO:root:REST <- /api/version - 200
INFO:root:REST -> /api/version/docker
INFO:root:REST <- /api/version/docker - 200
INFO:root:REST -> /api/setup/enableemulation
INFO:root:REST -> /api/devices
INFO:root:REST <- /api/devices - 200
INFO:root:REST -> /api/devices/01234567/images
INFO:root:SSH - Creating tunnel to 01234567
2021-05-10 11:21:36,529| ERROR   | Could not open connection to gateway
ERROR:sshtunnel.SSHTunnelForwarder:Could not open connection to gateway
ERROR:root:Error: 539 SSH tunnel error. SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Exception: SSH tunnel error: Could not establish session to SSH gateway
ERROR:root:Could not establish session to SSH gateway
INFO:root:REST <- /api/devices/01234567/images - 539
INFO:root:REST -> /api/devices/01234567/images

But connecting over ssh does work:

$ ssh torizon@192.168.1.100
torizon@192.168.1.100's password: 
verdin-imx8mm-01234567:~$ uname -a
Linux verdin-imx8mm-01234567 5.4.91-rt50-5.2.0-devel+git.3ae7ec26415b #1-TorizonCore SMP PREEMPT_RT Mon Apr 12 08:35:57 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

With another host machine (Ubuntu 20) the connection with the visual studio code extension does work.

Any ideas how I can resolve this?

Greetings @felix_eos,

Some questions for you.

Are you running the same version of the extension and Visual Studio Code on both Ubuntu machines?

Also when you add a device connection in VS Code are you adding it via IP or via hostname? Depending on network setup and everything this can have different results.

Best Regards,
Jeremias

Yes i use the same version of the extension (V1.2.1) and Visual Studio Code (V1.56) ( I tried today with Visual Studio Code V1.56 on Ubunut 18.04 again with the same issue)

I add the device by local IP on 2 different routers. I am quit sure something on my host developer machine is the problem, but I don’t know what.

Some ideas off the top of my head. Can you try removing the device and adding it via hostname instead of IP? On some setups this can make a difference.

Also perhaps you can compare the SSH configurations between your Ubuntu 18 machine and your Ubuntu 20 machine.

Best Regards,
Jeremias

Hi @felix_eos, what network interfaces do you have in each build host. I think we have an issue related to mDNS where something like this will happen. In my case I have two interfaces, and I have to manually specify the hostname in the INFO pane to get the connections to succeed. It may require a restart of VSCode after setting the hostname, I don’t recall specifically. I’ve attached a screenshot which will hopefully clarify.

Please let us know if that works for you.

Drew
alt text

As I have had the same problem, at the vs code info section (host name position @drew.tx has mentioned) I have put the hostname in the following format:

hostname.local

This has solved the issue. This is in accordance with the Toradex’s SSH Connection Tutorial.

Thank you for the feedback Marcus, good to know this method works for others as well.

Best Regards,
Jeremias