No hate towards @mietz, this can be achieved with the SSH & Terminal addon that many likely already have.
Here’s the required configuration parameters (everything else is à votre gout)
Visual Studio Code Remote - SSH
Some customization is required prior to being able to connect to your Home Assistant install with Visual Studio Code. The following configuration will aid in setting up VSCode Remote - SSH:
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?
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
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…
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.
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
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.