VSCode remote connection to Synology NAS

Out of the blocks if you try a remote connection from VSCode using ssh to a Synology NAS (DSM 7 in my case) you’ll see the unhelpful warning:

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

And after long timeouts and even though it says ‘connected’ there is not much in terms of it actually working …for example, no terminal prompt and unable to open a folder.

Try enabling port forwarding on sshd on the synology…

From another terminal session remote to the NAS and edit the sshd config file at /etc/ssh/sshd_config. Remember you need sudo to edit that file.

Find the line
AllowTcpForwarding no
And change to
AllowTcpForwarding yes

Save the file and restart the daemon:
sudo systemctl restart sshd.service

Now on re-trying the remote connection it appears better (seems to go quicker) but it still gives same warning popup. A terminal session now works but the prompt looks odd: “sh-4.4$” …thats some sort of default and not the usual “user@host$” you might expect. Its due to env variable PS1=’\s-\v\$ ‘ but why? if when connecting directly (i..e ssh from a command prompt) then it works better? Somewhere there’s a bash_profile (or some other login script) thats setting this.

  • /etc/profile sets PS1 to “`hostname`> “
  • that script invokes /etc.defaults/.bashrc_profile which sets PS1 to ‘[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]\$ ‘ which is what we want and seen on simple ssh…so not happening in vscode, or is being overridden

Leave a comment