Bind Error Reading Private Key File Not Found
Remote Development Tips and Tricks
This commodity covers troubleshooting tips and tricks for each of the Visual Studio Lawmaking Remote Development extensions. Meet the SSH, Containers, and WSL manufactures for details on setting up and working with each specific extension. Or try the introductory Tutorials to assistance get you running apace in a remote environment.
For tips and questions about GitHub Codespaces, meet the GitHub Codespaces documentation.
SSH tips
SSH is powerful and flexible, but this as well adds some setup complexity. This section includes some tips and tricks for getting the Remote - SSH extension up and running in different environments.
Configuring key based hallmark
SSH public key authentication is a convenient, high security authentication method that combines a local "individual" key with a "public" central that you acquaintance with your user account on an SSH host. This section will 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 yous tin can convert your PuTTYGen keys.
Quick start: Using SSH keys
To ready up SSH cardinal based authentication for your remote host. First we'll create a key pair and and then copy the public key to the host.
Create your local SSH central pair
Check to run into if you already have an SSH key on your local motorcar. This is typically located at ~/.ssh/id_rsa.pub on macOS / Linux, and the .ssh directory in your user contour folder on Windows (for instance C:\Users\your-user\.ssh\id_rsa.pub).
If you do not accept a primal, run the following command in a local last / PowerShell to generate an SSH key pair:
ssh-keygen -t rsa -b 4096 Tip: Don't take
ssh-keygen? Install a supported SSH client.
Authorize your macOS or Linux motorcar to connect
Run one of the following commands, in a local last window replacing user and host name equally advisable to copy your local public cardinal to the SSH host.
-
Connecting to a macOS or Linux SSH host:
export USER_AT_HOST= "your-user-name-on-host@hostname" export PUBKEYPATH= " $HOME /.ssh/id_rsa.pub" ssh-re-create-id -i " $PUBKEYPATH " " $USER_AT_HOST " -
Connecting to a Windows SSH host:
export USER_AT_HOST= "your-user-proper name-on-host@hostname" export PUBKEYPATH= " $HOME /.ssh/id_rsa.pub" ssh $USER_AT_HOST "powershell New-Item -Force -ItemType Directory -Path \"\$ Dwelling \\ .ssh \" ; Add-Content -Force -Path \"\$ HOME \\ .ssh \\ authorized_keys \" -Value '$(tr -d '\n\r' < " $PUBKEYPATH ")'"You may want to validate that the
authorized_keyfile in the.sshbinder for your remote user on the SSH host is endemic by you lot and no other user has permission to admission it. Meet the OpenSSH wiki for details.
Authorize your Windows machine to connect
Run one of the following commands, in a local PowerShell window replacing user and host name equally appropriate to copy your local public key to the SSH host.
-
Connecting to a macOS or Linux SSH host:
$ USER_AT_HOST = "your-user-name-on-host@hostname" $ PUBKEYPATH = " $ HOME\.ssh\id_rsa.pub" $ pubKey = ( Get-Content " $ PUBKEYPATH " | Out-Cord ); ssh " $ USER_AT_HOST " "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo ' ${ 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 = " $ Dwelling\.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 -Force -Path `"`$ Domicile\.ssh\authorized_keys `" `" "Validate that the
authorized_keyfile in the.sshfolder for your remote user on the SSH host is owned by you and no other user has permission to access it. Run across the OpenSSH wiki for details.
Improving your security with a dedicated key
While using a single SSH key beyond all your SSH hosts can be convenient, if anyone gains access to your individual central, they will have access to all of your hosts every bit well. You lot can foreclose this by creating a separate SSH key for your evolution hosts. Merely follow these steps:
-
Generate a separate SSH fundamental in a different file.
macOS / Linux: Run the post-obit control in a local terminal:
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-remote-sshWindows: Run the following command in a local PowerShell:
ssh-keygen -t rsa -b 4096 -f " $ Dwelling house\.ssh\id_rsa-remote-ssh" -
Follow the same steps in the quick start to authorize the key on the SSH host, merely fix the
PUBKEYPATHto theid_rsa-remote-ssh.pubfile instead. -
In VS Lawmaking, run Remote-SSH: Open Configuration File... in the Command Palette (F1), select an SSH config file, and add (or modify) a host entry every bit follows:
Host proper noun-of-ssh-host-here User your-user-name-on-host HostName host-fqdn-or-ip-goes-here IdentityFile ~/.ssh/id_rsa-remote-sshTip: You can use
/for Windows paths likewise. If you apply\you will need to use two slashes. For case,C:\\path\\to\\my\\id_rsa.
Reusing a fundamental generated in PuTTYGen
If you lot used PuTTYGen to set SSH public key authentication for the host you are connecting to, you lot demand to convert your private cardinal then that other SSH clients can utilise it. To do this:
-
Open up PuTTYGen locally and load the individual key yous desire to convert.
-
Select Conversions > Export OpenSSH key from the application menu. Save the converted central to a local location under the
.sshdirectory in your user profile folder (for exampleC:\Users\youruser\.ssh). -
Validate that this new local file is owned by you and no other user has permissions to access information technology.
-
In VS Code, run Remote-SSH: Open Configuration File... in the Command Palette (F1), select the SSH config file you want to modify, and add (or modify) a host entry in the config file every bit follows to point to the file:
Host name-of-ssh-host-hither 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 Code Server". The server is started with a randomly generated key, and any new connection to the server needs to provide the key. The central is stored on the remote'due south disk, readable only by the current user. There is ane HTTP path that is available without authentication at /version.
Past default, the server listens to localhost on a random TCP port that is and then forwarded to your local machine. If you are connecting to a Linux or macOS host, you lot 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 so configuring public fundamental authentication is recommended.
To configure it:
-
Ensure yous have a local OpenSSH 6.7+ SSH client on Windows, macOS, or Linux and an OpenSSH 6.7+ Linux or macOS Host (Windows does non support this mode).
-
Switch Remote - SSH into socket mode by enabling Remote.SSH: Remote Server Heed On Socket in your local VS Code User settings.
-
If you've already connected to the SSH Host, select Remote-SSH: Kill VS Code Server on Host... from the Control Palette (F1) so the setting takes effect.
If y'all encounter an mistake when connecting, you may need to enable socket forwarding on your SSH Host's sshd config. To exercise and then:
- Open
/etc/ssh/sshd_configin a text editor (like half dozen, nano, or pico) on the SSH host (not locally). - Add the setting
AllowStreamLocalForwarding aye. - Restart the SSH server. (On Ubuntu, run
sudo systemctl restart sshd.). - Retry.
Troubleshooting hanging or declining connections
If you are running into problems with VS Code hanging while trying to connect (and potentially timing out), there are a few things you tin practice to try to resolve the issue.
General troubleshooting: Remove the server
I command helpful to troubleshoot a variety of Remote-SSH issues is Remote-SSH: Impale VS Code Server on Host. This volition remove the server, which can fix a wide range of issues and fault messages yous may see, such as "Could not plant connection to server_name: The VS Lawmaking Server failed to start."
Come across if VS Lawmaking is waiting on a prompt
Enable the remote.SSH.showLoginTerminal setting in VS Code and retry. If y'all are prompted to input a password or token, see Enabling alternate SSH authentication methods for details on reducing the frequency of prompts.
If y'all are all the same having trouble, set the following properties in settings.json and retry:
"remote.SSH.showLoginTerminal" : true , "remote.SSH.useLocalServer" : imitation Work around a bug with some versions of Windows OpenSSH server
Due to a bug in certain versions of OpenSSH server for Windows, the default cheque to determine if the host is running Windows may non work properly. This does not occur with OpenSSH server that ships with Windows 1909 and beneath.
Fortunately, yous tin can work around this problem by specifically telling VS Lawmaking if your SSH host is running Windows by adding the following to settings.json:
"remote.SSH.useLocalServer" : false You tin besides force VS Lawmaking to identify a particular host every bit Windows using the following belongings:
"remote.SSH.remotePlatform" : { "host-in-ssh-config-or-fqdn" : "windows" } A ready has been merged so this problem should be resolved in a version of the server greater than viii.1.0.0.
Enable TCP Forwarding on the remote host
Remote - SSH extension makes utilise 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 message:
open failed: administratively prohibited: open failed If you do see that bulletin, follow these steps to update your SSH server's sshd config:
- Open
/etc/ssh/sshd_configorC:\ProgramData\ssh\sshd_configin a text editor (like Vim, nano, Pico, or Notepad) on the SSH host (not locally). - Add the setting
AllowTcpForwarding yes. - Restart the SSH server. (On Ubuntu, run
sudo systemctl restart sshd. On Windows, in an admin PowerShell run,Restart-Service sshd). - Retry.
Set the ProxyCommand parameter in your SSH config file
If you are behind a proxy and are unable to connect to your SSH host, you may need to use the ProxyCommand parameter for your host in a local SSH config file. You tin can read this SSH ProxyCommand article for an instance of its use.
Ensure the remote machine has cyberspace access
The remote machine must have cyberspace access to exist able to download the VS Code Server and extensions from the Marketplace. See the FAQ for details on connectivity requirements.
Set HTTP_PROXY / HTTPS_PROXY on the remote host
If your remote host is backside a proxy, you may need to set the HTTP_PROXY or HTTPS_PROXY environment variable on the SSH host. Open your ~/.bashrc file add together the post-obit (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 consign HTTP_PROXY=http://username:password@proxy.fqdn.or.ip:3128 export HTTPS_PROXY= $HTTP_PROXY Work around /tmp mounted with noexec
Some remote servers are set upward to disallow executing scripts from /tmp. VS Code writes its install script to the system temp directory and tries to execute it from there. You can work with your organization administrator to determine whether this can be worked around.
Cheque whether a dissimilar shell is launched during install
Some users launch a different crush from their .bash_profile or other startup script on their SSH host because they desire to use a different shell than the default. This can break VS Lawmaking's remote server install script and isn't recommended. Instead, apply chsh to modify your default shell on the remote machine.
Connecting to systems that dynamically assign machines per connectedness
Some systems will dynamically route an SSH connection to i node from a cluster each time an SSH connection is made. This is an upshot for VS Lawmaking because it makes two connections to open up a remote window: the beginning to install or get-go the VS Code Server (or find an already running instance) and the 2d to create the SSH port tunnel that VS Code uses to talk to the server. If VS Lawmaking is routed to a dissimilar machine when it creates the 2d 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 hallmark methods, and then that VS Code's two connections volition be multiplexed through a single SSH connectedness to the aforementioned node.
Contact your system administrator for configuration assist
SSH is a very flexible protocol and supports many configurations. If you run into 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 information virtually the required settings for your SSH host and client. Specific command-line arguments for connecting to your SSH host tin be added to an SSH config file.
To access your config file, run Remote-SSH: Open up Configuration File... in the Command Palette (F1). You tin can and so work with your admin to add together the necessary settings.
Enabling alternate SSH authentication methods
If yous are connecting to an SSH remote host and are either:
- Connecting with 2-factor authentication
- Using countersign hallmark
- Using an SSH key with a passphrase when the SSH Amanuensis is non running or accessible
then VS Lawmaking should automatically prompt you to enter needed information. If yous do not come across the prompt, enable the remote.SSH.showLoginTerminal setting in VS Code. This setting displays the final whenever VS Lawmaking runs an SSH command. You lot can then enter your authentication code, password, or passphrase when the concluding appears.
If you are still having problem, y'all may need to the following properties in settings.json and retry:
"remote.SSH.showLoginTerminal" : true , "remote.SSH.useLocalServer" : false If you are on macOS and Linux and want to reduce how often you have to enter a password or token, you can enable the ControlMaster feature on your local motorcar then that OpenSSH runs multiple SSH sessions over a unmarried connection.
To enable ControlMaster:
-
Add together an entry like this to your SSH config file:
Host * ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 600 -
Then run
mkdir -p ~/.ssh/socketsto create the sockets folder.
Setting upward the SSH Agent
If you lot are connecting to an SSH host using a central with a passphrase, you should ensure that the SSH Agent is running locally. VS Lawmaking will automatically add your key to the amanuensis so you lot don't have to enter your passphrase every time you open a remote VS Code window.
To verify that the amanuensis is running and is reachable from VS Code'due south environment, run ssh-add -l in the terminal of a local VS Code window. You should run into 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 kickoff it. Later on starting the agent, exist sure to restart VS Code.
Windows:
To enable SSH Agent automatically on Windows, start a local Administrator PowerShell and run the following commands:
# Make sure you're running as an Ambassador Set-Service ssh-agent -StartupType Automatic Start-Service ssh-agent Get-Service ssh-agent At present the agent will be started automatically on login.
Linux:
To start the SSH Agent in the background, run:
eval "$(ssh-agent -s)" To commencement the SSH Agent automatically on login, add these lines to your ~/.bash_profile:
if [ -z " $SSH_AUTH_SOCK " ]; then # Cheque for a currently running instance of the agent RUNNING_AGENT= "`ps -ax | grep 'ssh-agent -south' | grep -v grep | wc -50 | tr -d '[:space:]'`" if [ " $RUNNING_AGENT " = "0" ]; then # Launch a new instance of the agent ssh-amanuensis -due south &> .ssh/ssh-agent fi eval `cat .ssh/ssh-agent` fi macOS:
The amanuensis should be running past default on macOS.
Making local SSH Amanuensis available on the remote
An SSH Amanuensis on your local machine allows the Remote - SSH extension to connect to your chosen remote system without repeatedly prompting for a passphrase, only tools like Git that run on the remote, don't take access to your locally-unlocked private keys.
Y'all can see this by opening the integrated final on the remote and running ssh-add -l. The command should list the unlocked keys, but instead reports an fault about not being able to connect to the hallmark agent. Setting ForwardAgent yeah makes the local SSH Amanuensis available in the remote environment, solving this trouble.
You can do this past editing your .ssh/config file (or whatsoever Remote.SSH.configFile is set to - use the Remote-SSH: Open up SSH Configuration File... command to exist sure) and adding:
Host * ForwardAgent yes Note that you lot might want to exist more restrictive and merely set the pick for item named hosts.
Fixing SSH file permission errors
SSH can be strict about file permissions and if they are set incorrectly, you may run across errors such every bit "Alert: UNPROTECTED PRIVATE Fundamental FILE!". There are several ways to update file permissions in gild to fix this, which are described in the sections beneath.
Local SSH file and folder permissions
macOS / Linux:
On your local auto, make sure the following permissions are set:
| Binder / File | Permissions |
|---|---|
.ssh in your user folder | 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. Nosotros recommend using the out of box Windows x OpenSSH Customer.
In this case, make sure that all of the files in the .ssh folder for your remote user on the SSH host is owned by you and no other user has permissions to admission information technology. See 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 motorcar you are connecting to, make sure the following permissions are set:
| Folder / 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 x have been omitted.
Windows:
Run into the Windows OpenSSH wiki for details on setting the appropriate file permissions for the Windows OpenSSH server.
Installing a supported SSH customer
| OS | Instructions |
|---|---|
| Windows ten 1803+ / Server 2016/2019 1803+ | Install the Windows OpenSSH Client. |
| Before 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 expect for the ssh command in the PATH. Failing that, on Windows it will attempt to find ssh.exe in the default Git for Windows install path. Yous can also specifically tell VS Lawmaking where to find the SSH client by adding the remote.SSH.path belongings to settings.json.
Installing a supported SSH server
| Bone | Instructions | Details |
|---|---|---|
| Debian 8+ / Ubuntu 16.04+ | Run sudo apt-get install openssh-server | Run into the Ubuntu SSH documentation for details. |
| RHEL / CentOS 7+ | Run sudo yum install openssh-server && sudo systemctl start sshd.service && sudo systemctl enable sshd.service | See the RedHat SSH documentation for details. |
| SuSE 12+ / openSUSE 42.3+ | In Yast, go to Services Director, select "sshd" in the list, and click Enable. Next go to Firewall, select the Permanent configuration, and under services check sshd. | See the SuSE SSH documentation for details. |
| Windows 10 1803+ / Server 2016/2019 1803+ | Install the Windows OpenSSH Server. | |
| macOS 10.14+ (Mojave) | Enable Remote Login. |
Resolving hangs when doing a Git push or sync on an SSH host
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 use an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to piece of work around the upshot.
Using SSHFS to access files on your remote host
SSHFS is a secure remote filesystem access protocol that builds upwardly from SFTP. Information technology provides advantages over something like a CIFS / Samba share in that all that is required is SSH access to the motorcar.
Note: For performance reasons, SSHFS is best used for single file edits and uploading/downloading content. If you need to use an application that bulk reads/write to many files at once (similar a local source control tool), rsync is a amend choice.
macOS / Linux:
On Linux, y'all can use your distribution's package manager to install SSHFS. For Debian/Ubuntu: sudo apt-get install sshfs
Note: WSL 1 does not support FUSE or SSHFS, then the instructions differ for Windows currently. WSL ii does include FUSE and SSHFS support, then this will change soon.
On macOS, you lot can install SSHFS using Homebrew: brew install sshfs In add-on, if you lot would adopt non to use the control line to mountain the remote filesystem, you can also install SSHFS GUI.
To use the control 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 exist mounted mkdir -p " $HOME /sshfs/ $USER_AT_HOST " # Mount the remote filesystem sshfs " $USER_AT_HOST :" " $HOME /sshfs/ $USER_AT_HOST " -ovolname= " $USER_AT_HOST " -p 22 \ -o workaround=nonodelay -o transform_symlinks -o idmap=user -C This will make your home binder on the remote automobile available under the ~/sshfs. When you are done, y'all tin can unmount it using your Os's Finder / file explorer or by using the control line:
umount " $HOME /sshfs/ $USER_AT_HOST " Windows:
Follow these steps:
-
On Linux, add
.gitattributesfile to your project to strength consistent line endings betwixt Linux and Windows to avoid unexpected issues due to CRLF/LF differences betwixt the 2 operating systems. Run across Resolving Git line catastrophe issues for details. -
Side by side, install SSHFS-Win using Chocolatey:
choco install sshfs -
Once you've installed SSHFS for Windows, you lot can utilize the File Explorer'southward Map Network Bulldoze... option with the path
\\sshfs\user@hostname, whereuser@hostnameis your remote user and hostname / IP. You can script this using the command prompt as follows:net use /PERSISTENT:NO X: \\sshfs\user@hostname -
Once done, disconnect by correct-clicking on the drive in the File Explorer and selecting Disconnect.
Connect to a remote host from the terminal
One time a host has been configured, y'all can connect to it directly from the terminal by passing a remote URI.
For example, to connect to remote_server and open the /code/my_project folder, run:
code --remote ssh-remote+remote_server /code/my_project We need to do some guessing on whether the input path is a file or a binder. If it 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/lawmaking/folder.with.dot
To strength that a file is opened, add --goto or use:
lawmaking --file-uri vscode-remote://ssh-remote+remote_server/code/fileWithoutExtension
Using rsync to maintain a local re-create of your source code
An alternative to using SSHFS to access remote files is to use rsync to copy the unabridged contents of a folder on remote host to your local machine. The rsync command will make up one's mind which files need to be updated each fourth dimension information technology is run, which is far more efficient and user-friendly than using something similar scp or sftp. This is primarily something to consider if you really need to use multi-file or performance intensive local tools.
The rsync command is available out of box on macOS and can exist installed using Linux package managers (for example sudo apt-get install rsync on Debian/Ubuntu). For Windows, y'all'll demand to either use WSL or Cygwin to access the command.
To utilize the command, navigate to the folder you want to store the synched contents and run the following replacing user@hostname with the remote user and hostname / IP and /remote/source/lawmaking/path with the remote source code location.
On macOS, Linux, or within 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/lawmaking/path" " `$ (wslpath -a ' $ PWD ')" You can rerun this command each fourth dimension you desire to get the latest copy of your files and only updates will be transferred. The .git folder is intentionally excluded both for operation reasons and so yous can employ local Git tools without worrying about the land on the remote host.
To push content, reverse the source and target parameters in the command. However, on Windows you should add a .gitattributes file to your project to strength consequent line endings before doing so. See Resolving Git line ending problems for details.
rsync -rlptzv --progress --delete --exclude=.git . "user@hostname:/remote/source/code/path" Cleaning up the VS Lawmaking Server on the remote
The SSH extension provides a command for cleaning upward the VS Code Server from the remote machine, Remote-SSH: Uninstall VS Code Server from Host.... The control does ii things: information technology kills whatever running VS Code Server processes and information technology deletes the folder where the server was installed.
If you desire to run these steps manually, or if the control isn't working for you, you lot can run a script similar this:
kill -9 `ps ax | grep "remoteExtensionHostAgent.js" | grep -v grep | awk '{print $1}'` impale -ix `ps ax | grep "watcherService" | grep -v grep | awk '{print $i}'` rm -rf ~/.vscode-server # Or ~/.vscode-server-insiders The VS Lawmaking Server was previously installed under ~/.vscode-remote so you tin can check that location besides.
SSH into a remote WSL ii host
You lot may want to apply SSH to connect to a WSL distro running on your remote machine. Check out this guide to larn how to SSH into Fustigate and WSL 2 on Windows 10 from an external machine.
Container tips
This section includes some tips and tricks for getting the Remote - Containers extension up and running in different environments.
If you are running into Docker issues or would prefer not to run Docker locally, you may want to try the preview of GitHub Codespaces managed cloud-based environments. Over time this service will support an increasing number of devcontainer.json properties and you can also use its browser-based editor in addition to VS Code.
Docker Desktop for Windows tips
Docker Desktop for Windows works well in most setups, only there are a few "gotchas" that tin cause problems. Hither are some tips on avoiding them:
-
Consider using the new Docker WSL 2 back-end on Windows x (2004+). If you are using Docker Desktop's WSL two back-stop, y'all can you to open folders inside WSL besides as locally. Containers are also shared between Windows and within WSL and this new engine is less susceptible to file sharing issues. Run into the quick start for details.
-
Switch out of "Linux Containers on Windows (LCOW)" fashion. While disabled by default, recent versions of Docker support Linux Containers on Windows (LCOW) that can let yous to use both Windows and Linux containers at the aforementioned fourth dimension. However, this is a new feature, and then you may encounter problems and the Remote - Containers extension only supports Linux containers currently. You can switch out of LCOW fashion at any time by right-clicking on the Docker task bar item and selecting Switch to Linux Containers... from the context bill of fare.
-
Make sure your firewall allows Docker to prepare up a shared drive. Docker but needs to connect between two motorcar local IPs, but some firewall software may still block any drive sharing or the needed ports. Meet this Docker KB article for next steps on resolving this problem.
Here are some tips that applied to older versions of Docker for Windows only should at present be resolved. If you lot run into strage behaviors due to a possible regression, these tips accept solved problems in the past.
-
Use an AD domain account or local administrator account when sharing drives. Do non apply an AAD (email-based) account. AAD (email-based) accounts take well-known issues, as documented in Docker issue #132 and issue #1352. If you must use an AAD account, create a carve up local administrator account on your car that you apply purely for the purpose of sharing drives. Follow the steps in this weblog mail to get everything set up.
-
Stick with alphanumeric passwords to avert drive sharing problems. When asked to share your drives on Windows, yous will exist prompted for the username and countersign of an account with admin privileges on the car. If you are warned nearly an incorrect username or password, this may exist due to special characters in the password. For case,
!,[and]are known to crusade problems. Change your password to alphanumeric characters to resolve. See this issue nigh Docker book mounting problems for details. -
Use your Docker ID to sign in to Docker (not your email). The Docker CLI only supports using your Docker ID, so using your email can cause problems. Come across Docker issue #935 for details.
If you are notwithstanding having trouble, come across the Docker Desktop for Windows troubleshooting guide.
Enabling file sharing in Docker Desktop
The VS Code Remote - Containers extension tin can but automatically mount your source code into a container if your lawmaking is in a binder or drive shared with Docker. If you open a dev container from a non-shared location, the container volition successfully start but the workspace will be empty.
Note that this step is not required with Docker Desktop'south WSL two engine.
To change Docker'south drive and folder sharing settings:
Windows:
- Right-click on the Docker task bar item and select Settings.
- Get to Resource > File Sharing and check the drive(s) where your source code is located.
- If you see a bulletin almost your local firewall blocking the sharing activeness, see this Docker KB article for next steps.
macOS:
- Click on the Docker carte bar item and select Preferences.
- Go to Resources > File Sharing. Confirm that the folder containing your source code is under i of the shared folders listed.
Resolving Git line catastrophe problems in containers (resulting in many modified files)
Since Windows and Linux use different default line endings, Git may written report a large number of modified files that have no differences aside from their line endings. To prevent this from happening, you can disable line ending conversion using a .gitattributes file or globally on the Windows side.
Typically adding or modifying a .gitattributes file in your repository is the most reliable way to solve this problem. Committing this file to source control volition help others and allows you lot to vary behaviors by repository equally appropriate. For example, calculation the following to .gitattributes file to the root of your repository will force everything to be LF, except for Windows batch files that require CRLF:
* text=automobile 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 so if y'all are running into problems, be certain you lot've got a contempo Git client installed. You can add other file types in your repository that require CRLF to this same file.
If you would adopt to however ever upload Unix-mode line endings (LF), y'all tin use the input option.
git config --global cadre.autocrlf input If yous'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 take effect.
Avert setting up Git in a container when using Docker Etch
Come across Sharing Git credentials with your container in the main containers article for information on resolving this result.
Resolving hangs when doing a Git push or sync from a Container
If yous clone a Git repository using SSH and your SSH central has a passphrase, VS Code'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.
Resolving errors about missing Linux dependencies
Some extensions rely on libraries not found in the certain Docker images. See the Containers commodity for a few options on resolving this issue.
Speeding up containers in Docker Desktop
By default, Docker Desktop just gives containers a fraction of your machine capacity. In most cases, this is plenty, but if you are doing something that requires more capacity, y'all can increase retention, CPU, or disk apply.
First, try stopping any running containers yous are no longer using.
If this doesn't solve your trouble, yous may want to see if CPU usage is actually the issue or if there is something else going on. An easy way to check this is to install the Resources Monitor extension. When installed in a container, it provides information about chapters for your containers in the Condition bar.
If you'd like this extension to always be installed, add this to your settings.json:
"remote.containers.defaultExtensions" : [ "mutantdino.resourcemonitor" ] If you determine that you demand to requite your container more of your machine's capacity, follow these steps:
- Right-click on the Docker task bar particular and select Settings / Preferences.
- Go to Advanced to increase CPU, Memory, or Swap.
- On macOS, go to Deejay to increase the amount of deejay Docker is allowed to consume on your car. On Windows, this is located under Advanced with the other settings.
Finally, if your container is doing disk intensive operations or you are but looking for faster response times, see Improving container disk performance for tips. VS Lawmaking's defaults optimize for convenience and universal support, but tin exist optimized.
Cleaning out unused containers and images
If you see an error from Docker reporting that you are out of disk space, you tin can typically resolve this by cleaning out unused containers and images. There are a few ways to do this:
Pick ane: Employ the Remote Explorer
You can delete containers by selecting the Remote Explorer, correct-click on the container you desire to remove, and select Remove Container.
Withal, this does not clean upwardly any images you lot may have downloaded, which tin can ataxia upwards your system.
Option two: Use the Docker extension
-
Open a local window in VS Lawmaking (File > New Window).
-
Install the Docker extension from the Extensions view if not already nowadays.
-
You lot can then become to the Docker view and aggrandize the Containers or Images node, correct-click, and select Remove Container / Epitome.
Option 3: Apply the Docker CLI to pick containers to delete
- Open a local terminal/command prompt (or utilise a local window in VS Lawmaking).
- Blazon
docker ps -ato encounter a list of all containers. - Type
docker rm <Container ID>from this list to remove a container. - Blazon
docker image pruneto remove any unused images.
If docker ps does non provide enough data to identify the container you desire 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-{{.Label \" vsch.quality \" }}\t{{.Label \" vsch.local.binder \" }}" Option four: Use Docker Compose
- Open a local final/command prompt (or use a local window in VS Code).
- Become to the directory with your
docker-compose.ymlfile. - Type
docker-compose downto stop and delete the containers. If you have more than i Docker Compose file, you can specify boosted Docker Etch files with the-fargument.
Option iv: Delete all containers and images that are not running:
- Open a local terminal/command prompt (or apply a local window in VS Code).
- Type
docker system prune --all.
Resolving Dockerfile build failures for images using Debian eight
When edifice containers that use images based on Debian 8/Jessie — such equally older versions of the node:viii prototype — you may encounter the following error:
... W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Incorrect sources.list entry or malformed file) E: Some index files failed to download. They have been ignored, or old ones used instead. ... This is a well known issue caused by the Debian 8 being "archived". More contempo versions of images typically resolve this trouble, often by upgrading to Debian 9/Stretch.
In that location are ii ways to resolve this error:
-
Option 1: Remove whatever containers that depend on the image, remove the paradigm, and and so try building once again. This should download an updated image that is not affected by the problem. See cleaning out unused containers and images for details.
-
Choice 2: If you don't want to delete your containers or images, add this line into your Dockerfile before any
aptorapt-getcontrol. It adds the needed source lists for Jessie:# Add archived sources to source listing if base image uses Debian 8 / Jessie RUN cat /etc/*-release | grep -q jessie && printf "deb http://archive.debian.org/debian/ jessie main \northward deb-src http://archive.debian.org/debian/ jessie main \n deb http://security.debian.org jessie/updates primary \n deb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
Resolving Docker Hub sign in errors when an email is used
The Docker CLI just supports using your Docker ID, so using your e-mail to sign in can cause problems. See Docker issue #935 for details.
As a workaround, utilise your Docker ID to sign in to Docker rather than your email.
Loftier CPU utilization of Hyperkit on macOS
At that place is known consequence with Docker for Mac that can drive loftier CPU spikes. In detail, high CPU usage occurring when watching files and building. If you lot meet high CPU usage for com.docker.hyperkit in Activity Monitor while very little is going on in your dev container, you are probable hitting 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 Automobile or SSH host commodity covers how to setup VS Lawmaking when working with a remote Docker host. This is ofttimes as simple as setting the Docker extension docker.host property in settings.json or the DOCKER_HOST environment variable to a ssh:// or tcp:// URI.
However, you may run into situations where this does not work in your environment due to SSH configuration complexity or other limitations. In this case, an SSH tunnel can be used equally a fallback.
Using an SSH tunnel every bit a fallback selection
You lot can set up an SSH tunnel and forward the Docker socket from your remote host to your local machine.
Follow these steps:
-
Install an OpenSSH compatible SSH client.
-
Update the Docker extension
docker.hostproperty in your user or workspacesettings.jsonas follows:"docker.host" : "tcp://localhost:23750" -
Run the following control from a local final / PowerShell (replacing
user@hostnamewith the remote user and hostname / IP for your server):ssh -NL localhost:23750:/var/run/docker.sock user@hostname
VS Lawmaking volition now be able to attach to any running container on the remote host. You tin can also utilize specialized, local devcontainer.json files to create / connect to a remote dev container.
Once y'all are done, press Ctrl+C in the terminal / PowerShell to close the tunnel.
Notation: If the
sshcommand fails, you may demand toAllowStreamLocalForwardingon your SSH host.
- Open up
/etc/ssh/sshd_configin an editor (similar Vim, nano, or Pico) on the SSH host (not locally).- Add together the setting
AllowStreamLocalForwarding aye.- Restart the SSH server (on Ubuntu, run
sudo systemctl restart sshd).- Retry.
Persisting user profile
You can use the mounts holding to persist the user profile (to keep things like shell history) in your dev container across rebuilds.
"mounts" : [ "source=profile,target=/root,type=book" , "target=/root/.vscode-server,blazon=volume" ], The in a higher place code offset creates a named volume chosen profile mounted to /root, which will survive a rebuild. It next creates an bearding volume mounted to /root/.vscode-server that gets destroyed on rebuild, which allows VS Code to reinstall extensions and dotfiles.
Avant-garde container configuration tips
Run across the Advanced container configuration articles for information on the following topics:
- Adding surround variables
- Adding another local file mountain
- Irresolute or removing the default source code mount
- Improving container deejay 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 inside a container
- Connecting to multiple containers at in one case
- Developing inside a container on a remote Docker Machine or SSH host
- Reducing Dockerfile build warnings
WSL tips
First time outset: VS Code Server prerequisites
Some WSL Linux distributions are lacking libraries that are required past the VS Code server to start up. Yous tin add boosted libraries into your Linux distribution past using its packet managing director.
Debian and Ubuntu
Open up the Debian or Ubuntu WSL trounce to add wget and ca-certificates:
sudo apt-get update && sudo apt-get install wget ca-certificates Alpine
Open the Alpine WSL beat out 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 together bash Selecting the distribution used by Remote - WSL
Remote-WSL: New Window will open the WSL distro registered as default.
To open up a non-default distro, run code . from the WSL shell of the distro to use or use Remote-WSL: New Window using Distro.
With WSL versions older than Windows ten, May 2019 Update (version 1903), the WSL command tin can only use the default distro. For this reason, the Remote- WSL might prompt y'all if you agree to change the default distro.
You can always use wslconfig.exe to change your default.
For example:
wslconfig /setdefault Ubuntu You tin see which distributions you accept installed by running:
wslconfig /l Configure the environment for the server startup
When the Remote WSL extension starts the VS Lawmaking server in WSL, it does non run whatever shell configuration scripts. This was done to avoid that custom configuration scripts can prevent the startup.
If you need to configure the startup environs, you can use the environment setup script as described here.
Configure the environs for the remote extension host
The surround for the remote extension host and terminal are based on the default beat out's configuration scripts. To evaluate the environment variables for the remote extension host procedure, the server creates an case of the default beat out as an interactive login shell. It probes the environment variables from it and uses them every bit the initial environment for the remote extension host process. The values of environment variables therefore depend on what vanquish is configured as the default and the content of the configuration scripts for that shell.
See Unix shell initialization for an overview of each shell's configuration scripts. Nearly WSL distributions have /bin/fustigate configured equally the default trounce. /bin/bash will look for startup files under /etc/profile first and for whatever startup files under ~/.bash_profile, ~/.bash_login, ~/.contour.
To change the default shell of a WSL distro, follow the instructions of this web log postal service.
Fixing problems with the code command not working
If typing code from a WSL terminal on Window does non work because code cannot be institute, you lot may exist missing some key locations from your PATH in WSL.
Bank check by opening a WSL concluding and typing echo $PATH. You should see VS Code install path listed. By default, this would be:
/mnt/c/Users/Your Username/AppData/Local/Programs/Microsoft VS Lawmaking/bin Merely, if you used the Arrangement Installer, the install path is:
/mnt/c/Program Files/Microsoft VS Lawmaking/bin ...or...
/mnt/c/Program Files (x86)/Microsoft VS Lawmaking/bin It'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 account command from the start menu in Windows.
If yous have disabled the path sharing characteristic, edit your .bashrc, add the post-obit, and start a new last:
WINDOWS_USERNAME= "Your Windows Allonym" export PATH= " $PATH :/mnt/c/Windows/System32:/mnt/c/Users/ ${WINDOWS_USERNAME} /AppData/Local/Programs/Microsoft VS Code/bin" # or... # export PATH="$PATH:/mnt/c/Programme Files/Microsoft VS Lawmaking/bin" # or... # export PATH="$PATH:/mnt/c/Program Files (x86)/Microsoft VS Lawmaking/bin" Note: Be sure to quote or escape space characters in the directory names.
Finding problems with the 'lawmaking' control
If typing code from a Windows control prompt does non launch VS Code, you can help us diagnose the trouble past running VSCODE_WSL_DEBUG_INFO=truthful 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, y'all can get more data in the WSL log. When filing an upshot, it is important to always ship the total content of the WSL log.
Open the WSL log by running the control Remote-WSL: Open Log. The log will show in the concluding view nether the WSL tab.
To go fifty-fifty more verbose logging, enable the setting remote.WSL.debug in the user settings.
The server fails to start with a segmentation error
You lot can help usa investigate this trouble 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-wslto determine the Remote-WSL extension binder. -
cdto the path that is returned. - Open the
wslServer.shscript with VS Code,code .\scripts\wslServer.sh. - On the 3rd final line (before
export VSCODE_AGENT_FOLDER="$Dwelling/$DATAFOLDER"), add togetherulimit -C unlimited. - Start the Remote-WSL window running the remote server and look for the segmentation fault.
The core file will exist in the Remote-WSL extension folder from above.
I see EACCESS: permission denied error trying to rename a folder in the open workspace
This is a known problem with the WSL file arrangement implementation (Microsoft/WSL#3395, Microsoft/WSL#1956) caused by the file watcher active past VS Lawmaking. The issue volition but be fixed in WSL 2.
To avoid the effect, set remote.WSL.fileWatcher.polling to true. Yet, polling based has a performance bear upon for big workspaces.
For large workspace y'all may want to increase the polling interval, remote.WSL.fileWatcher.pollingInterval, and command the folders that are watched with files.watcherExclude.
WSL two does non have that file watcher trouble and is not affected by the new setting.
Resolving Git line ending issues in WSL (resulting in many modified files)
Since Windows and Linux apply different default line endings, Git may study a large number of modified files that accept no differences bated from their line endings. To prevent this from happening, yous can disable line-ending conversion using a .gitattributes file or globally on the Windows side.
Typically adding or modifying a .gitattributes file in your repository is the nearly reliable way to solve this trouble. Committing this file to source control volition assistance others and allows y'all to vary behaviors past repository equally appropriate. For example, adding the post-obit to .gitattributes file to the root of your repository will forcefulness 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 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 y'all would prefer to still always upload Unix-style line endings (LF), you lot tin can use the input option.
git config --global core.autocrlf input If you'd adopt to disable line-catastrophe conversion entirely, run the following instead:
git config --global core.autocrlf faux Finally, y'all may need to clone the repository again for these settings to take effect.
Sharing Git credentials between Windows and WSL
If you lot use HTTPS to clone your repositories and have a credential helper configured in Windows, you tin can share this with WSL so that passwords y'all enter are persisted on both sides. (Note that this does non apply to using SSH keys.)
Simply follow these steps:
-
Configure the credential managing director on Windows by running the following in a Windows command prompt or PowerShell:
git config --global credential.helper wincred -
Configure WSL to employ 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-cadre/git-credential-wincred.exe"
Whatsoever password you enter when working with Git on the Windows side volition at present exist available to WSL and vice versa.
Resolving hangs when doing a Git push or sync from WSL
If you 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 use an SSH key without a passphrase, clone using HTTPS, or run git push from the command line to work effectually the upshot.
GitHub Codespaces tips
For tips and questions about GitHub Codespaces, encounter the GitHub Codespaces documentation. You can also check out the known web limitations and adaptations that may impact your Codespaces.
Extension tips
While many extensions will work unmodified, at that place are a few issues that can forbid sure features from working as expected. In some cases, yous tin use some other control to work around the outcome, while in others, the extension may need to be modified. This section provides a quick reference for common issues and tips on resolving them. Yous 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 nigh missing dependencies
Some extensions rely on libraries not found in the basic install of certain WSL Linux distributions. You tin can add additional libraries into your Linux distribution past using its packet manager. For Ubuntu and Debian based distributions, run sudo apt-get install <package> to install the needed libraries. Check the documentation for your extension or the runtime that is mentioned in the error message for boosted installation details.
Local absolute path settings fail when applied remotely
VS Code'south local user settings are reused when you connect to a remote endpoint. While this keeps your user experience consistent, you lot may need to vary absolute path settings between your local machine and each host / container / WSL since the target locations are different.
Resolution: Yous can prepare endpoint-specific settings after y'all connect to a remote endpoint by running the Preferences: Open up Remote Settings command from the Control Palette (F1) or by selecting the Remote tab in the Settings editor. These settings will override whatever local settings you lot accept in place whenever you lot connect.
Need to install local VSIX on remote endpoint
Sometimes y'all want to install a local VSIX on a remote machine, either during development or when an extension author asks you to endeavor out a set.
Resolution: Once y'all have connected to an SSH host, container, or WSL, you can install the VSIX the aforementioned way you would locally. Run the Extensions: Install from VSIX... command from the Command Palette (F1). You lot may as well want to add together "extensions.autoUpdate": false to settings.json to prevent automobile-updating to the latest Marketplace version. Encounter Supporting Remote Development for more than 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 tin can use the vscode.env.openExternal API to resolve this problem. Run across the extension author'due south guide for details.
Clipboard does not piece of 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 tin can switch to the VS Code clipboard API to resolve the problem. Meet the extension author's guide for details.
Cannot access local spider 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 exist blocked.
Resolution: Extensions tin use the vscode.env.openExternal or vscode.env.asExternalUri APIs (which automatically forward localhost ports) to resolve this problem. See the extension author'southward guide for details. As a workaround, use the Forrad a Port command to do so manually.
Webview contents do non appear
If the extension'south webview content uses an iframe to connect to a local spider web server, the port the webview is connecting to may be blocked. In improver, if the extension difficult codes vscode-resources:// URIs instead of using asWebviewUri, content may not appear in the Codespaces browser editor.
Resolution: The extension can use the webview.asWebviewUri to resolve bug with vscode-resource:// URIs.
If ports are being blocked, the best approach is to instead use the webview bulletin passing API. As a workaround, vscode.env.asExternalUri tin be used let the webview to connect to spawned localhost web servers from VS Code. However, this is currently blocked for the Codespaces browser-based editor (only) 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 be blocked.
Resolution: VS Code 1.40 introduced a new vscode.env.asExternalUri API for extensions to programmatically forward arbitrary ports. See the extension author'due south guide for details. As a workaround, you can utilise the Forward a Port command to do then manually.
Errors storing extension data
Extensions may effort to persist global information by looking for the ~/.config/Code folder on Linux. This binder may not be, which tin can cause the extension to throw errors similar ENOENT: no such file or directory, open '/root/.config/Code/User/filename-goes-hither.
Resolution: Extensions can use the context.globalStoragePath or context.storagePath property to resolve this trouble. Meet the extension author's guide for details.
Cannot sign in / have to sign in each time I connect to a new endpoint
Extensions that require sign in may persist secrets using their own code. This code tin fail due to missing dependencies. Even if it succeeds, the secrets volition exist stored remotely, which means yous have to sign in for every new endpoint.
Resolution: Extensions can utilize the keytar node module to solve this problem. See the extension author's guide for details.
An incompatible extension prevents VS Lawmaking from connecting
If an incompatible extension has been installed on a remote host, container, or in WSL, nosotros take seen instances where the VS Code Server hangs or crashes due to the incompatibility. If the extension activates correct away, this can prevent y'all from connecting and being able to uninstall the extension.
Resolution: Manually delete the remote extensions folder by post-obit these steps:
-
For containers, ensure your
devcontainer.jsonno longer includes a reference to the faulty extension. -
Next, use a dissever terminal / command prompt to connect to the remote host, container, or WSL.
- If SSH or WSL, connect to the environment accordingly (run
sshto connect to the server or open WSL terminal). - If using a container, identify the container ID by calling
docker ps -aand looking through the list for an image with the right proper name. If the container is stopped, rundocker run -it <id> /bin/sh. If it is running, rundocker exec -it <id> /bin/sh.
- If SSH or WSL, connect to the environment accordingly (run
-
Once you are connected, run
rm -rf ~/.vscode-server/extensionsfor VS Code stable and/orrm -rf ~/.vscode-server-insiders/extensionsfor VS Code Insiders to remove all extensions.
Extensions that ship or acquire pre-built native modules neglect
Native modules bundled with (or dynamically acquired for) a VS Code extension must be recompiled using Electron'southward electron-rebuild. Yet, VS Code Server runs a standard (not-Electron) version of Node.js, which tin can cause binaries to fail when used remotely.
Resolution: Extensions need to be modified to solve this trouble. They will need to include (or dynamically acquire) both sets of binaries (Electron and standard Node.js) for the "modules" version in Node.js that VS Code ships and then check to meet if context.executionContext === vscode.ExtensionExecutionContext.Remote in their activation function to gear up the correct binaries. See the extension author's guide for details.
Extension only fails on non-x86_64 hosts or Tall Linux
If an extension works on Debian 9+, Ubuntu sixteen.04+, or RHEL / CentOS seven+ 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 code or runtimes that do not support these platforms. For example, the extensions may merely include x86_64 compiled versions of native modules or runtimes. For Alpine Linux, the included native lawmaking or runtimes may not work due to fundamental differences between how libc is implemented in Alpine Linux (musl) and other distributions (glibc).
Resolution: Extensions will need to opt-in to supporting these platforms past compiling / including binaries for these additional targets. It is of import to note that some third-party npm modules may also include native code that can cause this trouble. So, in some cases y'all may need to work with the npm module author to add additional compilation targets. See the extension writer'due south guide for details.
Extensions neglect due to missing modules
Extensions that rely on Electron or VS Code base of operations modules (non exposed by the extension API) without providing a fallback can fail when running remotely. You may see errors in the Developer Tools console like original-fs not beingness found.
Resolution: Remove the dependency on an Electron module or provide a fallback. See the extension author's guide for details.
Cannot access / transfer remote workspace files to local machines
Extensions that open workspace files in external applications may encounter errors because the external application cannot directly access the remote files.
Resolution: If you lot create a "UI" extension designed to run locally, y'all can utilize the vscode.workspace.fs API to interact with the remote workspace filesystem. You can then make this a dependency of your "Workspace" extension and invoke information technology using a command as needed. See the extension author's guide for details on different types of extensions and how to use commands to communicate between them.
Cannot access attached device from extension
Extensions that admission locally attached devices will be unable to connect to them when running remotely.
Resolution: None currently. Nosotros are investigating the best approach to solve this trouble.
Questions and feedback
Reporting issues
If you run into an issue with one of the remote evolution extensions, it'due south of import to collect the correct logs so that nosotros'll be able to help diagnose your issue.
Each remote extension has a command to view its logs.
You can get the Remote - SSH extension logs with Remote-SSH: Show Log from the Command Palette (F1). When reporting Remote - SSH problems, delight also verify if you're able to SSH into your machine from an external final (non using Remote - SSH).
Similarly, y'all can get the Remote - Containers extension logs with Remote-Containers: Show Log.
Similar the ii above, you can get the Remote - WSL logs with Remote WSL: Testify Log. Also check whether your issue is being tracked upstream in the WSL repo (and is not due to the Remote - WSL extension).
If you're experiencing issues using other extensions remotely (for example, other extensions aren't loading or installing properly in a remote context), it'due south 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 only come across Log (Extension Host), this is the local extension host, and the remote extension host didn't launch. This is considering the log aqueduct is created but after 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 non shown in the Output view. This is however helpful information to include in your effect.
Remote question and feedback resources
We take a variety of other remote resources:
- See Remote Evolution FAQ.
- Search on Stack Overflow.
- Add a feature request or report a problem.
Source: https://code.visualstudio.com/docs/remote/troubleshooting
0 Response to "Bind Error Reading Private Key File Not Found"
Post a Comment