error 0x80070002 when launching most commands against WSL2 #10883

Closed
opened 2026-01-31 02:32:47 +00:00 by claunia · 4 comments
Owner

Originally created by @danielkcz on GitHub (Oct 3, 2020).

Environment

Windows build number: 10.0.19041.0
Windows Terminal version (if applicable): 1.3.2651.0
PowerShell: 7.0.1

Steps to reproduce

Running wt top within Powershell while having WSL Ubuntu-20.04 as the default profile.
Specifying -p "Ubuntu-20.04 yields the same result.
Tried several other commands that work when executed manually from bash.

Expected behavior

I want to run wt yarn (among other commands in split panes) to set up my environment for development easily.

Actual behavior

The new terminal opens with the correct profile and only shows the error

image
image
image

I have a feeling that WT is trying to run these commands too soon before WSL is properly initialized.

Originally created by @danielkcz on GitHub (Oct 3, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.19041.0 Windows Terminal version (if applicable): 1.3.2651.0 PowerShell: 7.0.1 ``` # Steps to reproduce Running `wt top` within Powershell while having WSL `Ubuntu-20.04` as the default profile. Specifying `-p "Ubuntu-20.04` yields the same result. Tried several other commands that work when executed manually from bash. # Expected behavior I want to run `wt yarn` (among other commands in split panes) to set up my environment for development easily. # Actual behavior The new terminal opens with the correct profile and only shows the error ![image](https://user-images.githubusercontent.com/1096340/94985523-d93ed780-0557-11eb-8557-c31f6378a927.png) ![image](https://user-images.githubusercontent.com/1096340/94985792-dba23100-0559-11eb-9cac-c83d7200bbcc.png) ![image](https://user-images.githubusercontent.com/1096340/94985665-d55f8500-0558-11eb-9cd1-fe4a01caa423.png) I have a feeling that WT is trying to run these commands too soon before WSL is properly initialized.
claunia added the Resolution-Duplicate label 2026-01-31 02:32:47 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2020):

Yea, that's not exactly how the commandline parameter to wt works. When you pass in foo as the commandline, it doesn't append it to the profile's commandline, it overrides the commandline of the profile. So in your examples, above, the Terminal is literally looking for top.exe, pwd.exe, yarn.exe, when what you really want is wsl -d Ubuntu-20.04 top.

"Add support for appending a commandline to a profile's commandline" is being tracked over in /dup #5528

@zadjii-msft commented on GitHub (Oct 5, 2020): Yea, that's not exactly how the `commandline` parameter to `wt` works. When you pass in `foo` as the commandline, it doesn't _append_ it to the profile's commandline, it _overrides_ the commandline of the profile. So in your examples, above, the Terminal is literally looking for `top.exe`, `pwd.exe`, `yarn.exe`, when what you really want is `wsl -d Ubuntu-20.04 top`. "Add support for appending a commandline to a profile's commandline" is being tracked over in /dup #5528
Author
Owner

@ghost commented on GitHub (Oct 5, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Oct 5, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@danielkcz commented on GitHub (Oct 5, 2020):

Wait, how is wsl going to help me here? I mean sure it will run top inside Powershell, but that's not what I am looking for. I want to set up a one-liner that would line launch a new WT window with several split panes and run some command in each.

I guess I will follow #5528 as that indeed seems the same problem I am facing. Thanks!

@danielkcz commented on GitHub (Oct 5, 2020): Wait, how is `wsl` going to help me here? I mean sure it will run `top` inside Powershell, but that's not what I am looking for. I want to set up a one-liner that would line launch a new WT window with several split panes and run some command in each. I guess I will follow #5528 as that indeed seems the same problem I am facing. Thanks!
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2020):

When you're running a WSL profile, the commandline is technically wsl.exe -d <the distro's name>. So the commandline for the Ubuntu-20.04 profile is wsl.exe -d Ubuntu-20.04. So you definitely could get what you're looking for with the wt parameters, it'll just be V E R B O S E

wt wsl -d Ubuntu-20.04 top ; sp wsl -d Ubuntu-20.04 yarn ; wsl -d Ubuntu-20.04 pwd

(using sp as the short form of split-pane, introduced in #6576)

@zadjii-msft commented on GitHub (Oct 5, 2020): When you're running a WSL profile, the commandline is _technically_ `wsl.exe -d <the distro's name>`. So the commandline for the Ubuntu-20.04 profile is `wsl.exe -d Ubuntu-20.04`. So you definitely could get what you're looking for with the wt parameters, it'll just be V E R B O S E ``` wt wsl -d Ubuntu-20.04 top ; sp wsl -d Ubuntu-20.04 yarn ; wsl -d Ubuntu-20.04 pwd ``` (using `sp` as the short form of `split-pane`, introduced in #6576)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10883