Linux Login Command Unable to Read Config Index -

Remote Evolution Tips and Tricks

This article covers troubleshooting tips and tricks for each of the Visual Studio Code Remote Development extensions. See the SSH, Containers, and WSL articles for details on setting up and working with each specific extension. Or endeavor the introductory Tutorials to help get yous running quickly in a remote environs.

For tips and questions about GitHub Codespaces, see the GitHub Codespaces documentation.

SSH tips

SSH is powerful and flexible, but this likewise adds some setup complexity. This department includes some tips and tricks for getting the Remote - SSH extension upwards and running in different environments.

Configuring key based authentication

SSH public key authentication is a convenient, high security authentication method that combines a local "individual" cardinal with a "public" primal that you associate with your user account on an SSH host. This section volition walk you through how to generate these keys and add together them to a host.

Tip: PuTTY for Windows is not a supported client, but you can convert your PuTTYGen keys.

Quick start: Using SSH keys

To gear up SSH primal based authentication for your remote host. Kickoff we'll create a key pair and then copy the public key to the host.

Create your local SSH key pair

Check to see if you already have an SSH key on your local automobile. This is typically located at ~/.ssh/id_rsa.pub on macOS / Linux, and the .ssh directory in your user profile folder on Windows (for instance C:\Users\your-user\.ssh\id_rsa.pub).

If you practise not have a key, run the post-obit command in a local terminal / PowerShell to generate an SSH key pair:

                      ssh-keygen -t rsa -b 4096                  

Tip: Don't take ssh-keygen? Install a supported SSH client.

Qualify your macOS or Linux motorcar to connect

Run one of the following commands, in a local final window replacing user and host name equally advisable to copy your local public central to the SSH host.

  • Connecting to a macOS or Linux SSH host:

                                  export                                  USER_AT_HOST=                "your-user-proper noun-on-host@hostname"                export                                  PUBKEYPATH=                "                $HOME                /.ssh/id_rsa.pub"                ssh-copy-id -i                                "                $PUBKEYPATH                "                                                "                $USER_AT_HOST                "                          
  • Connecting to a Windows SSH host:

                                  consign                                  USER_AT_HOST=                "your-user-proper name-on-host@hostname"                export                                  PUBKEYPATH=                "                $Home                /.ssh/id_rsa.pub"                ssh                                $USER_AT_HOST                                                "powershell New-Detail -Force -ItemType Directory -Path                                \"\$                HOME                \\                .ssh                \"                ; Add-Content -Force -Path                                \"\$                Dwelling house                \\                .ssh                \\                authorized_keys                \"                                  -Value '$(tr -d '\n\r'                                <                                  "                $PUBKEYPATH                ")'"                          

    You may want to validate that the authorized_key file in the .ssh folder for your remote user on the SSH host is owned by you and no other user has permission to access it. See the OpenSSH wiki for details.

Authorize your Windows machine to connect

Run i of the post-obit commands, in a local PowerShell window replacing user and host name equally appropriate to copy your local public primal to the SSH host.

  • Connecting to a macOS or Linux SSH host:

                                  $                USER_AT_HOST                =                "your-user-proper name-on-host@hostname"                $                PUBKEYPATH                =                "                $                HOME\.ssh\id_rsa.pub"                $                pubKey                =                (                Become-Content                                                "                $                PUBKEYPATH                "                                  |                                Out-Cord                );                                  ssh                                "                $                USER_AT_HOST                "                                                "mkdir -p ~/.ssh && chmod 700 ~/.ssh && repeat '                ${                pubKey                }                ' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"                          
  • Connecting to a Windows SSH host:

                                  $                USER_AT_HOST                =                "your-user-name-on-host@hostname"                $                PUBKEYPATH                =                "                $                Home\.ssh\id_rsa.pub"                Get-Content                                                "                $                PUBKEYPATH                "                                  |                                Out-String                                  | ssh                                $                USER_AT_HOST                                                "powershell                                `"                New-Detail -Force -ItemType Directory -Path                                `"`$                HOME\.ssh                `"                ; Add together-Content -Strength -Path                                `"`$                HOME\.ssh\authorized_keys                `"                                                `"                "                          

    Validate that the authorized_key file in the .ssh folder for your remote user on the SSH host is owned by you and no other user has permission to access information technology. Encounter the OpenSSH wiki for details.

Improving your security with a dedicated cardinal

While using a single SSH cardinal across all your SSH hosts tin be convenient, if anyone gains access to your private key, they will have access to all of your hosts besides. You lot tin can prevent this by creating a dissever SSH key for your development hosts. Just follow these steps:

  1. Generate a separate SSH cardinal in a different file.

    macOS / Linux: Run the following command in a local terminal:

                                  ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-remote-ssh                          

    Windows: Run the following command in a local PowerShell:

                                  ssh-keygen -t rsa -b                                4096                                                -f                                                "                $                Dwelling\.ssh\id_rsa-remote-ssh"                          
  2. Follow the aforementioned steps in the quick first to qualify the key on the SSH host, but set the PUBKEYPATH to the id_rsa-remote-ssh.pub file instead.

  3. In VS Code, run Remote-SSH: Open Configuration File... in the Command Palette (F1), select an SSH config file, and add (or modify) a host entry as follows:

                                  Host name-of-ssh-host-here                                                User your-user-name-on-host                                                HostName host-fqdn-or-ip-goes-hither                                                IdentityFile ~/.ssh/id_rsa-remote-ssh                          

    Tip: You lot can use / for Windows paths as well. If you use \ you lot will need to use two slashes. For example, C:\\path\\to\\my\\id_rsa.

Reusing a key generated in PuTTYGen

If you lot used PuTTYGen to fix SSH public primal hallmark for the host you are connecting to, you need to convert your private cardinal and then that other SSH clients can use information technology. To do this:

  1. Open PuTTYGen locally and load the private key you want to catechumen.

  2. Select Conversions > Consign OpenSSH fundamental from the awarding menu. Save the converted key to a local location nether the.ssh directory in your user profile binder (for case C:\Users\youruser\.ssh).

  3. Validate that this new local file is endemic by y'all and no other user has permissions to admission information technology.

  4. In VS Code, run Remote-SSH: Open Configuration File... in the Command Palette (F1), select the SSH config file y'all want to modify, and add (or change) a host entry in the config file as follows to point to the file:

                                  Host name-of-ssh-host-here                                                User your-user-name-on-host                                                HostName host-fqdn-or-ip-goes-here                                                IdentityFile ~/.ssh/exported-keyfile-from-putty                          

Improving security on multi-user servers

The Remote - SSH extension installs and maintains the "VS Lawmaking Server". The server is started with a randomly generated key, and any new connection to the server needs to provide the key. The cardinal is stored on the remote's disk, readable only by the current user. There is i HTTP path that is available without hallmark at /version.

By default, the server listens to localhost on a random TCP port that is and then forwarded to your local motorcar. If you are connecting to a Linux or macOS host, you can switch to using Unix sockets that are locked downward to a particular user. This socket is then forwarded instead of the port.

Note: This setting disables connection multiplexing then configuring public cardinal authentication is recommended.

To configure it:

  1. Ensure you have a local OpenSSH 6.vii+ SSH customer on Windows, macOS, or Linux and an OpenSSH six.vii+ Linux or macOS Host (Windows does not support this mode).

  2. Switch Remote - SSH into socket way past enabling Remote.SSH: Remote Server Listen On Socket in your local VS Lawmaking User settings.

    Listen on socket VS Code setting

  3. If you've already connected to the SSH Host, select Remote-SSH: Impale VS Code Server on Host... from the Command Palette (F1) so the setting takes consequence.

If you come across an fault when connecting, y'all may need to enable socket forwarding on your SSH Host's sshd config. To practice and so:

  1. Open /etc/ssh/sshd_config in a text editor (like half-dozen, nano, or pico) on the SSH host (not locally).
  2. Add the setting AllowStreamLocalForwarding yes.
  3. Restart the SSH server. (On Ubuntu, run sudo systemctl restart sshd.).
  4. Retry.

Troubleshooting hanging or failing connections

If you are running into issues with VS Code hanging while trying to connect (and potentially timing out), at that place are a few things you lot can do to try to resolve the issue.

General troubleshooting: Remove the server

One command helpful to troubleshoot a variety of Remote-SSH issues is Remote-SSH: Kill VS Code Server on Host. This will remove the server, which tin can set a wide range of issues and mistake messages you may run into, such as "Could not found connection to server_name: The VS Code Server failed to get-go."

See if VS Code is waiting on a prompt

Enable the remote.SSH.showLoginTerminal setting in VS Lawmaking and retry. If you are prompted to input a password or token, run into Enabling alternate SSH hallmark methods for details on reducing the frequency of prompts.

If you are still having problem, set up the post-obit backdrop in settings.json and retry:

                      "remote.SSH.showLoginTerminal"            :                        true            ,            "remote.SSH.useLocalServer"            :                        imitation                  

Work effectually a issues with some versions of Windows OpenSSH server

Due to a problems in sure versions of OpenSSH server for Windows, the default check to determine if the host is running Windows may not work properly. This does not occur with OpenSSH server that ships with Windows 1909 and below.

Fortunately, y'all can piece of work around this problem past specifically telling VS Lawmaking if your SSH host is running Windows by adding the following to settings.json:

                      "remote.SSH.useLocalServer"            :                        false                  

You can also force VS Code to identify a item host as Windows using the following property:

                      "remote.SSH.remotePlatform"            : {                                    "host-in-ssh-config-or-fqdn"            :                        "windows"            }                  

A set up has been merged then this problem should exist resolved in a version of the server greater than viii.1.0.0.

Enable TCP Forwarding on the remote host

Remote - SSH extension makes use of an SSH tunnel to facilitate communication with the host. In some cases, this may be disabled on your SSH server. To run across if this is the problem, open the Remote - SSH category in the output window and check for the post-obit bulletin:

                      open failed: administratively prohibited: open failed                              

If you exercise meet that message, follow these steps to update your SSH server's sshd config:

  1. Open up /etc/ssh/sshd_config or C:\ProgramData\ssh\sshd_config in a text editor (like Vim, nano, Pico, or Notepad) on the SSH host (not locally).
  2. Add the setting AllowTcpForwarding yes.
  3. Restart the SSH server. (On Ubuntu, run sudo systemctl restart sshd. On Windows, in an admin PowerShell run, Restart-Service sshd).
  4. Retry.

Set up the ProxyCommand parameter in your SSH config file

If you are backside a proxy and are unable to connect to your SSH host, you lot may need to use the ProxyCommand parameter for your host in a local SSH config file. Y'all tin read this SSH ProxyCommand article for an example of its utilise.

Ensure the remote machine has net access

The remote machine must accept internet admission to be able to download the VS Code Server and extensions from the Marketplace. See the FAQ for details on connectivity requirements.

Set up HTTP_PROXY / HTTPS_PROXY on the remote host

If your remote host is backside a proxy, yous may demand to set up the HTTP_PROXY or HTTPS_PROXY environment variable on the SSH host. Open your ~/.bashrc file add together the following (replacing proxy.fqdn.or.ip:3128 with the advisable hostname / IP and port):

                      export                          HTTP_PROXY=http://proxy.fqdn.or.ip:3128            export                          HTTPS_PROXY=            $HTTP_PROXY            # Or if an authenticated proxy            export                          HTTP_PROXY=http://username:countersign@proxy.fqdn.or.ip:3128            export                          HTTPS_PROXY=            $HTTP_PROXY                  

Work around /tmp mounted with noexec

Some remote servers are fix to disallow executing scripts from /tmp. VS Lawmaking writes its install script to the organisation temp directory and tries to execute it from in that location. You can piece of work with your arrangement ambassador to determine whether this can exist worked around.

Cheque whether a different shell is launched during install

Some users launch a different beat from their .bash_profile or other startup script on their SSH host considering they desire to employ a different shell than the default. This tin can break VS Lawmaking's remote server install script and isn't recommended. Instead, use chsh to change your default shell on the remote machine.

Connecting to systems that dynamically assign machines per connection

Some systems will dynamically route an SSH connection to i node from a cluster each time an SSH connectedness is made. This is an issue for VS Code because it makes 2 connections to open a remote window: the commencement to install or commencement the VS Lawmaking Server (or find an already running instance) and the second to create the SSH port tunnel that VS Lawmaking uses to talk to the server. If VS Lawmaking is routed to a different machine when it creates the 2nd connection, it won't be able to talk to the VS Code server.

One workaround for this is to use the ControlMaster option in OpenSSH (macOS/Linux clients only), described in Enabling alternate SSH authentication methods, then that VS Lawmaking'south two connections will be multiplexed through a unmarried SSH connection to the aforementioned node.

Contact your system administrator for configuration help

SSH is a very flexible protocol and supports many configurations. If you see other errors, in either the login terminal or the Remote-SSH output window, they could be due to a missing setting.

Contact your system administrator for data about the required settings for your SSH host and client. Specific control-line arguments for connecting to your SSH host can be added to an SSH config file.

To access your config file, run Remote-SSH: Open Configuration File... in the Command Palette (F1). Yous can and so work with your admin to add the necessary settings.

Enabling alternate SSH authentication methods

If y'all are connecting to an SSH remote host and are either:

  • Connecting with two-factor authentication
  • Using password authentication
  • Using an SSH key with a passphrase when the SSH Agent is non running or accessible

then VS Lawmaking should automatically prompt y'all to enter needed data. If you do not see the prompt, enable the remote.SSH.showLoginTerminal setting in VS Lawmaking. This setting displays the terminal whenever VS Code runs an SSH command. You can and then enter your authentication code, password, or passphrase when the terminal appears.

If you are still having trouble, you may need to the following properties in settings.json and retry:

                      "remote.SSH.showLoginTerminal"            :                        truthful            ,            "remote.SSH.useLocalServer"            :                        faux                  

If yous are on macOS and Linux and want to reduce how often yous have to enter a password or token, you tin enable the ControlMaster feature on your local machine then that OpenSSH runs multiple SSH sessions over a unmarried connection.

To enable ControlMaster:

  1. Add together an entry like this to your SSH config file:

                                  Host *                                                ControlMaster motorcar                                                ControlPath  ~/.ssh/sockets/%r@%h-%p                                                ControlPersist  600                          
  2. So run mkdir -p ~/.ssh/sockets to create the sockets folder.

Setting up the SSH Agent

If y'all are connecting to an SSH host using a key with a passphrase, yous should ensure that the SSH Amanuensis is running locally. VS Code volition automatically add your key to the agent so y'all don't have to enter your passphrase every fourth dimension you lot open up a remote VS Code window.

To verify that the agent is running and is reachable from VS Code's environment, run ssh-add -50 in the concluding of a local VS Code window. You lot should see a listing of the keys in the agent (or a message that information technology has no keys). If the agent is not running, follow these instructions to start it. After starting the agent, exist sure to restart VS Lawmaking.

Windows:

To enable SSH Agent automatically on Windows, start a local Administrator PowerShell and run the post-obit commands:

                      # Make sure you're running equally an Administrator            Set-Service                          ssh-agent -StartupType Automatic            Get-go-Service                          ssh-agent            Become-Service                          ssh-agent                  

Now the amanuensis will be started automatically on login.

Linux:

To starting time the SSH Amanuensis in the background, run:

                      eval                                    "$(ssh-agent -s)"                  

To start the SSH Amanuensis automatically on login, add these lines to your ~/.bash_profile:

                      if                          [ -z                        "            $SSH_AUTH_SOCK            "                          ];                        then                                    # Check for a currently running instance of the agent                          RUNNING_AGENT=            "`ps -ax                        |                          grep 'ssh-agent -south'                        |                          grep -v grep                        |                          wc -l                        |                          tr -d '[:space:]'`"                                    if                          [                        "            $RUNNING_AGENT            "                          =                        "0"                          ];                        then                                    # Launch a new example of the agent                          ssh-agent -due south &> .ssh/ssh-agent                                    fi                                    eval                                    `cat .ssh/ssh-agent`            fi                  

macOS:

The agent should be running past default on macOS.

Making local SSH Agent available on the remote

An SSH Agent on your local machine allows the Remote - SSH extension to connect to your chosen remote organisation without repeatedly prompting for a passphrase, only tools similar Git that run on the remote, don't accept access to your locally-unlocked private keys.

Yous can run across this by opening the integrated terminal on the remote and running ssh-add -l. The command should list the unlocked keys, but instead reports an error almost not being able to connect to the hallmark agent. Setting ForwardAgent yes makes the local SSH Agent bachelor in the remote surroundings, solving this problem.

Y'all can do this by editing your .ssh/config file (or whatever Remote.SSH.configFile is set to - use the Remote-SSH: Open SSH Configuration File... command to be sure) and calculation:

          Host *     ForwardAgent yes                  

Note that you might want to be more than restrictive and only set the selection for detail named hosts.

Fixing SSH file permission errors

SSH can be strict near file permissions and if they are fix incorrectly, you may meet errors such as "Warning: UNPROTECTED Individual KEY FILE!". There are several ways to update file permissions in guild to fix this, which are described in the sections below.

Local SSH file and binder permissions

macOS / Linux:

On your local car, make sure the post-obit permissions are set:

Folder / File Permissions
.ssh in your user binder chmod 700 ~/.ssh
.ssh/config in your user folder chmod 600 ~/.ssh/config
.ssh/id_rsa.pub in your user folder chmod 600 ~/.ssh/id_rsa.pub
Whatsoever other key file chmod 600 /path/to/fundamental/file

Windows:

The specific expected permissions can vary depending on the exact SSH implementation you are using. We recommend using the out of box Windows x OpenSSH Client.

In this example, make sure that all of the files in the .ssh folder for your remote user on the SSH host is owned by yous and no other user has permissions to admission it. Run into the Windows OpenSSH wiki for details.

For all other clients, consult your client's documentation for what the implementation expects.

Server SSH file and folder permissions

macOS / Linux:

On the remote machine you are connecting to, make sure the following permissions are gear up:

Binder / File Linux / macOS Permissions
.ssh in your user folder on the server chmod 700 ~/.ssh
.ssh/authorized_keys in your user folder on the server chmod 600 ~/.ssh/authorized_keys

Annotation that only Linux hosts are currently supported, which is why permissions for macOS and Windows ten have been omitted.

Windows:

Come across the Windows OpenSSH wiki for details on setting the appropriate file permissions for the Windows OpenSSH server.

Installing a supported SSH client

Os Instructions
Windows 10 1803+ / Server 2016/2019 1803+ Install the Windows OpenSSH Customer.
Earlier Windows Install Git for Windows.
macOS Comes pre-installed.
Debian/Ubuntu Run sudo apt-become install openssh-client
RHEL / Fedora / CentOS Run sudo yum install openssh-clients

VS Code volition wait for the ssh control in the PATH. Failing that, on Windows it volition attempt to find ssh.exe in the default Git for Windows install path. Y'all can also specifically tell VS Lawmaking where to find the SSH client by calculation the remote.SSH.path property to settings.json.

Installing a supported SSH server

Os Instructions Details
Debian 8+ / Ubuntu 16.04+ Run sudo apt-get install openssh-server See the Ubuntu SSH documentation for details.
RHEL / CentOS 7+ Run sudo yum install openssh-server && sudo systemctl beginning sshd.service && sudo systemctl enable sshd.service See the RedHat SSH documentation for details.
SuSE 12+ / openSUSE 42.3+ In Yast, go to Services Manager, select "sshd" in the list, and click Enable. Next get to Firewall, select the Permanent configuration, and under services check sshd. Meet the SuSE SSH documentation for details.
Windows ten 1803+ / Server 2016/2019 1803+ Install the Windows OpenSSH Server.
macOS 10.xiv+ (Mojave) Enable Remote Login.

Resolving hangs when doing a Git button or sync on an SSH host

If you lot clone a Git repository using SSH and your SSH key has a passphrase, VS Code's pull and sync features may hang when running remotely.

Either apply an SSH central without a passphrase, clone using HTTPS, or run git push from the command line to work around the issue.

Using SSHFS to access files on your remote host

SSHFS is a secure remote filesystem access protocol that builds up from SFTP. Information technology provides advantages over something like a CIFS / Samba share in that all that is required is SSH access to the machine.

Note: For performance reasons, SSHFS is best used for single file edits and uploading/downloading content. If you lot need to employ an awarding that majority reads/write to many files at one time (like a local source command tool), rsync is a better pick.

macOS / Linux:

On Linux, you tin can utilize your distribution's package director to install SSHFS. For Debian/Ubuntu: sudo apt-go install sshfs

Note: WSL 1 does non support FUSE or SSHFS, so the instructions differ for Windows currently. WSL 2 does include FUSE and SSHFS support, so this will change soon.

On macOS, you can install SSHFS using Homebrew: brew install sshfs In improver, if you lot would prefer not to utilize the command line to mount the remote filesystem, you lot tin also install SSHFS GUI.

To use the command line, run the following commands from a local terminal (replacing user@hostname with the remote user and hostname / IP):

                      export                          USER_AT_HOST=user@hostname            # Brand the directory where the remote filesystem volition be mounted            mkdir -p                        "            $Abode            /sshfs/            $USER_AT_HOST            "            # Mount the remote filesystem            sshfs                        "            $USER_AT_HOST            :"                                    "            $Domicile            /sshfs/            $USER_AT_HOST            "                          -ovolname=            "            $USER_AT_HOST            "                          -p 22  \                          -o workaround=nonodelay -o transform_symlinks -o idmap=user  -C                  

This will make your abode folder on the remote machine bachelor under the ~/sshfs. When y'all are washed, you can unmount it using your Os'southward Finder / file explorer or past using the command line:

                      umount                        "            $Dwelling house            /sshfs/            $USER_AT_HOST            "                  

Windows:

Follow these steps:

  1. On Linux, add .gitattributes file to your project to force consistent line endings between Linux and Windows to avert unexpected issues due to CRLF/LF differences between the two operating systems. See Resolving Git line ending issues for details.

  2. Next, install SSHFS-Win using Chocolatey: choco install sshfs

  3. Once you've installed SSHFS for Windows, you can use the File Explorer's Map Network Drive... option with the path \\sshfs\user@hostname, where user@hostname is your remote user and hostname / IP. You tin script this using the command prompt every bit follows: net use /PERSISTENT:NO X: \\sshfs\user@hostname

  4. In one case done, disconnect past right-clicking on the drive in the File Explorer and selecting Disconnect.

Connect to a remote host from the final

Once a host has been configured, you tin connect to it direct from the final past passing a remote URI.

For example, to connect to remote_server and open up the /code/my_project binder, run:

                      code --remote ssh-remote+remote_server /code/my_project                  

We demand to do some guessing on whether the input path is a file or a folder. If information technology has a file extension, it is considered a file.

To forcefulness that a folder is opened, add together slash to the path or use:

code --folder-uri vscode-remote://ssh-remote+remote_server/code/folder.with.dot

To strength that a file is opened, add --goto or use:

code --file-uri vscode-remote://ssh-remote+remote_server/code/fileWithoutExtension

Using rsync to maintain a local copy of your source code

An alternative to using SSHFS to admission remote files is to apply rsync to copy the entire contents of a folder on remote host to your local machine. The rsync command will determine which files need to be updated each fourth dimension information technology is run, which is far more efficient and convenient than using something like scp or sftp. This is primarily something to consider if yous really need to use multi-file or performance intensive local tools.

The rsync command is available out of box on macOS and can be installed using Linux package managers (for example sudo apt-get install rsync on Debian/Ubuntu). For Windows, y'all'll need to either use WSL or Cygwin to access the control.

To use the command, navigate to the folder yous desire to store the synched contents and run the following replacing user@hostname with the remote user and hostname / IP and /remote/source/code/path with the remote source code location.

On macOS, Linux, or inside WSL:

                      rsync -rlptzv --progress --delete --exclude=.git                        "user@hostname:/remote/source/code/path"                                    .                  

Or using WSL from PowerShell on Windows:

                      wsl rsync -rlptzv --progress --delete --exclude=.git                        "user@hostname:/remote/source/code/path"                                    "            `$            (wslpath -a '            $            PWD            ')"                  

