-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support opening Dev Containers when running from within WSL or SSH #20
Comments
@chrisdias Work around from WSL:
|
While the issue is about WSL, SSH is also mentioned. The SSH flavor of this is tricky, Right now you can use a remote docker host from a container by creating a local devcontainer.json and forwarding the Docker socket. To accomplish what we're describing here, we'd need to automatically create this tunnel and then add extra logic to automate the required alterations to the source code mount point. |
I just tripped over this. I used Remote-SSH to remote into an ubuntu server where I have docker swarm running. I was expecting to be able to then easily launch and connect to a dev container running on the remote server. If the intent of using Remote-Containers is to open a repository on the remote server's docker container for consistency, it seems counter-intuitive that I should have to install git and clone the repository locally before I can then open it in the remote container. I'll try Chuxel's link and see if I can get that to work. If the Remote extensions could handle this natively it would make life a lot easier. |
@mhykes Yeah, the optimized use case is remotely accessing local containers, rather than remotely accessing remote containers. (We don't have Remote OS to Remote Container OS optimized... or Remote - Remote - Containers if you prefer. ) As described in the link above, you can configure local docker to connect to a remote host. At that point attach works. To use devcontainer.json, you have the added step of telling VS Code where to find the source code. |
The ideal would be a situation where all any developer has to install locally is VS Code and the Remote Extensions. More work for preparation would need to be done on the container server, but that's a better use of time because the work only has to be done once and then all developers on the team can benefit. |
I'm currently working with a laradock-based project using Docker Destop with WSL2 backend. My project is entirely within my WSL2 distro i.e. my project files are in WSL2 root filesystem (VolFs) and I prefer to use WSL-side docker binaries to start my containers, because Windows-side docker binaries still mess up file ownership/permissions of my shared volumes. In order to use VSCode properly with Remote Containers in my project, I currently need to open a WSL terminal and bring up my containers manually from there before opening VSCode, because Remote Containers will try to bring them up using Windows-side docker binaries. Please add a feature to allow Remote Containers to bring up containers from within WSL VolFs using WSL-side docker binaries! |
Like @lbssousa, I also have my source files within the WSL2 virtual drive. That's because the performance for shared drive between the WSL2 machine and the host is still very slow compare to the native Linux system. That's the main reason I had a dual boot with Linux just to work on my Javascript projects. Compiling my JS projects under Windows or in WSL2 under Windows is at least 5 times slower. When I try to create the Docker container environment from a devcontainer.json file VSCode v1.42.1 always tries to find in the Windows file system the current folder which is within WSL. And it fails inmediatelly of course. |
My main reason for wanting this is preference for working in bash with WSL. Recently I've found that there are some codebases are not usable with devcontainers on Windows due to the performance overhead of the translation layer when mounting windows volumes in Docker. An example is https://github.com/lawrencegripper/azbrowse/ where hitting Is there any timeline for enabling this scenario? |
Coming from the previous conversation, I'd like to add some points to better translate this into a feature request more pointing to the SSH remote host use case. Feature request When connected through SSH in a remote development session, host’s Docker containers should be discoverable and VSCode should be able to use its Docker daemon for container remote development. Motivation A common setup is SSH-tunneling a Docker daemon of a shared Linux development server. This is described in these pages: When using remote container development many lacks are found, e.g. UID/GID are not updated when using dev containers in this context. Two workarounds are possible:
This feature would bring the user experience to the same level as when using a local Docker daemon. |
This tutorial on how to setup vscode to open containers on a remote virtual machine is not clear Can you make a step by step tutorial/example on how to achieve this? |
Support for opening a remote container is in the April release. |
@egamma Issue mentioned opening in containers through SSH as well .. do you plan on adding support for that as well? |
Same question. It seems only WSL support was added and issue has been closed as resolved. Is the SSH support included as well? Where can we find setup instructions? |
We continue tracking the SSH case in #2994. |
This was the first scenario presented to me at PyCon:
Insiders on Windows (for now)
F1, Select Default Shell -> WSL
Open a terminal inside VS Code, you get the WSL shell on
/mnt/c/...
git clone a repo with a
.devcontainer
folder (andDockerfile
, etc.)cd into the folder and reopen with
code-insiders .
The folder is opened in WSL, which makes sense.
However, what if I want to actually open the folder in a container? The expectation was that I would get the prompt to reopen the folder in the container.
To work around this, I would have to go to a cmd shell or power shell and do the clone/open from there. But, I'm simply using the WSL terminal as my default terminal everywhere on Windows, so this is unnatural.
//cc: @sptramer
The text was updated successfully, but these errors were encountered: