From ef26ebb240bf6135daf73e525212e09733e6fc5c Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Mon, 30 Jun 2025 15:37:32 -0400 Subject: [PATCH] oobe: don't append the user section to /etc/wsl.conf Doing this apparently[0] breaks using `wsl --manage --set-default-user` (in my test, wsl says it completed successfully, but actually doesn't do anything at all). Since we set the default UID in wsl-distribution.conf, the default default user will be UID 1000, which we expect to create anyway. While it's nice to support old versions of WSL, I think it's also reasonable to require users to update to ensure things work. For example, most things in Fedora expect cgroups v2, but WSL only removed cgroups v1 in 2.5. If users report an issue and note they're not using the latest WSL stable release I'm just going to tell them to reproduce it on the latest, and if they can't I'm not going to spend any time trying to make it work. [0] https://github.com/microsoft/WSL/pull/13094#issuecomment-2971990351 Signed-off-by: Jeremy Cline --- wsl-oobe.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wsl-oobe.sh b/wsl-oobe.sh index b246933..780dadd 100644 --- a/wsl-oobe.sh +++ b/wsl-oobe.sh @@ -40,13 +40,5 @@ cat > /etc/sudoers.d/wsluser << EOF $username ALL=(ALL) NOPASSWD: ALL EOF -# Set the default user; necessary when this script is manually run in versions -# of WSL prior to 2.4. -cat >> /etc/wsl.conf << EOF - -[user] -default = "$username" -EOF - echo 'Your user has been created, is included in the wheel group, and can use sudo without a password.' echo "To set a password for your user, run 'sudo passwd $username'"