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

wsl: Unknown key 'user.default' in C:\Users\######\.wslconfig:2 #9884

Closed
1 of 2 tasks
timothymowens opened this issue Apr 1, 2023 · 5 comments
Closed
1 of 2 tasks

Comments

@timothymowens
Copy link

Windows Version

10.0.19045.2788

WSL Version

1.1.6.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 22.04.2

Other Software

No response

Repro Steps

Add the following entry into %USERPROFILE%/.wslconfig:

[user]
default=#####

Get the following error when starting up WSL 2:

wsl: Unknown key 'user.default' in C:\Users\#####\.wslconfig:2

Expected Behavior

Based on the documentation for .wslconfig (https://learn.microsoft.com/en-us/windows/wsl/wsl-config), this is a valid entry to define the default user account to use for a WSL 2 session. This has worked just fine until reccently.

Actual Behavior

When launching a WSL 2 session, I get the error:

wsl: Unknown key 'user.default' in C:\Users\#####\.wslconfig:2

Diagnostic Logs

No response

@timothymowens
Copy link
Author

As a side note, the hashes are to redact user details.

@Biswa96
Copy link

Biswa96 commented Apr 1, 2023

The user.default setting is a per-distro setting and can be set in /etc/wsl.conf only. See the example here https://learn.microsoft.com/en-us/windows/wsl/wsl-config#example-wslconf-file

@timothymowens
Copy link
Author

timothymowens commented Apr 1, 2023

I'm using WSL 2. WSL 2 uses %USERPROFILE%\.wslconfig and setting the default user in this file has worked for the past year with no issues, until v1.1.6.0 of WSL was released. Was this a recent change? I see the documentation was just updated on 03/19/2023.

The only workaround I've found so far is uninstalling WSL v1.1.6.0 and then manually installing v1.1.3.0 to fix the issue.

@Biswa96
Copy link

Biswa96 commented Apr 1, 2023

AFAIK, no options have been moved from .wslconfig to wsl.conf. The user.default settings was in wsl.conf since its addition.

@timothymowens
Copy link
Author

I'm guessing then that version 1.1.6.0 added some sort of validation checking for .wslconfig values causing me to see this message. I'll make the proper adjustments on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants