Help Center/ ModelArts/ FAQs/ Notebook (New Version)/ Failures to Access the Development Environment Through VS Code/ What Do I Do If the Connection to a Remote Development Environment Remains in "Setting up SSH Host xxx: Downloading VS Code Server locally" State for More Than 10 Minutes?
Updated on 2024-06-11 GMT+08:00

What Do I Do If the Connection to a Remote Development Environment Remains in "Setting up SSH Host xxx: Downloading VS Code Server locally" State for More Than 10 Minutes?

Symptom

Possible Cause

The local network is faulty. As a result, it takes a long time to automatically install the VS Code server remotely.

Solution

Manually install the VS Code server.

  1. Obtain the VS Code commit ID.

  2. Download the VS Code server package of the required version. Select Arm or x86 based on the CPU architecture of the development environment.

    Replace ${commitID} in the following link with the commit ID obtained in 1.

    • For Arm, download vscode-server-linux-arm64.tar.gz.

      https://update.code.visualstudio.com/commit:${commitID}/server-linux-arm64/stable

    • For x86, download vscode-server-linux-x64.tar.gz.

      https://update.code.visualstudio.com/commit:${commitID}/server-linux-x64/stable

  3. Access the remote environment.

    Switch to Terminal in VS Code.

    Run the following command in VS Code Terminal to access the remote development environment:

    ssh -tt -o StrictHostKeyChecking=no -i ${IdentityFile} ${User}@${HostName} -p ${Port}

    Parameters:

    - IdentityFile: Path to the local key

    - User: Username, for example, ma-user

    - HostName: IP address

    - Port: Port number

  4. Manually install the VS Code server.

    Run the following commands on the VS Code terminal to clear the residual data (replace ${commitID} in the commands with the commit ID obtained in 1):

    rm -rf /home/ma-user/.vscode-server/bin/${commitID}/*
    mkdir -p /home/ma-user/.vscode-server/bin/${commitID}

    Upload the VS Code server package to the development environment.

    exit
    scp -i xxx.pem -P 31205 Local path to the VS Code server package ma-user@xxx:/home/ma-user/.vscode-server/bin
    ssh -tt -o StrictHostKeyChecking=no -i ${IdentityFile} ${User}@${HostName} -p ${Port}

    Parameters:

    - IdentityFile: Path to the local key

    - User: Username, for example, ma-user

    - HostName: IP address

    - Port: Port number

    Take Arm as an example. Decompress the VS Code server package to $HOME/.vscode-server/bin. Replace ${commitID} in the command with the commit ID obtained in 1.

    cd /home/ma-user/.vscode-server/bin
    tar -zxf vscode-server-linux-arm64.tar.gz
    mv vscode-server-linux-arm64/* ${commitID}

  5. Establish the remote connection again.