3

I just installed Windows 11 Preview.

Windows 11 Pro
21H2
‎2021-‎07-‎02
version   22000.51
Windows Feature Experience Pack 421.16300.0.3

Since then, I have been getting a Windows PowerShell window with an error message on every boot:

Encountered errors while loading user settings

Could not find your default profile in your list of profiles - using the first profile. Check to make sure the "defaultProfile" matches the GUID of one of your profiles.

Screenshot of error message above

It seems it's running in Windows Terminal, which I have installed. I checked settings.json, but it seems to me like defaultProfile is filled in correctly and when I open a terminal of that profile later it works just fine.

    "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
            {
                "cursorShape": "filledBox",
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory": "\\\\wsl.localhost\\Ubuntu\\home\\august"
            },

How do I solve this new problem?

August Janse
  • 185
  • 1
  • 13
  • 3
    This issue sounds similar to [what people encountered in this thread](https://github.com/microsoft/terminal/issues/6946). [One suggestion](https://github.com/microsoft/terminal/issues/6946#issuecomment-789476284) is to delete the `settings.json` file and allow it to generate a new one. Take a backup of your file first just in case. Another [possible solution](https://github.com/microsoft/terminal/issues/6946#issuecomment-723837559) is to disable and reenable WSL. – MC10 Jul 02 '21 at 06:01
  • Are you attempting to run PowerShell within WSL? I would also try removing the settings.json and performing a Reset of Windows Terminal; Be sure you are running the current version of Windows Terminal. This issue doesn’t appear to be directly linked to Windows 11 but is simply a bug with WSL and Windows Terminal (but Windows 11 incompatibility is still a possibility) so downgrading to your previous version might be necessary to debug this issue – Ramhound Jul 02 '21 at 06:04
  • im having the same issue aswell. i can't access my ubntu 18.04 WSL. How did everyone else solve this issue? Where are my files so I can backup? – Patoshi パトシ Nov 07 '21 at 18:17

6 Answers6

3

This happened to me after I had updated PowerShell version, the fix was simple:

  1. Go to "Settings" -> "Profiles" -> "Defaults"
  2. Select some different shell in "Startup" -> "Default profile" dropdown and press save
  3. Select back your preferred shell in "Startup" -> "Default profile" dropdown and press save
ujeenator
  • 131
  • 4
1

i think if opened as admin might change the outcome- try to open the terminal as a regular user first - might solve it, as the error states that the current user is not part of the default profile - another way would be to go to actual user profile or Dafualtuser group mentioned in the error and edit the permissions there, i believe you can also solve it by going the the actual terminal file - right click and either add you current user to the list of users with full permissions or change the owner of the file - also posted by microsft to change the profile you can also 1.first open the Windows Terminal as admin 2 next click on the down arrow button from the top bar, and click/tap on the Settings -or press Ctrl + to see the settings,(see screenshot below)

https://i.stack.imgur.com/OAcVD.jpg

3 press the startup in the left pane. (see the screenshot below) https://i.stack.imgur.com/0G4Cv.jpg

4 Select the shell profile (for example : "Windows PowerShell" or "Command Prompt") you want to use as the Default profile in the drop menu and simply reselect powershell.

5 dont forget to click/tap on Save at the bottom right.

6 You should now close the Settings tab and reopen Windows Terminal and it will work

0

I tried the solution suggested by MC10 in the comments, deleting my settings.json file, but it had no effect. As I recall, this problem went away by itself after a few more months in the Windows Insider Dev Channel. I can only assume that an update fixed it.

Windows 11 Pro Insider Preview
Version Dev
‎2021-‎11-‎08
22494.1000
Windows Feature Experience Pack 1000.22494.1000.0
Windows Terminal 1.11.2921.0
August Janse
  • 185
  • 1
  • 13
0

go to

Terminal open new tab and select settings or press ctrl + , in Default profile select the menu select one scroll down and select Save reopen Terminal will not show error again

Muhd_Mubi
  • 1
  • 1
  • Could you add a source for the quote? – mashuptwice Dec 05 '22 at 18:36
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://superuser.com/help/whats-reputation) you will be able to [comment on any post](https://superuser.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/1160259) – Rohit Gupta Dec 05 '22 at 19:45
0

The correct fix is to generate a new guid for the profile and edit the settings.json file. Replace the incorrect guid with the new one you generate.

You can run [guid]::NewGuid() in PowerShell to generate a GUID for your custom profile. You can also use the online GUID https://www.guidgenerator.com/ or for other command lines, use the UUID https://github.com/uuidjs/uuid.

Source https://learn.microsoft.com/en-us/windows/terminal/customize-settings/profile-advanced

  • 2
    Welcome to SU. Please see the [guidelines for answering](https://superuser.com/help/how-to-answer) in the [Help](https://superuser.com/help). It's perfectly fine to point to external resources, but your answer should contain the meat of the resource. This because if the link target disappears for any reason (as MS resources often do...), the answer becomes useless. Please [edit](https://superuser.com/posts/1777748/edit) your answer to add the missing advice. – Peregrino69 Apr 06 '23 at 15:02
-1

If the problem is a messed up settings file (maybe a curly bracket got misplaced somewhere or something), you can access a fresh default config by clicking the dropdown next to the tabs, and alt + click on settings. This brings up defaults.json (Just clicking without holding alt brings up the regular settings menu.)

Then copy everything from the defaults.json and use it to replace the other settings.json file.

Another thing you might try if that doesn't work, is in Windows settings, go to Apps, and find the entry for Windows Terminal. Click it to expand, then click 'Advanced Options'. You'll see two options to 'Repair' and 'Reset' the app which would be worth trying, in that order.

ThioJoe
  • 21
  • 3