You can rerun this command each time you want to get the latest copy of your files and but updates volition exist transferred. The .git binder is intentionally excluded both for performance reasons and so you can use local Git tools without worrying about the state on the remote host.

To push content, reverse the source and target parameters in the command. Withal, on Windows you should add together a .gitattributes file to your project to force consequent line endings before doing so. Come across Resolving Git line ending issues for details.

                      rsync -rlptzv --progress --delete --exclude=.git                        .                                    "user@hostname:/remote/source/lawmaking/path"                  

Cleaning upwards the VS Code Server on the remote

The SSH extension provides a command for cleaning up the VS Lawmaking Server from the remote motorcar, Remote-SSH: Uninstall VS Code Server from Host.... The command does two things: it kills any running VS Lawmaking Server processes and it deletes the folder where the server was installed.

If you want to run these steps manually, or if the command isn't working for you, you can run a script like this:

                      kill                          -nine                        `ps ax                        |                          grep "remoteExtensionHostAgent.js"                        |                          grep -v grep                        |                          awk '{print $1}'`            kill                          -9                        `ps ax                        |                          grep "watcherService"                        |                          grep -v grep                        |                          awk '{impress $1}'`            rm -rf ~/.vscode-server                        # Or ~/.vscode-server-insiders                  

The VS Code Server was previously installed under ~/.vscode-remote so you can cheque that location too.

