9

Initially posted to the Unix \ linux stack exchange and was pointed here instead.

I recently updated Windows Terminal from 1.2.X to 1.12.X and the Ubuntu install refuses to run, giving the error [process exited with code 4294967295 (0xffffffff)]. The older Ubuntu-18.04 runs fine however.

Entry in settings

    {
        "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
        "hidden": false,
        "name": "Ubuntu",
        "source": "Windows.Terminal.Wsl"
    }

Any ideas on this one?

Command line options tried

  • C:\WINDOWS\system32\wsl.exe -d Ubuntu
  • C:\Windows\system32\wsl.exe -d Ubuntu
  • wsl.exe -d Ubuntu <- this copied from wsl.exe -d Ubuntu-18.04

Background - Windows Terminal & Foreground - Ubuntu terminal

Alistair Hardy
  • 257
  • 1
  • 3
  • 8

8 Answers8

8

This problem is detailed in the bug-report
Unable to launch WSL Ubuntu - The system cannot find the file specified. #12474.

The workaround there was to change the commandline to:

<path_to>/wsl.exe ~ -d Ubuntu.<Version>
MartinJ
  • 3
  • 1
harrymc
  • 455,459
  • 31
  • 526
  • 924
5
  1. Click on arrow down on upper tab bar

  2. Select Ubuntu Profile on left menu

  3. Find Starting Directory option

  4. Overwrite to %USERPROFILE%

  5. Save

Annotated screenshot of Settings dialog, showing steps

Greenonline
  • 2,235
  • 11
  • 24
  • 30
3

So in my case

  1. Open PowerShell terminal
  2. Stop the virtual machine by executing the following command in PowerShell:
wsl --shutdown
  1. Reopen Ubuntu terminal and it ran smoothly.

I hope it will help some of you!

Slokem
  • 31
  • 1
1

Some things to try:

  • First, delete the existing Ubuntu profile (back up settings.json if you want), exit Windows Terminal, and restart. Windows Terminal should detect the Ubuntu installation and recreate the profile automatically. See if the newly autogenerated one works.

If it doesn't:

  • Start PowerShell and try from there:

    wsl -l -v # Sanity check the installations themselves
    wsl ~ -d Ubuntu
    wsl ~ -u root -d Ubuntu
    wsl ~ -d Ubuntu -e bash --noprofile --norc
    

    Does wsl -l -v show the correct profile? If so, do any of the other commands work? If the wsl ~ -d Ubuntu doesn't work but the other two do, then it's likely something in your bash startup config that is causing the issue.

If none of that helps:

  • Was there any /etc/wsl.conf file in the Ubuntu instance? Did it have a Command= line by any chance that could be failing?
NotTheDr01ds
  • 17,574
  • 4
  • 44
  • 81
  • wsl.conf only has `generateResolvConf = false` in it. Tried editing the settings.json as you said and that's had no luck. The `wsl` commands all worked as expected. – Alistair Hardy Feb 28 '22 at 15:15
  • Thank you I tried everything else and the only thing that worked for me was adding -e bash, I have no idea why it's needed (shouldn't be), but ever since adding that it started working – neoakris Apr 03 '23 at 01:01
  • @neokyle Glad to hear that it helped. Was it the `-e bash` alone that worked or the `--noprofile --norc` as well? If the former, then it sounds like the user shell may be changed. If the later, then there's something wrong in the startup files. Either way, we can troubleshoot from there. – NotTheDr01ds Apr 04 '23 at 01:56
  • -e bash was all I needed to add, the weird thing is `sudo cat /etc/passwd | grep $USER` suggests that my shell was configured to use /bin/bash, and I don't recall changing it. Only thing I can think of is that maybe WSL has some other location to determine shell. The only other customization I have is /etc/wsl.conf sets systemd=true – neoakris Apr 04 '23 at 15:44
1

I had the same issue for me changing the executable path worked. see this image

from

C:\Windows\System32\wsl.exe -d Ubuntu-20.04

to

C:\Windows\System32\cmd.exe /C wsl.exe -d Ubuntu-20.04

0

I had the same issue today and found that the drive letter of my disk had changed (to E:). Reverting it back (to D:) and rebooting helped resolve this wsl issue.

Shoan
  • 310
  • 1
  • 3
  • 10
0

similar issue:

  1. ubuntu run istelf fine.
  2. ubuntu dont run from "windows terminal" // error: [process exited with code 4294967295 (0xffffffff)]

fix:

  1. open terminal
  2. terminal setting
  3. select ubuntu profile.
  4. Right hand pane hange command line executable path to folowing C:\Windows\System32\wsl.exe ~ -d Ubuntu or C:\WINDOWS\system32\wsl.exe ~ -d Ubuntu.
  5. save profile, run again.
amin
  • 1
0

This worked for me:

wsl --shutdown
Niikola
  • 101
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 21 '22 at 09:42
  • 1
    [The author's question was caused by a bug that has since been fixed since it was asked six months ago.](https://github.com/microsoft/terminal/issues/12249#issuecomment-1198547733) – Ramhound Sep 22 '22 at 01:58