visual-studio-codevscode-remote

Could not establish connection to "hostname": The VS Code Server failed to start


I looked at the similar questions to mine, and none of them seemed to fix my problem. It returns a prompt that says Could not establish connection to "hostname": The VS Code Server failed to start. When I use the command ssh pi@raspberrypi and type in my password everything seems to work.

My Computer: Windows 11

Remote Computer: Raspbian OS

The server.sh file seems to be broken, but I don't know what the file should look like:

#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#

case "$1" in
    --inspect*) INSPECT="$1"; shift;;
esac

ROOT="$(dirname "$0")"

"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" --compatibility=1.63 "$@"

and this is the log file on the remote computer:

/home/pi/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/bin/code-server: 12: /home/pi/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/bin/code-server: /home/pi/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/node: not found

Solution

  • solution :Kill VS code Server on host and reconnect maybe work