SSH into a remote WSL 2 host

You may want to use SSH to connect to a WSL distro running on your remote machine. Check out this guide to larn how to SSH into Bash and WSL 2 on Windows ten from an external machine.

Container tips

This section includes some tips and tricks for getting the Remote - Containers extension up and running in dissimilar environments.

If you lot are running into Docker issues or would prefer not to run Docker locally, you lot may desire to try the preview of GitHub Codespaces managed cloud-based environments. Over time this service volition support an increasing number of devcontainer.json properties and yous tin also use its browser-based editor in add-on to VS Code.

Docker Desktop for Windows tips

Docker Desktop for Windows works well in near setups, just in that location are a few "gotchas" that tin can cause problems. Here are some tips on avoiding them:

  1. Consider using the new Docker WSL 2 back-end on Windows 10 (2004+). If you are using Docker Desktop'southward WSL ii back-end, you can you to open folders within WSL equally well every bit locally. Containers are besides shared between Windows and inside WSL and this new engine is less susceptible to file sharing problems. See the quick start for details.

  2. Switch out of "Linux Containers on Windows (LCOW)" mode. While disabled by default, recent versions of Docker support Linux Containers on Windows (LCOW) that can let you to utilize both Windows and Linux containers at the same time. However, this is a new feature, and so you lot may encounter issues and the Remote - Containers extension only supports Linux containers currently. You can switch out of LCOW style at whatsoever time by right-clicking on the Docker chore bar item and selecting Switch to Linux Containers... from the context menu.

  3. Make certain your firewall allows Docker to set a shared drive. Docker but needs to connect between ii motorcar local IPs, just some firewall software may notwithstanding block any drive sharing or the needed ports. See this Docker KB article for next steps on resolving this trouble.

Here are some tips that applied to older versions of Docker for Windows but should now be resolved. If you come across strage behaviors due to a possible regression, these tips accept solved problems in the past.

  1. Use an AD domain account or local administrator account when sharing drives. Do not use an AAD (electronic mail-based) account. AAD (email-based) accounts have well-known issues, as documented in Docker issue #132 and issue #1352. If you must use an AAD business relationship, create a split up local administrator account on your auto that you use purely for the purpose of sharing drives. Follow the steps in this web log post to go everything set up upwardly.

  2. Stick with alphanumeric passwords to avoid bulldoze sharing issues. When asked to share your drives on Windows, you will be prompted for the username and countersign of an account with admin privileges on the auto. If you are warned nigh an incorrect username or password, this may be due to special characters in the countersign. For example, !, [ and ] are known to cause bug. Change your countersign to alphanumeric characters to resolve. See this outcome about Docker volume mounting bug for details.

  3. Employ your Docker ID to sign in to Docker (not your email). The Docker CLI but supports using your Docker ID, so using your email can cause problems. See Docker consequence #935 for details.

If you lot are still having trouble, run across the Docker Desktop for Windows troubleshooting guide.

Enabling file sharing in Docker Desktop

The VS Code Remote - Containers extension can only automatically mount your source code into a container if your lawmaking is in a folder or drive shared with Docker. If you open a dev container from a non-shared location, the container volition successfully start simply the workspace will exist empty.

Note that this step is not required with Docker Desktop's WSL 2 engine.

To alter Docker's drive and binder sharing settings:

Windows:

  1. Correct-click on the Docker task bar item and select Settings.
  2. Go to Resources > File Sharing and check the bulldoze(s) where your source lawmaking is located.
  3. If yous meet a message well-nigh your local firewall blocking the sharing activity, see this Docker KB article for adjacent steps.

macOS:

  1. Click on the Docker menu bar item and select Preferences.
  2. Become to Resources > File Sharing. Confirm that the binder containing your source lawmaking is under 1 of the shared folders listed.

Resolving Git line ending problems in containers (resulting in many modified files)

Since Windows and Linux use different default line endings, Git may study a large number of modified files that have no differences bated from their line endings. To forestall this from happening, y'all tin disable line ending conversion using a .gitattributes file or globally on the Windows side.

Typically calculation or modifying a .gitattributes file in your repository is the most reliable fashion to solve this trouble. Committing this file to source command will help others and allows you to vary behaviors by repository as appropriate. For example, adding the post-obit to .gitattributes file to the root of your repository will force everything to be LF, except for Windows batch files that crave CRLF:

                      *                        text=auto eol=lf            *            .            {cmd,[cC][mM][dD]}                                    text eol=crlf            *            .            {bat,[bB][aA][tT]}                                    text eol=crlf                  

Annotation that this works in Git v2.10+, and then if you lot are running into problems, be sure you lot've got a recent Git client installed. You can add other file types in your repository that require CRLF to this same file.

If you lot would prefer to still always upload Unix-manner line endings (LF), yous can utilize the input selection.

                      git config --global cadre.autocrlf input                  

If you'd prefer to disable line-ending conversion entirely, run the post-obit instead:

                      git config --global core.autocrlf                        false                  

Finally, you may demand to clone the repository again for these settings to have upshot.

Avert setting up Git in a container when using Docker Compose

Encounter Sharing Git credentials with your container in the main containers article for data on resolving this issue.

Resolving hangs when doing a Git push button or sync from a Container

If you clone a Git repository using SSH and your SSH key has a passphrase, VS Code'southward pull and sync features may hang when running remotely.

Either utilize an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to work around the result.

Resolving errors about missing Linux dependencies

Some extensions rely on libraries not found in the certain Docker images. Come across the Containers commodity for a few options on resolving this issue.

Speeding upward containers in Docker Desktop

By default, Docker Desktop only gives containers a fraction of your auto capacity. In nigh cases, this is enough, only if you are doing something that requires more than capacity, y'all tin increase memory, CPU, or disk utilize.

Showtime, try stopping any running containers yous are no longer using.

If this doesn't solve your problem, you may desire to see if CPU usage is actually the result or if there is something else going on. An piece of cake way to check this is to install the Resource Monitor extension. When installed in a container, it provides information about capacity for your containers in the Status bar.

Resource use Status bar

If y'all'd like this extension to always be installed, add together this to your settings.json:

                      "remote.containers.defaultExtensions"            : [                                    "mutantdino.resourcemonitor"            ]                  

If you determine that y'all need to give your container more of your machine's capacity, follow these steps:

  1. Right-click on the Docker job bar item and select Settings / Preferences.
  2. Become to Advanced to increment CPU, Retention, or Swap.
  3. On macOS, go to Disk to increment the amount of disk Docker is allowed to eat on your car. On Windows, this is located nether Advanced with the other settings.

Finally, if your container is doing deejay intensive operations or y'all are merely looking for faster response times, run across Improving container deejay functioning for tips. VS Code's defaults optimize for convenience and universal support, just tin be optimized.

Cleaning out unused containers and images

If y'all see an fault from Docker reporting that you are out of disk space, you can typically resolve this by cleaning out unused containers and images. In that location are a few ways to do this:

Option i: Use the Remote Explorer

You can delete containers by selecting the Remote Explorer, right-click on the container you want to remove, and select Remove Container.

Remote Explorer screenshot

Nonetheless, this does non clean up any images you may have downloaded, which can clutter up your organization.

Option ii: Employ the Docker extension

  1. Open up a local window in VS Code (File > New Window).

  2. Install the Docker extension from the Extensions view if not already nowadays.

  3. You can then go to the Docker view and expand the Containers or Images node, right-click, and select Remove Container / Prototype.

    Docker Explorer screenshot

Option 3: Utilise the Docker CLI to pick containers to delete

  1. Open up a local final/command prompt (or employ a local window in VS Code).
  2. Blazon docker ps -a to see a list of all containers.
  3. Type docker rm <Container ID> from this list to remove a container.
  4. Type docker epitome clip to remove any unused images.

If docker ps does not provide enough information to place the container yous want to delete, the following command will list all development containers managed by VS Lawmaking and the folder used to generate them.

                      docker ps -a --filter=            "label=vsch.quality"                          --format                        "table {{.ID}}\t{{.Status}}\t{{.Image}}\tvscode-{{.Characterization                        \"            vsch.quality            \"            }}\t{{.Label                        \"            vsch.local.folder            \"            }}"                  

Option 4: Use Docker Etch

  1. Open a local terminal/command prompt (or use a local window in VS Code).
  2. Go to the directory with your docker-compose.yml file.
  3. Blazon docker-compose down to stop and delete the containers. If yous accept more than one Docker Etch file, you can specify additional Docker Compose files with the -f argument.

Choice 4: Delete all containers and images that are non running:

  1. Open up a local terminal/control prompt (or use a local window in VS Code).
  2. Type docker organisation clip --all.

Resolving Dockerfile build failures for images using Debian 8

When building containers that use images based on Debian 8/Jessie — such equally older versions of the node:8 image — you lot may meet the following fault:

                      ... W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'principal/binary-amd64/Packages' in Release file (Incorrect sources.list entry or malformed file) Eastward: Some index files failed to download. They have been ignored, or old ones used instead. ...                              

This is a well known consequence caused by the Debian 8 beingness "archived". More than recent versions of images typically resolve this problem, oftentimes by upgrading to Debian ix/Stretch.

There are two ways to resolve this error:

  • Option 1: Remove whatsoever containers that depend on the paradigm, remove the image, and then try building again. This should download an updated prototype that is not affected by the problem. Come across cleaning out unused containers and images for details.

  • Option 2: If you don't want to delete your containers or images, add this line into your Dockerfile earlier any apt or apt-get command. It adds the needed source lists for Jessie:

                                  # Add archived sources to source list if base image uses Debian 8 / Jessie                RUN                                  true cat /etc/*-release | grep -q jessie && printf                                "deb http://archive.debian.org/debian/ jessie main                \n                deb-src http://archive.debian.org/debian/ jessie main                \due north                deb http://security.debian.org jessie/updates chief                \n                deb-src http://security.debian.org jessie/updates master"                                  > /etc/apt/sources.list                          

Resolving Docker Hub sign in errors when an email is used

The Docker CLI but supports using your Docker ID, so using your email to sign in can cause bug. See Docker issue #935 for details.

As a workaround, use your Docker ID to sign in to Docker rather than your email.

High CPU utilization of Hyperkit on macOS

At that place is known result with Docker for Mac that can drive high CPU spikes. In detail, high CPU usage occurring when watching files and edifice. If you see high CPU usage for com.docker.hyperkit in Activity Monitor while very picayune is going on in your dev container, y'all are likely hit this issue. Follow the Docker issue for updates and fixes.

Using an SSH tunnel to connect to a remote Docker host

The Develop inside a container on a remote Docker Machine or SSH host article covers how to setup VS Lawmaking when working with a remote Docker host. This is often equally simple as setting the Docker extension docker.host property in settings.json or the DOCKER_HOST environs variable to a ssh:// or tcp:// URI.

However, you may come across situations where this does not work in your environment due to SSH configuration complexity or other limitations. In this example, an SSH tunnel tin be used every bit a fallback.

Using an SSH tunnel as a fallback pick

You tin can set upwardly an SSH tunnel and frontwards the Docker socket from your remote host to your local machine.

Follow these steps:

  1. Install an OpenSSH uniform SSH client.

  2. Update the Docker extension docker.host property in your user or workspace settings.json as follows:

                                  "docker.host"                :                "tcp://localhost:23750"                          
  3. Run the following command from a local terminal / PowerShell (replacing user@hostname with the remote user and hostname / IP for your server):

                                  ssh -NL localhost:23750:/var/run/docker.sock user@hostname                          

VS Code will at present be able to attach to any running container on the remote host. You can also utilise specialized, local devcontainer.json files to create / connect to a remote dev container.

Once yous are done, printing Ctrl+C in the last / PowerShell to close the tunnel.

Note: If the ssh control fails, you may need to AllowStreamLocalForwarding on your SSH host.

  1. Open up /etc/ssh/sshd_config in an editor (like Vim, nano, or Pico) on the SSH host (not locally).
  2. Add together the setting AllowStreamLocalForwarding aye.
  3. Restart the SSH server (on Ubuntu, run sudo systemctl restart sshd).
  4. Retry.

Persisting user profile

Y'all can use the mounts belongings to persist the user profile (to continue things like beat out history) in your dev container across rebuilds.

                                              "mounts"            : [                                    "source=contour,target=/root,type=volume"            ,                                    "target=/root/.vscode-server,type=volume"                          ],                  

The above code kickoff creates a named volume called profile mounted to /root, which will survive a rebuild. It adjacent creates an anonymous volume mounted to /root/.vscode-server that gets destroyed on rebuild, which allows VS Lawmaking to reinstall extensions and dotfiles.

Advanced container configuration tips

See the Advanced container configuration articles for information on the following topics:

  • Calculation environment variables
  • Calculation another local file mount
  • Changing or removing the default source code mountain
  • Improving container disk performance
  • Adding a non-root user to your dev container
  • Avoiding extension reinstalls on container rebuild
  • Setting the project name for Docker Compose
  • Using Docker or Kubernetes from within a container
  • Connecting to multiple containers at once
  • Developing inside a container on a remote Docker Machine or SSH host
  • Reducing Dockerfile build warnings

WSL tips

First time start: VS Lawmaking Server prerequisites

Some WSL Linux distributions are lacking libraries that are required past the VS Lawmaking server to showtime upwardly. You lot can add together boosted libraries into your Linux distribution by using its package director.

Debian and Ubuntu

Open up the Debian or Ubuntu WSL shell to add wget and ca-certificates:

                      sudo apt-get update && sudo apt-get install wget ca-certificates                  

Alpine

Open the Tall WSL beat as root (wsl -d Alpine -u root) to add libstdc++:

                      apk update && apk add libstdc++                  

On Windows 10 Apr 2018 Update (build 1803) and older, /bin/bash is required:

                      apk update && apk add bash                  

Selecting the distribution used by Remote - WSL

Remote-WSL: New Window will open the WSL distro registered equally default.

To open up a non-default distro, run code . from the WSL beat out of the distro to utilize or utilize Remote-WSL: New Window using Distro.

With WSL versions older than Windows 10, May 2019 Update (version 1903), the WSL control tin only apply the default distro. For this reason, the Remote- WSL might prompt you if y'all concur to modify the default distro.

You can always use wslconfig.exe to alter your default.

For example:

                      wslconfig /setdefault Ubuntu                  

You can see which distributions y'all have installed by running:

                      wslconfig /l                  

Configure the environment for the server startup

When the Remote WSL extension starts the VS Code server in WSL, it does not run whatsoever vanquish configuration scripts. This was washed to avoid that custom configuration scripts can forbid the startup.

If you need to configure the startup environment, you can utilise the environment setup script as described hither.

Configure the environment for the remote extension host

The surroundings for the remote extension host and terminal are based on the default shell's configuration scripts. To evaluate the environment variables for the remote extension host procedure, the server creates an example of the default beat as an interactive login trounce. It probes the surround variables from it and uses them as the initial surroundings for the remote extension host process. The values of environment variables therefore depend on what shell is configured equally the default and the content of the configuration scripts for that beat out.

Encounter Unix shell initialization for an overview of each shell's configuration scripts. Most WSL distributions have /bin/bash configured every bit the default shell. /bin/bash will look for startup files under /etc/profile offset and for any startup files under ~/.bash_profile, ~/.bash_login, ~/.profile.

To change the default crush of a WSL distro, follow the instructions of this blog post.

Fixing issues with the code control non working

If typing lawmaking from a WSL concluding on Window does not work because code cannot be found, yous may be missing some central locations from your PATH in WSL.

Check past opening a WSL terminal and typing repeat $PATH. Yous should run across VS Lawmaking install path listed. By default, this would exist:

                      /mnt/c/Users/Your Username/AppData/Local/Programs/Microsoft VS Code/bin                  

But, if you used the System Installer, the install path is:

                      /mnt/c/Plan Files/Microsoft VS Code/bin                  

...or...

                      /mnt/c/Plan Files (x86)/Microsoft VS Code/bin                  

Information technology's a feature of WSL that paths are inherited from the PATH variable in Windows. To change the Windows PATH variable, use the Edit environment variables for your business relationship command from the kickoff carte in Windows.

