Open pjmattingly opened 1 year ago
@chrmarti, any chance on getting prioritization / milestone indication for this issue? There are a couple of other people who are running into similar (or likely the same issue) and it appears that this gets in the way of using the "clone repository into container volume" on Windows for private repos.
Is there a workaround for this, or any comments? Currently it blocks my whole team and I've spent countless hours trying everything to get around it.
It's essential for us as we use Windows. There is a bug in WSL which means git runs extremely slowly when using a dev container without cloning to the container volume. This same bug has been open since 2019, so looks like it will never be worked on.
Currently Windows users cannot use the "clone repository into container volume" feature on private repos. That in combination with the WSL bug, has likely prevented most Windows users (like us) from running dev containers entirely.
As @JOSEPHGILBY says, it's a bit strange that this has no prioritization. It's the most common workflow for a Windows developer using dev containers, so likely effects most Windows users. With the lack of any errors, new users have likely turned away already.
@kiweezi I had the same problem and it seems that I have found workaround.
Use WSL vscode extension and command (CTRL+SHIFT+P) WSL: Connect to WSL
.
Open Explorer (CTRL+SHIFT+E) and press Clone Repository
blue button.
Follow quick wizard: Repository source -> Repository name -> local folder where to clone
Open Remote Explorer extension and click Open Folder in Container
or use command (CTRL+SHIFT+P) Dev Containers: Open Folder in Container...
Target folder where you cloned it in WSL.
That should be it, your cloned repository should be running inside container now (I haven't noticed any problems with performance so far).
Hope this helps.
@Bajchos you're a saviour! That's a great workaround and super easy to follow steps. It's working as we need now!
Thanks so much.
@Bajchos It's a workaround, but don't these steps lead to the source being stored locally rather than in a volume (which could have performance impacts)?
@JOSEPHGILBY
I've not had any performance issues myself.
I think this is because the files are cloned and modified inside WSL. So in my context, the volume isn't needed.
Use WSL vscode extension and command (CTRL+SHIFT+P) WSL: Connect to WSL.
Outside of that, there may be a performance benefit to having your files in a container volume, rather than local to WSL. But as of now, I'm yet to feel the difference.
Seems from the docker documentation that we normally want to use volumes instead of directory mounts; "volumes are the best way to persist data in Docker." and "bind mounts have limited functionality compared to volumes". I guess "open folder in container" that do work uses directory mount. It may be a solution here, I did not test yet. It's such an basic thing to use docker volumes so this option should be fixed for sure..
Something like:
docker volume create <your-volume>
devcontainer.json:
"workspaceMount": "source=<your-volume>,target=/workspace,type=volume",
"workspaceFolder": "/workspace"
We can then clone repo inside workspace or the volume-path..
I was having a similar issue with HTTPS cloning, even though it was working fine for me using SSH. I determined that this was due to the ls-remote
silently failing while asking for credentials. (See my comment to a similar issue here.)
The reason it was working for me with SSH was because I had an agent running in WSL with my key already loaded. As soon as I removed my key, I was experiencing exactly the issue described here.
So with all of that in mind, I'd recommend the following. Independent of VSCode, are you able to open a WSL terminal and run the git ls-remote
using the SSH URL? If you're prompted for credentials, then this means that WSL is either not running an SSH agent or your key isn't loaded in there.
The easiest thing to do is run an independent SSH agent in WSL and add the key to it. That should allow VSCode to operate as you'd expect. It is possible to have WSL access your Windows-side SSH agent. I'm doing that, but admittedly it's a bit more advanced so most users may not want to deal with it. Let me know if you'd like me to share those details. (But I may be slow in responding!)
I got the same problem and it's still happening since a very, very long time
It is currently impossible to make VSCode clone a private git repository in a container volume on Linux, unless proven otherwise
It apparently is an issue with authentication, because when I do try again, it asks me for my username and password
This is a big issue, can this be escalated @chrmarti ?
fastfetch
malix@malix-pc ~> fastfetch
▅▃▂▄▅▃▄ malix@malix-pc
▂▃▃▄▅▆▆▇▗▆▅▄▃▂▝▝
┏▅▆▆┈▅▇▇▁▚▅▆▍▇▆▇▝▖ bluefin-dx-nvidia:stable 🔐
▅╸▄▃━━▆▁▗▘▝▘▇━╻▗┽▝▖ Bluefin-dx 40 (FROM Fedora Silverblue)
▅▄▄▖▆━▃╸▖╶▄▂▄▖╲▆▃▖▖ Linux 6.10.10-200.fc40.x86_64
▁▃▂ ▝▖┏▗▄┊▅▄▇▘╹▘┒▉▋ 6 hours, 59 mins
▂▃▂▂▃▄▄▆▆▇▅▄▄▂▂▃▘▖▎╲┑▃▎╶▖▁▝▎╻ Forged on May 19 2024
▄▆▂▄▆▇▇▂▇┮▆▁▃▂▂─▃▄┰┈▆▃╺▖▝▊▝▃▘▎┛┫▍▋▍
▇━━╸▋╺╁▝▅▄▄▄▂╼▇▂▃▄▅▆▘━▏▂┭▃▝▖▅▚▍╴▄▋▍ 82JU (LEGION 5 15ACH6H)
▄▆╼┰┅▃▘╻▁▃━╼▖┅▃┈━▅▅┘▁╹▇▎╳━▎▚╸╵▅▃▗▋ AMD Ryzen 7 5800H (16) @ 4.46 GHz
╸┎╌▆▆┗╺▘▘▖╸▇┗▖▅▂▎┷▂━╴┒╴┞╏╵▖▚▃╴┍▚▗ NVIDIA GeForce RTX 3060 Mobile / Max-Q
┇▗┉╀┴╌▚▗▏┘╶┴▉▖▖╺▅┏▄▂╴┈┅▗▗━▏▝╱╱▘▘ AMD Radeon Vega Series / Radeon Vega Mobile Series [Integrated]
▁▊▍▍╶┊╱▝┅╶╼┲┕┨▌▅╱╴▗▘└▏╄▝▗▆▘▂▚▄ 8.12 GiB / 13.49 GiB (60%)
╸┛▖╿▍╎▊┼┏┉╇▇┓▗▊▋┢╶┱▍▘┯╴┈▚╲▃▆▗▃▃▁ 59.27 GiB / 952.60 GiB (6%) - btrfs [Read-only]
▁▁┠▖▍▃▃▃▆▅▄▄▘▄▊┨╱╸╵▗╺▃┚┛┈┫▝╲▗▃┣▁╸ 1920x1080 @ 165 Hz (as 1536x864) in 15" [Built-in] *
▃▃▃╱▘▃┒▗┦▅▗▚╋▂▂▝╺╱▆▂╼┻┏▄┗▖┈▊▖▉┊▋ 2560x1440 @ 144 Hz (as 1712x963) in 27" [External]
╵▅▃▃▃┎▗▘▉▌╺╹╸▗▘▅▅┍┛╱▖┃▄▄▗▋▌▋╍▏ 100% [AC Connected]
▉▂▘▘▃▄▖▖▆▅┈┍▄▃▄▄▄▗▍▅▖▄▘▎▚╲▏▌┺
▍▘▂▗▗ ▎▆▖▎▆▘ ▝▌▝╱▃▘▄▍▗▅ GNOME 46.5
▖▁╏▌ ▘▄▝▎ ▅▅━┑▖ ▄▄▅▂▘▉▃ Mutter (Wayland)
▝▌╆▎ ╴▗▆▇▅╍▄▌ ▘ fish 3.7.0
▍▏▝▁▆▌┃▏▁▆┆▋▅▇▅ Ptyxis 46.7
▋▌▅┛┰▇━▁━▅▅▅▅▅▆ 2298 (rpm), 60 (flatpak), 58 (brew)
▄▃▃▂▃▂▘▅▘
This workaround is better than https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2024833120 : cloning the git repository in the container volume instead of in WSL (which is optimal)
Remote Repositories: Open Remote Repositories...
Dev Containers: Continue Working in Container Volume
Adaptation from https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2024833120
Important Precision : cloning the git repository locally instead of the container volume (which is suboptimal) On Linux VSCode, there is currently no known way to clone a git repository in a container volume instead of locally (see https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2438406744) if you found one, please mention me so I can update this comment
Git: Clone
(clone locally)Dev Containers: Reopen in Container
I'll connect the terminal's input to the git clone command. A better approach would be to use GIT_ASKPASS and show that in VS Code's input box UI, but that is more involved.
@chrmarti has this been solved?
As in "it works in VSCode out of the box" ?
If not, please reopen this issue
For now, it seems that it is impossible to make VSCode clone private repositories in container volume (pleas read https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2438570689)
Here are the reproduction steps:
- Configure github for public/private key access
- Configure the key with a passphrase
- In VS Code, Open command palette
- enter: Dev Container: Clone Repository in Container Volume
- Observe no response
This is now available in Dev Containers 0.390.0-pre-release. You can click the link in the progress notification in the lower right of the window to reveal the log terminal and that now forward keyboard input to git clone
while that is running. Please give that a try and let me know if that makes it work for you. Thanks.
Just tested, it is not working
If this is a new issue and there is no known duplicate, please let me know so I can create it
>Dev Containers: Clone Repository in Container Volume...
https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2438406744
▅▃▂▄▅▃▄ malix@malix-pc
▂▃▃▄▅▆▆▇▗▆▅▄▃▂▝▝
┏▅▆▆┈▅▇▇▁▚▅▆▍▇▆▇▝▖ bluefin-dx-nvidia:stable 🔐
▅╸▄▃━━▆▁▗▘▝▘▇━╻▗┽▝▖ Bluefin-dx 40 (FROM Fedora Silverblue)
▅▄▄▖▆━▃╸▖╶▄▂▄▖╲▆▃▖▖ Linux 6.11.3-200.fc40.x86_64
▁▃▂ ▝▖┏▗▄┊▅▄▇▘╹▘┒▉▋ 11 hours, 29 mins
▂▃▂▂▃▄▄▆▆▇▅▄▄▂▂▃▘▖▎╲┑▃▎╶▖▁▝▎╻ Forged on May 19 2024
▄▆▂▄▆▇▇▂▇┮▆▁▃▂▂─▃▄┰┈▆▃╺▖▝▊▝▃▘▎┛┫▍▋▍
▇━━╸▋╺╁▝▅▄▄▄▂╼▇▂▃▄▅▆▘━▏▂┭▃▝▖▅▚▍╴▄▋▍ 82JU (LEGION 5 15ACH6H)
▄▆╼┰┅▃▘╻▁▃━╼▖┅▃┈━▅▅┘▁╹▇▎╳━▎▚╸╵▅▃▗▋ AMD Ryzen 7 5800H (16) @ 4.46 GHz
╸┎╌▆▆┗╺▘▘▖╸▇┗▖▅▂▎┷▂━╴┒╴┞╏╵▖▚▃╴┍▚▗ NVIDIA GeForce RTX 3060 Mobile / Max-Q
┇▗┉╀┴╌▚▗▏┘╶┴▉▖▖╺▅┏▄▂╴┈┅▗▗━▏▝╱╱▘▘ AMD Radeon Vega Series / Radeon Vega Mobile Series [Integrated]
▁▊▍▍╶┊╱▝┅╶╼┲┕┨▌▅╱╴▗▘└▏╄▝▗▆▘▂▚▄ 6.77 GiB / 13.49 GiB (50%)
╸┛▖╿▍╎▊┼┏┉╇▇┓▗▊▋┢╶┱▍▘┯╴┈▚╲▃▆▗▃▃▁ 61.57 GiB / 952.60 GiB (6%) - btrfs [Read-only]
▁▁┠▖▍▃▃▃▆▅▄▄▘▄▊┨╱╸╵▗╺▃┚┛┈┫▝╲▗▃┣▁╸ 2560x1440 @ 144 Hz (as 2048x1152) in 27" [External] *
▃▃▃╱▘▃┒▗┦▅▗▚╋▂▂▝╺╱▆▂╼┻┏▄┗▖┈▊▖▉┊▋ 1920x1080 @ 165 Hz (as 1536x864) in 15" [Built-in]
╵▅▃▃▃┎▗▘▉▌╺╹╸▗▘▅▅┍┛╱▖┃▄▄▗▋▌▋╍▏ 100% [AC Connected]
▉▂▘▘▃▄▖▖▆▅┈┍▄▃▄▄▄▗▍▅▖▄▘▎▚╲▏▌┺
▍▘▂▗▗ ▎▆▖▎▆▘ ▝▌▝╱▃▘▄▍▗▅ GNOME 46.5
▖▁╏▌ ▘▄▝▎ ▅▅━┑▖ ▄▄▅▂▘▉▃ Mutter (Wayland)
▝▌╆▎ ╴▗▆▇▅╍▄▌ ▘ fish 3.7.0
▍▏▝▁▆▌┃▏▁▆┆▋▅▇▅ Ptyxis 46.7
▋▌▅┛┰▇━▁━▅▅▅▅▅▆ 2294 (rpm), 62 (flatpak), 58 (brew)
▄▃▃▂▃▂▘▅▘
@Malix-Labs Your screenshot shows a "Username" text input box at the top of the window. Does that not work?
@chrmarti no, username and passwords login has been deprecated in 2021 from the github api
It might expect a token as the password. Is that not what you expect? What does it ask you for when you git clone
the repository in a local terminal?
@chrmarti
It might expect a token as the password
Yes, this is the whole point of that opened issue
Is that not what you expect?
You noticed that the VSCode GUI asks for a password, not a passphrase Inputting the passphrase in the password input doesn't work either
Could you please try to reproduce it on a Linux machine ? It is a simple 2 steps process : https://github.com/microsoft/vscode-remote-release/issues/9163#issuecomment-2452708405
Provides a workaround based on Git Personal Access Tokens.
I know the OP said "key pair with passphrase" but because the vscode clone logic is using the HTTPS protocol, the correct approach for system to system authn/authz is to use a webauth token.
Based on comments in this issue thread, I took the pre-release version of DevContainers. With this vanilla configuration, attempting to clone a private repo into a container volume still hangs on this command:
git ls-remote https://github.com/<YourGitID>/<YourGitRepo>.git
I am not certain but it seems the clone repo to volume logic is trying to launch a config/setup container that doesn't have access to the necessary git authn/authz credentials. This workaround gives it and other containers the necessary credential access.
Here's what I did to resolve. Note this is with HTTPS and GIT acess tokens because the clone repo logic is using HTTPS.
at github.com, configure a fine grained personal access token with broad read/write access
from Windows, open a WSL prompt (powershell->wsl)
cd ~
at WSL prompt, configure git to use a globally available credential helper with a persistent credential store
git config --global credential.helper store
copy your git authn/authz token to the clipboard
back at the WSL prompt, re-enter the failing command from above:
git ls-remote https://github.com/<YourGitID>/<YourGitRepo>.git
the git credential helper will prompt for userID and password (authentication token)
the clone repo in container volume command should now work and the credential helper with its store should be persistent and available to all containers.
Hope this works and helps.
No idea if this would work on Linux, but thanks for sharing this workaround
Would be nice if it wouldn't required though, looking forward for a fix :)
No idea if this would work on Linux, but thanks for sharing this workaround
Would be nice if it wouldn't required though, looking forward for a fix :)
I don't think there's anything in the workaround that is windows specific or dependent. Give it a try it by replacing all steps that are "do at WSL prompt" with "do at Linux prompt."
@Malix-Labs The screenshot shows you are using https
, maybe you used the GitHub repository picker in VS Code, that always gives you https
. Try copying the ssh connection string from the GitHub repository page and paste that when asked for the repository.
I just found that you then get stuck later when git clone
needs the passphrase. This needs more investigation.
As a workaround you could add your key to the local ssh-agent
which gets automatically forwarded for Dev Containers. Run ssh-add <path to private key>
locally to do so.
Type: Bug
1) Configure github for public/private key access 2) Configure the key with a passphrase 3) In VS Code, Open command palette 4) enter: Dev Container: Clone Repository in Container Volume 5) enter name of private repo (i.e., pjmattingly/obi-wan) that is secured by the key 4) Observe no response
Looking at the Dev Container console (?) the following output is shown:
Which then hangs with no response (i.e., after 10+ minutes of waiting with no response); Perhaps it's waiting to resolve a passphrase prompt that is never shown?
Attempting to clone with ssh is more instructive:
Note that this command completes correctly in a VS Code terminal:
(note that branch names have been redacted)
Then also, cloning the repo via git without ssh also works correctly.
I had followed this guide to setup the ssh-agent and register my key-pair: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement.
Then also, to get VS-Code to correctly query the running ssh-agent, the environment variable
GIT_SSH
was set (GIT_SSH=C:\WINDOWS\System32\OpenSSH\ssh.exe
); See these discussions:https://groups.google.com/g/git-for-windows/c/eCH80oJTL9A?pli=1 https://github.com/PowerShell/Win32-OpenSSH/issues/1136#issuecomment-382671392 https://github.com/PowerShell/Win32-OpenSSH/wiki/Setting-up-a-Git-server-on-Windows-using-Git-for-Windows-and-Win32_OpenSSH
So, it seems as if the Dev Containers addon is not properly querying the running ssh-agent and is likely not parsing environment variables related to ssh and git.
Extension version: 0.321.0 VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z) OS version: Windows_NT x64 10.0.22621 Modes:
System Info
|Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700K (20 x 3610)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|63.79GB (33.40GB free)| |Process Argv|--crash-reporter-id 131765d7-dc5e-4dfb-b6ae-912ece1e4ed1| |Screen Reader|no| |VM|40%|
A/B Experiments
``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30856253 vscaat:30438848 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 3biah626:30602489 f6dab269:30613381 a9j8j154:30646983 showlangstatbar:30737416 a2ce3375:30757347 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 synctok:30869157 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixtcf:30871695 pythonregdiag2:30871582 pyreplss2:30879913 pythonmypyd1:30879173 pythoncet00cf:30874137 pythontbext0:30879054 ```