Help Center/ ModelArts/ Troubleshooting/ DevEnviron/ Failures to Access the Development Environment Through VS Code/ Instance Directory in VS Code Does Not Match That on the Cloud When VS Code Is Used to Connect to an Instance
Updated on 2024-12-30 GMT+08:00

Instance Directory in VS Code Does Not Match That on the Cloud When VS Code Is Used to Connect to an Instance

Symptom

When a user uses VS Code to connect to an instance, the instance directory in VS Code does not match that on the cloud.

Possible Causes

The instance connection is incorrect. The possible cause is that the configuration file is not properly written.

Solution

  1. Check the .ssh configuration file (generally in the C:\Users\{User}\.ssh\config directory) and check whether each group of configuration is standard. Host must be placed in the first line of each group of configuration as the unique ID.

    As shown in the following figure, Host is placed in the last line of the first group of configuration. The user wants to connect to the Host ModelArts-Note-BmjiN instance. However, the SSH connection identifies and connects to the Host ModelArts-Note-wZc6s instance based on the Host field.

  2. Update the configurations according to the standard format of ssh-config. Host is the unique ID of each group of configuration. It is mandatory and must be placed in the first line of the configuration file.
    Host ModelArts-notebook-xxx
    HostName authoring-ssh-modelarts-example.huawei.com
    Port 31215
    User ma-user
    IdentityFile c:\Users\xxx\KeyPair-xxx.pem
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
    ForwardAgent yes