If you have disabled the path sharing feature, edit your .bashrc, add together the following, and kickoff a new terminal:

                      WINDOWS_USERNAME=            "Your Windows Alias"            export                          PATH=            "            $PATH            :/mnt/c/Windows/System32:/mnt/c/Users/            ${WINDOWS_USERNAME}            /AppData/Local/Programs/Microsoft VS Code/bin"            # or...            # consign PATH="$PATH:/mnt/c/Program Files/Microsoft VS Lawmaking/bin"            # or...            # consign PATH="$PATH:/mnt/c/Programme Files (x86)/Microsoft VS Lawmaking/bin"                  

Annotation: Be sure to quote or escape infinite characters in the directory names.

Finding problems with the 'code' control

If typing code from a Windows command prompt does not launch VS Code, you tin can assist us diagnose the problem by running VSCODE_WSL_DEBUG_INFO=true code ..

Please file an issue and attach the full output.

Finding bug starting or connected to the server

When the WSL window fails to connect to the remote server, you tin get more than data in the WSL log. When filing an result, it is important to always ship the full content of the WSL log.

Open the WSL log by running the control Remote-WSL: Open Log. The log volition show in the final view under the WSL tab.

WSL Log

To become even more verbose logging, enable the setting remote.WSL.debug in the user settings.

The server fails to start with a sectionalisation mistake

You can help us investigate this problem by sending us the cadre dump file. To get the cadre dump file, follow these steps:

In a Windows control prompt:

  • Run code --locate-extension ms-vscode-remote.remote-wsl to decide the Remote-WSL extension folder.
  • cd to the path that is returned.
  • Open the wslServer.sh script with VS Lawmaking, code .\scripts\wslServer.sh.
  • On the 3rd terminal line (before consign VSCODE_AGENT_FOLDER="$Dwelling/$DATAFOLDER"), add ulimit -C unlimited.
  • Start the Remote-WSL window running the remote server and wait for the segmentation fault.

The core file will be in the Remote-WSL extension folder from higher up.

I run into EACCESS: permission denied error trying to rename a folder in the open workspace

This is a known problem with the WSL file system implementation (Microsoft/WSL#3395, Microsoft/WSL#1956) caused by the file watcher agile by VS Lawmaking. The event volition only be fixed in WSL ii.

To avert the issue, set remote.WSL.fileWatcher.polling to truthful. Still, polling based has a performance impact for large workspaces.

For big workspace you lot may desire to increment the polling interval, remote.WSL.fileWatcher.pollingInterval, and control the folders that are watched with files.watcherExclude.

WSL 2 does non accept that file watcher problem and is not affected by the new setting.

Resolving Git line catastrophe issues in WSL (resulting in many modified files)

Since Windows and Linux utilise different default line endings, Git may report a large number of modified files that have no differences aside from their line endings. To prevent this from happening, you lot can disable line-ending conversion using a .gitattributes file or globally on the Windows side.

Typically calculation or modifying a .gitattributes file in your repository is the most reliable way to solve this problem. Committing this file to source control will assistance others and allows yous to vary behaviors by repository as appropriate. For example, adding the following to .gitattributes file to the root of your repository volition strength everything to be LF, except for Windows batch files that require CRLF:

                      *                        text=auto eol=lf            *            .            {cmd,[cC][mM][dD]}                                    text eol=crlf            *            .            {bat,[bB][aA][tT]}                                    text eol=crlf                  

Note that this works in Git v2.10+, so if you are running into problems, be sure yous've got a recent Git client installed. Yous can add other file types in your repository that require CRLF to this aforementioned file.

If you would adopt to still always upload Unix-style line endings (LF), you lot can use the input selection.

                      git config --global core.autocrlf input                  

If you lot'd prefer to disable line-catastrophe conversion entirely, run the following instead:

                      git config --global core.autocrlf                        false                  

Finally, you may need to clone the repository once again for these settings to accept effect.

Sharing Git credentials between Windows and WSL

If you employ HTTPS to clone your repositories and have a credential helper configured in Windows, you can share this with WSL and so that passwords yous enter are persisted on both sides. (Note that this does not utilise to using SSH keys.)

Just follow these steps:

  1. Configure the credential manager on Windows by running the following in a Windows control prompt or PowerShell:

                                                    git config --global credential.helper wincred                          
  2. Configure WSL to use the same credential helper, but running the following in a WSL terminal:

                                                    git config --global credential.helper                                "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"                          

Any password y'all enter when working with Git on the Windows side will now be available to WSL and vice versa.

Resolving hangs when doing a Git push or sync from WSL

If you lot clone a Git repository using SSH and your SSH key has a passphrase, VS Code'due south pull and sync features may hang when running remotely.

Either use an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to work around the issue.

GitHub Codespaces tips

For tips and questions most GitHub Codespaces, run into the GitHub Codespaces documentation. Yous can also cheque out the known spider web limitations and adaptations that may impact your Codespaces.

Extension tips

While many extensions will piece of work unmodified, there are a few issues that can prevent certain features from working equally expected. In some cases, you can utilise some other command to work effectually the effect, while in others, the extension may need to be modified. This section provides a quick reference for common issues and tips on resolving them. You can as well refer to the main extension article on Supporting Remote Development for an in-depth guide on modifying extensions to support remote extension hosts.

Resolving errors about missing dependencies

Some extensions rely on libraries not found in the basic install of certain WSL Linux distributions. You tin add together additional libraries into your Linux distribution by using its package manager. For Ubuntu and Debian based distributions, run sudo apt-get install <parcel> to install the needed libraries. Cheque the documentation for your extension or the runtime that is mentioned in the fault bulletin for boosted installation details.

Local accented path settings fail when applied remotely

VS Code's local user settings are reused when you connect to a remote endpoint. While this keeps your user experience consistent, you may need to vary absolute path settings between your local machine and each host / container / WSL since the target locations are different.

Resolution: You tin set endpoint-specific settings after y'all connect to a remote endpoint past running the Preferences: Open up Remote Settings command from the Control Palette (F1) or past selecting the Remote tab in the Settings editor. These settings will override any local settings you have in place whenever you connect.

Need to install local VSIX on remote endpoint

Sometimes you want to install a local VSIX on a remote machine, either during development or when an extension author asks you lot to try out a fix.

Resolution: Once you take connected to an SSH host, container, or WSL, you can install the VSIX the aforementioned mode you would locally. Run the Extensions: Install from VSIX... command from the Command Palette (F1). You may besides want to add "extensions.autoUpdate": false to settings.json to prevent auto-updating to the latest Market version. See Supporting Remote Development for more information on developing and testing extensions in a remote environment.

Browser does not open locally

Some extensions use external node modules or custom code to launch a browser window. Unfortunately, this may cause the extension to launch the browser remotely instead of locally.

Resolution: The extension can use the vscode.env.openExternal API to resolve this trouble. Encounter the extension writer's guide for details.

Clipboard does not work

Some extensions use node modules like clipboardy to integrate with the clipboard. Unfortunately, this may cause the extension to incorrectly integrate with the clipboard on the remote side.

Resolution: The extension can switch to the VS Code clipboard API to resolve the problem. Encounter the extension author's guide for details.

Cannot access local web server from browser or application

When working within a container, SSH host, or through GitHub Codespaces, the port the browser is connecting to may be blocked.

Resolution: Extensions can use the vscode.env.openExternal or vscode.env.asExternalUri APIs (which automatically forwards localhost ports) to resolve this problem. Meet the extension author's guide for details. As a workaround, use the Forward a Port command to practise so manually.

Webview contents do non appear

If the extension's webview content uses an iframe to connect to a local web server, the port the webview is connecting to may be blocked. In add-on, if the extension hard codes vscode-resource:// URIs instead of using asWebviewUri, content may not announced in the Codespaces browser editor.

Resolution: The extension can utilize the webview.asWebviewUri to resolve issues with vscode-resource:// URIs.

If ports are existence blocked, the best approach is to instead use the webview message passing API. Every bit a workaround, vscode.env.asExternalUri can exist used allow the webview to connect to spawned localhost web servers from VS Lawmaking. However, this is currently blocked for the Codespaces browser-based editor (simply) by MicrosoftDocs/vscodespaces#eleven. See the extension author's guide for details on the workaround.

Blocked localhost ports

If you are trying to connect to a localhost port from an external application, the port may exist blocked.

Resolution: VS Lawmaking 1.40 introduced a new vscode.env.asExternalUri API for extensions to programmatically forward capricious ports. See the extension author's guide for details. As a workaround, you lot can use the Frontward a Port command to do so manually.

Errors storing extension information

Extensions may try to persist global data by looking for the ~/.config/Code folder on Linux. This folder may not exist, which can cause the extension to throw errors like ENOENT: no such file or directory, open '/root/.config/Code/User/filename-goes-here.

Resolution: Extensions can apply the context.globalStoragePath or context.storagePath property to resolve this trouble. See the extension author'southward guide for details.

Cannot sign in / take to sign in each time I connect to a new endpoint

Extensions that crave sign in may persist secrets using their own code. This code tin neglect due to missing dependencies. Even if it succeeds, the secrets will be stored remotely, which ways y'all have to sign in for every new endpoint.

Resolution: Extensions can use the keytar node module to solve this problem. Run into the extension author'south guide for details.

An incompatible extension prevents VS Code from connecting

If an incompatible extension has been installed on a remote host, container, or in WSL, we take seen instances where the VS Code Server hangs or crashes due to the incompatibility. If the extension activates right away, this can prevent y'all from connecting and beingness able to uninstall the extension.

Resolution: Manually delete the remote extensions folder by following these steps:

  1. For containers, ensure your devcontainer.json no longer includes a reference to the faulty extension.

  2. Next, use a split concluding / control prompt to connect to the remote host, container, or WSL.

    • If SSH or WSL, connect to the environment accordingly (run ssh to connect to the server or open up WSL terminal).
    • If using a container, identify the container ID past calling docker ps -a and looking through the list for an image with the correct proper noun. If the container is stopped, run docker run -it <id> /bin/sh. If it is running, run docker exec -information technology <id> /bin/sh.
  3. In one case you are continued, run rm -rf ~/.vscode-server/extensions for VS Code stable and/or rm -rf ~/.vscode-server-insiders/extensions for VS Code Insiders to remove all extensions.

Extensions that ship or learn pre-built native modules fail

Native modules bundled with (or dynamically acquired for) a VS Code extension must be recompiled using Electron'southward electron-rebuild. However, VS Code Server runs a standard (non-Electron) version of Node.js, which tin can cause binaries to neglect when used remotely.

Resolution: Extensions need to be modified to solve this problem. They will demand to include (or dynamically larn) both sets of binaries (Electron and standard Node.js) for the "modules" version in Node.js that VS Code ships then check to run across if context.executionContext === vscode.ExtensionExecutionContext.Remote in their activation role to set up the correct binaries. Meet the extension author'south guide for details.

Extension only fails on non-x86_64 hosts or Alpine Linux

If an extension works on Debian 9+, Ubuntu 16.04+, or RHEL / CentOS 7+ remote SSH hosts, containers, or WSL, but fails on supported not-x86_64 hosts (for example, ARMv7l) or Alpine Linux containers, the extension may only include native lawmaking or runtimes that practice non support these platforms. For example, the extensions may only include x86_64 compiled versions of native modules or runtimes. For Tall Linux, the included native lawmaking or runtimes may not piece of work due to fundamental differences between how libc is implemented in Tall Linux (musl) and other distributions (glibc).

Resolution: Extensions will need to opt-in to supporting these platforms past compiling / including binaries for these boosted targets. It is important to note that some third-party npm modules may likewise include native code that can crusade this problem. So, in some cases you may need to piece of work with the npm module author to add additional compilation targets. Encounter the extension author'south guide for details.

Extensions fail due to missing modules

Extensions that rely on Electron or VS Code base of operations modules (not exposed by the extension API) without providing a fallback tin can fail when running remotely. You may see errors in the Developer Tools console like original-fs not being found.

Resolution: Remove the dependency on an Electron module or provide a fallback. Run into the extension author'southward guide for details.

Cannot access / transfer remote workspace files to local machines

Extensions that open workspace files in external applications may run across errors because the external application cannot directly access the remote files.

Resolution: If you create a "UI" extension designed to run locally, you can use the vscode.workspace.fs API to interact with the remote workspace filesystem. You lot can then make this a dependency of your "Workspace" extension and invoke it using a control as needed. See the extension author'due south guide for details on different types of extensions and how to employ commands to communicate between them.

Cannot access attached device from extension

Extensions that access locally fastened devices volition be unable to connect to them when running remotely.

Resolution: None currently. Nosotros are investigating the all-time approach to solve this problem.

Questions and feedback

Reporting problems

If you run into an issue with one of the remote development extensions, information technology's of import to collect the correct logs then that we'll be able to help diagnose your outcome.

Each remote extension has a control to view its logs.

You can go the Remote - SSH extension logs with Remote-SSH: Evidence Log from the Command Palette (F1). When reporting Remote - SSH bug, please also verify if you're able to SSH into your machine from an external last (not using Remote - SSH).

Similarly, you tin can get the Remote - Containers extension logs with Remote-Containers: Evidence Log.

Similar the two above, you can go the Remote - WSL logs with Remote WSL: Show Log. Also check whether your issue is being tracked upstream in the WSL repo (and is non due to the Remote - WSL extension).

If you're experiencing issues using other extensions remotely (for case, other extensions aren't loading or installing properly in a remote context), it's helpful to grab the log from the Remote Extension Host output channel (Output: Focus on Output View), and select Log (Remote Extension Host) from the dropdown.

Note: If you lot simply see Log (Extension Host), this is the local extension host, and the remote extension host didn't launch. This is because the log aqueduct is created only afterwards the log file is created, so if the remote extension host does not launch, the remote extension host log file was not created and is not shown in the Output view. This is still helpful data to include in your upshot.

Remote question and feedback resource

We have a variety of other remote resources:

  • See Remote Development FAQ.
  • Search on Stack Overflow.
  • Add a feature request or study a problem.

besserfolend.blogspot.com

Source: https://code.visualstudio.com/docs/remote/troubleshooting

0 Response to "Linux Login Command Unable to Read Config Index -"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel