Skip to content
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

remote container error - Terminal failed to launch #2350

Closed
KennyChen0909 opened this issue Sep 28, 2020 · 12 comments
Closed

remote container error - Terminal failed to launch #2350

KennyChen0909 opened this issue Sep 28, 2020 · 12 comments
Milestone

Comments

@KennyChen0909
Copy link

I have a customer trying to launch remote containers through VSCode to a linux docker system and receive a Terminal failed to launch error despite being able to connect to the docker server and view containers.

image

From the screenshot, it seems that VSCode is trying to use a local powershell terminal when it should use a remote bash terminal.

From this document: https://code.visualstudio.com/docs/remote/ssh#_opening-a-terminal-on-a-remote-host
Opening a terminal on the remote host from VS Code is simple. Once connected, any terminal window you open in VS Code (Terminal > New Terminal) will automatically run on the remote host rather than locally.

Can we know is there any settings needs to be noticed to make it open bash on remote?

@bwateratmsft
Copy link
Collaborator

@KennyChen0909 Try installing the Docker extension in workspace mode instead of UI mode (in your scenario, it will read "Install in SSH..." instead of "Install in WSL...":

image

@karolz-ms For one thing we should be warning when this is attempted--I thought we already were but maybe that code is misbehaving. However, I'm starting to doubt the value of supporting UI mode at all. It seems like 95%+ of the time users want it to be in workspace mode, but even though workspace mode is preferred (and, package.json explicitly defines it as preferred), it is not the default until the extension is installed in the remote workspace. What do you think?

@karolz-ms
Copy link
Contributor

@bwateratmsft agreed. I am re-reading the extensionKind docs and I am having hard time coming up with a situation where Docker extension would want to run as an UI extension.

@bwateratmsft
Copy link
Collaborator

The only scenario I can think of is running a container locally and attaching to it. You'd want the Docker extension to stay pointing at the host (i.e., in UI mode, here), but VSCode within the container.

@karolz-ms
Copy link
Contributor

karolz-ms commented Sep 28, 2020

Good point. Still, making the extension workspace-only is probably a good tradeoff. If one needs to work with Docker inside the container, they can install Docker CLI into it and map the Docker socket to the host; this is already documented

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Sep 29, 2020

Oh, bonus bug. Even in workspace mode this does not work.

I opened #2356 to track removing UI mode; I'll keep this as the bug to fix for this not working at all in workspace mode.

@bwateratmsft bwateratmsft self-assigned this Sep 29, 2020
@bwateratmsft bwateratmsft added this to the 1.7.0 milestone Sep 29, 2020
@bwateratmsft bwateratmsft added the remote VS Code remote label Sep 29, 2020
@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Sep 29, 2020

@alexr00 The task execution is executing in the right place (on the remote Linux server) but trying to use the wrong shell (powershell). This only happens if no workspace or workspace folder is open. Our code for this is here. Any ideas what's going wrong? Is there an option we're forgetting to pass?

@KennyChen0909
Copy link
Author

@bwateratmsft Do we have a workaround for my customer for this issue?

@alexr00
Copy link
Member

alexr00 commented Sep 30, 2020

@bwateratmsft I will need to debug and see. There's nothing obvious I can think of.

alexr00 added a commit to microsoft/vscode that referenced this issue Sep 30, 2020
Previous behavior was to fallback to local. It makes more sense to fallback to the the first remote details instead
Related to microsoft/vscode-docker#2350
@alexr00
Copy link
Member

alexr00 commented Sep 30, 2020

Looks like we were falling back to the local details when there wasn't a folder open. It makes more sense to fallback to the first remote's details instead. Change has been pushed to VS Code. Please test it in insiders once it is available!

@bwateratmsft
Copy link
Collaborator

Thank you for the fast fix as always @alexr00! I'll try it out in Insiders ASAP.

@KennyChen0909 As a workaround, if you open any folder in the remote window (even an empty one) with File -> Open Folder, it should cause the commands to start working.

meganrogge pushed a commit to microsoft/vscode that referenced this issue Oct 1, 2020
Previous behavior was to fallback to local. It makes more sense to fallback to the the first remote details instead
Related to microsoft/vscode-docker#2350
@bwateratmsft
Copy link
Collaborator

@alexr00 everything seems to be working perfectly now, thank you!

@KennyChen0909 I'm going to close this as fixed since there's no additional work to be done in the Docker extension; I assume the fix should be available in VSCode 1.50.0; it is in Insiders now.

@bwateratmsft
Copy link
Collaborator

This is now fixed in VSCode 1.50.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants