Remote-SSH when connecting to Windows machine: The terminal process failed to launch
See original GitHub issueI haven’t tried SSH from this machine in a couple of weeks, but it used to work. Now each time I try to create a terminal I see:
And this is in the console:
The terminal process failed to launch: A native exception occurred during launch (Unable to start terminal process: CreateProcess failed)```
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (10 by maintainers)
Top Results From Across the Web
How to fix VS Code error with Remote-SSH: "the terminal ...
Immediately after connecting, an error pops up saying the terminal process failed to launch: A native exception occurred during launch (forkpty( ...
Read more >Troubleshoot Terminal launch failures - Visual Studio Code
Try searching in your shell's issue repository. For example, if you are having trouble with WSL, you might find a workaround searching for...
Read more >Working Remotely with Visual Studio Code and SSH
Type logout and press enter to close your connection to the campus Linux computers and return to your own computer's terminal prompt. Linux¶....
Read more >What Do I Do If Error Message "The VS Code Server failed to ...
Check whether the VS Code version is 1.65.0 or later. If so, check the Remote-SSH version. · Open the command panel (Ctrl+Shift+P for...
Read more >Troubleshooting Windows Subsystem for Linux | Microsoft Learn
On Windows 11 open Settings -> System -> Storage -> Advanced storage ... Trying to connect your SSH server is failed with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce, and I have somewhat similar environment as @eamodio .
I’m an employee, feel free to contact me on Teams for more info or to show you a repro. @Tyriar @TylerLeonhardt
For me, it also seems the issue is that the remote PowerShell instance cannot be invoked. I can only make my remote shell work if I use a cmd shell.
Environment
What I tried
In my client machine (ARM64), I opened Settings -> Remote [SSH] -> Terminal, then opened the settings.json file. There are 3 settings items that I can configure:
terminal.integrated.automationShell.windows
terminal.integrated.defaultProfile.windows
terminal.integrated.profiles.windows
The autocomplete offers 3 possible values for any of those 3 items: “PowerShell”, “Command Prompt”, “Git Bash”.
The only one that does not work is PowerShell. I get the same error message:
I am not sure if this is relevant, but as I mentioned in my environment info, the PowerShell I installed comes from the Microsoft Store, so it’s not installed in
C:\Program Files\
, but rather in the folder where all the App Execution Aliases live:%LOCALAPPDATA%\Microsoft\WindowsApps
.With this info, I also tried to create my own custom profile, like this:
But this did not work: When I try to create a new shell instance, the “Custom” option does not show up. I assume App Exec Aliases cannot be executed from VS Code.
Workaround
Set
terminal.integrated.defaultProfile.windows
to “Command Prompt”, and you should be able to connect remotely.Unfortunately, Application Execution Aliases also can’t be executed from within cmd (the pwsh.exe installed from Microsoft Store cannot be invoked). So you’re stuck using cmd.
-OR-
Uninstall the Microsoft Store version of PowerShell, and instead download the MSI installer from here: https://github.com/PowerShell/PowerShell
I’m getting this issue. On Linux with Remote-SSH into Windows Server 2016.
Running a batch file or powershell task just results in a failure.
Tasks.json: