There is the VS Code add-on and the VS Code Remote add-on which is currently still in development.
To do VS Code SSH remote dev the remote add-on is needed.
VS Code Remote Add-on in HA Supervisor
Sure, actually all you need is to to do is add your ssh public key to the extensions config section (authorised_keys) and create a port forwarding in your router for eg. port 2222.
SSH & Web Terminal Add-on in HA Supervisor (not sure if I event need this)
It’s not needed, the VS Code remote add-on is handling this for you.
VS Code Remote extensions in VS Code
I haven’t set it up myself yet, but be aware that you want to do this on the code server you are connecting to (the vscode remte add-on). It’s probably pre configured but im not sure.
If you need to set it up this should guide you through the process.
Don’t forget, that the code server it self is running on the same network / docker network as Home-assistant and that it can connect locally even though you connect to the remote add-on remotely.
Any Network port mappings that your had to setup
Port forward the ssh port you configured in the vs code remote add-on. Make sure to use ssh key authentication only.
This works for every SSH Dev IDE I have EXCEPT VS Code
This is not natively supported on Hassos, therefor you need to use the remote add-on created by Frank.
Have a look at this for a better understanding of the ssh remote dev solution by vscode.
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…