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

@brandonnolet This was the information I was searching for but never found :+1: This should be marked as solution @jaddel

I’m trying to get this working and I’ve got the following config in my SSH & Terminal add-on:

authorized_keys:
  - >-
    ssh-ed25519
    KEY_GOES_HERE
password: ""
apks: []
server:
  tcp_forwarding: false
  apks: []
  sftp: true
  compatibility_mode: true
packages:
  - glibc
  - gcompat
  - libstdc++
  - curl
allow_remote_port_forwarding: true
allow_tcp_forwarding: true

I’m now getting different output in my remote VS Code, but it’s a WAITING FOR SERVER LOG. VS Code is also complaining about

The remote host may not meet VS Code Server’s prerequisites for glibc and libstdc++

I must be doing something wrong, but I’m not sure what. I can SSH to the server on port 22 (what I have set in the config). Thanks for the help!

ETA:

It looks like I’ve got this working, although, I’m not sure how:

apks:
  - gcompat libstdc++ curl grep
server:
  tcp_forwarding: false
  apks: []
  sftp: true
  compatibility_mode: true
packages:
  - glibc
  - libc
  - gcompat
  - libstdc++
  - curl
  - musl
allow_remote_port_forwarding: true
allow_tcp_forwarding: true

Thanks all. This worked for me. I was banging my head against the wall trying to figure it out last night.

The solution works for me, but although vscode connects fine, I still get the warning:

The remote host may not meet VS Code Server’s prerequisites for glibc and libstdc++

Anyone figured out how to silence the warning?

1 Like

As per October 2023 the correct way to write this config is:

authorized_keys: 
  - >- YOUR KEYS HERE
password: ""
apks:
  - gcompat
  - libstdc++
  - curl
server:
  tcp_forwarding: true
2 Likes

Hello,
I’ve managed to configure my local VS Code to use Remote SSH to connect to HA add-on.
However I’m still getting the warning on every connection:

The remote host may not meet VS Code Server’s prerequisites for glibc and libstdc++

I’ve read through these posts and tried the solutions proposed, without success.
Below is my ssh configuration for Advanced SSH & Web Terminal add-on, following distante’s proposal above.

I’ve restarted the add-on and am still getting the warning when connecting VS Code.
Do you have any suggestion to silence this warning?

Thanks in advance for your help.

username: USER
password: PASSWORD
authorized_keys:
  - >- KEYS
sftp: false
compatibility_mode: false
allow_agent_forwarding: false
allow_remote_port_forwarding: true
allow_tcp_forwarding: true
apks:
  - gcompat
  - libstdc++
  - curl
server:
  tcp_forwarding: true  // is this redundant with `allow_tcp_forwarding` above?
1 Like

Hello, i read all this thread, and test all configuration but Vscode can’t connect.
I’ve still the same error message.

Waiting for server log ...
Waiting for server log ...
Waiting for server log ...

My HA version is working on VM and is up to date.
My config for add-on Terminal & SSH

i found more log in vscode console

17:06:05.952] > Waiting for server log...
[17:06:05.984] > Waiting for server log...
[17:06:06.016] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
[17:06:06.018] > Server did not start successfully. Full server log at /root/.vscode-server/.05047486b6df5eb8d44b2ecd70ea3bdf775fd937.log >>>
> musl libc (x86_64)
> Version 1.2.4
> Dynamic Program Loader
> Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
> Warning: musl detected, skipping GLIBC check
> Error relocating /root/.vscode-server/bin/05047486b6df5eb8d44b2ecd70ea3bdf775fd937/node: fcntl64: symbol not found
> <<< End of server log

Hello, I’m facing exactly the same issue described by @xiduis15.
The issue appeared this afternoon.
I’ve been using heavily my local VS Code connecting to VS Code HA add-on via SSH, for several weeks without any issue before this afternoon.
I updated HA from 2024.1.5 to 2024.1.6 today.
I also remember clicking on a message proposing to update VS Code today.
I’m now facing the same issue described by @xiduis15.
VS Code add-on within HA works perfectly.
Advanced SSH & Web Terminal also works.
I did a full restart of HA using the option “Reboot system: Restarts the system running Home Assistant and all add-ons”. Still facing the issue.
Current configuration:

  • HA 2024.1.6.
  • Studio Code Server add-on 5.15.0.
  • Advanced SSH & Web Terminal add-on 17.0.4.
  • VS Code desktop: Version: 1.86.0 / Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937

Thanks for any help.

Hello, FYI the issue seems to be on VS Code’s side with the 1.86.0 update.

I’ve found several issues describing the same problem on VS Code’s GitHub.
See for example:

EDIT: I found the exact description of the issue here:

Watching this specific issue will let us know when it’s resolved.

For the moment the solution seems to be to downgrade VS Code to 1.85.2.
I haven’t yet tried the downgrade so can’t comment further.

Happy to report that I’ve solved the issue by:

  1. Launching my VS Code desktop version 1.86.0.
  2. Downgrading the remote-ssh extension version to 0.107 from within VS Code.
  3. Changing the ‘update mode’ setting to ‘none’ (will require a restart of VS Code).
  4. Downloading and installing version 1.85.2 of vscode.

After following these steps, I’m now able to connect my desktop VS Code (1.85.2) to VS Code HA add-on via SSH, as I used to previously.

The underlying issue remains however: a dependency on some libraries on HA add-on’s side (minimum GLIBC >= 2.28 apparently from the comments in the GitHub issues) is preventing VS Code 1.86.0 from connecting successfully over SSH.
Hoping this issue will be fixed soon…

4 Likes

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