devcontainers, Docker, SSH credentials, Windows: git-clone fails
Hi everybody,
currently I'm struggling with devcontainers in a Windows 11 environment.
MS Windows 11
IntelliJ: 2026.1
Rancher Desktop as Docker environment
I created a devcontainer.json file and would like to use “Create dev container and clone sources” to create a devcontainer as mounting the sources is terribly slow. The sources are in my git repository and in my native Windows IntelliJ it is no problem to access the repository via SSH.
My problem is this does not work in the devcontainer. I have multiple SSH key files which are configured in SSH config file.
Adding the correct ssh key (not! id_rsa) to the ssh-agent like described here does not work and the git clone fails. Mounting my Windows .ssh folder is no solution as when mounted a wrong owner and wrong file permissions are set and these can't be changed after the mount via terminal.
Is there any way to configure the ssh-agent to pick a specific SSH key for a specifig URL? Any ideas?
Thank you in advance,
Christoph
请先登录再写评论。
Hi Christoph,
Thanks for raising this. Would you mind sharing your IDE logs as described here + a screenshot of the UI error you're facing? You can upload them to our server and share the ID with us.
Best regards,
Petru
Hi Petru,
I created the screenshots and got the relevant parts from the logs, you can find them in
Upload id: 2026_05_18_4RNpMNk5RmWrULuHCbAdAe (files: Screenshot 2026-05-18 212828.png and 3 more)
The problem is the SSH key used for the git clone (last screenshot, ***/.ssh/id_rsa) is the wrong one, I have several configured.
Best regards,
Christoph
Hello, Info. Unfortunately, the pieces of the logs you shared are not relevant to the problem; please share the full log (or only the
idea.logfile from the archive) as requested before.Also, could you please share a non-sensitive part (or structure) of your SSH config? On my side, Git clone with SSH key works without issues, so I believe something may be special in the configuration you use.
Hi,
this is my SSH config in Windows:
and inside the .ssh folder I have the files
I'll provide the complete log this evening.
Thank you for the update; since there is nothing unusual in your config file, I'm waiting for the IDE logs.
idea.log is now available in Upload id: 2026_05_22_GzrMaaxdASE3GpMpJUSPAj (file: idea.log).
Additionally the devcontainer build-log:
The username for the git repository is not “git”, if this helps.
Info, thank you for sharing the logs. Unfortunately, I wasn't able to find any additional relevant information about the problem you encountered there.
On my side, I had a similar problem with the Git clone via the SSH URL using the non-GitHub repository, which resolved itself after rebooting the laptop. Could you please double-check if rebooting helps? Also, please check if the SSH key was correctly added to the SSH agent via the `ssh-add -l` command.
Hi Olga,
I managed to get it running. Originally I did not use the id_rsa SSH certificate for git. After changing and using id_rsa for Git IntelliJ was able to create a new devcontainer and clone the sources into it.
Rebooting my system did not help ;)
Regards,
Christoph
Info, thank you for the update; glad the problem is solved now!
Please let me know if you have any further questions or requests; I'll be happy to help.