How to connect local VSCode instance to VS Code HA Add-on via ssh?

amazing, @eugene78 ! Thanks for all the follow ups :slight_smile:

Nice, can confirm that downgrading the versions gets it working again. I took a look at the github issues and currently they’re not planning to fix it but may have misjudged how widely used it is. Luckily someone developed a workaround script for the latest versions as well. First you’ll need to add some more packages to the SSH addon:

  • nodejs
  • npm
  • make
  • g++

With those installed, save the script in one of the mounted directories like /root/share, otherwise you’ll lose it when the container restarts. All I changed was the mynode variable to /usr/bin/node. After running the script to install the npm dependencies, remote ssh with vscode 1.86 is back in business.

Even better - the new versions allow you to silence that notification about not meeting all the prerequisites.

Thx a lot @eugene78 ! it’s work great for me

Guys… Drop SSH and use this integration:

It fires up a Remote Tunnel (not Remote SSH) to connect to from your vscode or vscode.dev using your Github credentials. Works perfect! You do need to enable it after every HA restart… but hey… we’ve got automations for that :blush:

Some extra information:
Vscode Remote Tunnels

Interesting… the downside being that has to bounce through Azure instead of staying on the same LAN

I too just ran into this issue, but I’m a bit green on doing command line stuff.

I can access root/share through HA File editor addon and create the file, can you tell me how to run it?

Given that we want this file not to be deleted, I assume we have to rerun it every reboot, or can that be automated?

The install goes to /root/.vscode-server, so that should stick around while you’re using the same container including after rebooting. I think the only time you’d need to re-run it is after upgrades to the SSH addon.

Looking again now, the easiest way to run it is probably to add it to the init_commands of the addon:

/bin/bash /root/share/vscodefix.sh

On my system that still takes about a minute to run after it’s already installed, so give it some time for npm to do its thing.

That didn’t seem to work for me. Had to swap to YAML mode config as packages were failing to save and there was no field for init_commands but I think I have it right.

I can’t seem to spot anything interesting/related to the script in the addon logs either.

How would I go about just running this script manually for now, just throw it into the addons terminal?

Rebooted HA and VSCode seems to be up and running now. Cheers for the help!

1 Like

Hello, could you help me understand how using this integration would help solve the libraries issues?

The diagram on the VS Code Remote Tunnels page shows VS Code server running on the remote environment, which in my case would be my HA OS installation (installed in a VM on Proxmox).

How/why would this situation be different & better than my current configuration using the Advanced SSH & Web Terminal add-on?

Thanks for your clarifications.

It’s just easy to set up and it works with vscode.dev too (browser app / PWA). I’m not trying to sell it, just telling it’s working great and doesn’t require you to set up SSH access…

Happy to report that VS Code 1.86.1 update that was released on Feb. 8th has solved the issue, enabling again to connect to HA instance over SSH.

How to install the upgrade:

  1. Launch VS Code desktop version 1.85.2.
  2. Go to Settings and change the “update mode” setting back to ‘default’. This will require a restart of VS Code.
  3. After restarting VS Code, execute Code / Check for updates… (on Mac). This will download the 1.86.1 version and prompt another restart.
  4. After restarting again, the “Remote - SSH” extension should prompt an update to version 0.108.0. Be sure to select “auto-update” for this extension.

Note Microsoft’s position here:

We have discussed this more in the VS Code team and we have decided to allow VS Code to connect to an OS that is not supported by VS Code (no support for glibc >= 2.28) for 12 more months .
We hope this will provide the needed time for you and your companies to migrate to newer Linux distributions.

So while the issue is solved in the short term, we still need a proper solution for the longer term.

Cheers!

1 Like

I recently tried to use the SSH extension as well with the latest VSCode and and latest HA updates. The VSCode remote Server seems to need a real ps command and not the alpine shipped busybox variant.
If anyone faces some issues and sees a ps related error in the log try adding the package procps to the packages section of the ssh and terminal extension.
This made it work for me.

5 Likes

Nice, procps fixed mine again too for 1.88

Amazing, thanks so much. I was noticing ps was failing but didn’t realize it was busybox being the issue.

Yass! Nice catch! I wasn’t able to catch that in the ssh output while trying to connect. Thanks!

Same for me, the procps was the solution, full working config:

ssh:
  username: my_user
  password: ""
  authorized_keys:
    - my_key
  sftp: false
  compatibility_mode: false
  allow_agent_forwarding: false
  allow_remote_port_forwarding: true
  allow_tcp_forwarding: true
zsh: true
share_sessions: false
packages:
  - procps
init_commands: []