From 752fc791da412e30f5e3109c76c1801d110b5adb Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Tue, 18 Feb 2025 10:23:35 -0500 Subject: [PATCH 1/3] oobe: Let the user know they're in wheel and have passwordless sudo Also include the command to set a password, if they wish. --- wsl-oobe.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wsl-oobe.sh b/wsl-oobe.sh index e406b57..ace2e51 100644 --- a/wsl-oobe.sh +++ b/wsl-oobe.sh @@ -25,7 +25,11 @@ read -r -p 'Enter new UNIX username: ' username /usr/sbin/useradd -m -G wheel --uid $DEFAULT_USER_ID "$username" cat > /etc/sudoers.d/wsluser << EOF -# Ensure the WSL initial user can use sudo +# Ensure the WSL initial user can use sudo without a password. +# +# Since the user is in the wheel group, this file can be removed +# if you wish to require a password for sudo. Be sure to set a +# user password before doing so with 'sudo passwd $username'! $username ALL=(ALL) NOPASSWD: ALL EOF @@ -36,3 +40,6 @@ 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'" From 57f74e8f771562ac6aedf895b894f3b4d9c7d9cb Mon Sep 17 00:00:00 2001 From: David Senoner Date: Sun, 23 Feb 2025 21:18:35 +0000 Subject: [PATCH 2/3] fix typo --- wsl-setup.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsl-setup.spec b/wsl-setup.spec index f8ceaac..429cb1b 100644 --- a/wsl-setup.spec +++ b/wsl-setup.spec @@ -52,7 +52,7 @@ ln -s ..%{_prefix}/lib/wsl-distribution.conf %{buildroot}%{_sysconfdir}/wsl-dist # https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro#systemd-recommendations install -Dpm0644 %{SOURCE6} %{buildroot}%{_tmpfilesdir}/%{name}.conf -# WSL provides a Wayland and PulseAudio docket as well, which are expected to be in +# WSL provides a Wayland and PulseAudio socket as well, which are expected to be in # the user's runtime directory. This configuration sets up the links for each user. install -Dpm0644 %{SOURCE7} %{buildroot}%{_user_tmpfilesdir}/%{name}.conf From 4848826c1cf4827d19e1839429bf629daccaf147 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Fri, 21 Mar 2025 11:38:03 -0400 Subject: [PATCH 3/3] Add distribution icon to wsl-distribution.conf Added in https://pagure.io/fedora-logos/pull-request/27 there's now a logo in a format acceptable to WSL. This adds a dependency on the logos package and configures the icon setting for the distribution. --- wsl-distribution.conf | 4 ++++ wsl-setup.spec | 3 +++ 2 files changed, 7 insertions(+) diff --git a/wsl-distribution.conf b/wsl-distribution.conf index cf1e04d..1bf9706 100644 --- a/wsl-distribution.conf +++ b/wsl-distribution.conf @@ -17,3 +17,7 @@ defaultUid = 1000 # This is used when the user double-clicks to install, or uses # wsl --install --from-file ./Fedora.wsl defaultName = $NAME + +[shortcut] +enabled = true +icon = /usr/share/pixmaps/fedora-logo.ico diff --git a/wsl-setup.spec b/wsl-setup.spec index 429cb1b..a56f58a 100644 --- a/wsl-setup.spec +++ b/wsl-setup.spec @@ -23,6 +23,9 @@ Source7: wsl-setup-user-tmpfiles.conf BuildRequires: systemd-rpm-macros +# Needed for the distribution icon +Requires: system-logos + %description Provides WSL specific configuration files and first-time setup script.