aboutsummaryrefslogtreecommitdiff
path: root/config.sh
diff options
from:
to:
context:
space:
mode:
authorGravatar Jeremy Cline <jeremycline@microsoft.com> 2024-03-01 15:11:59 -0500
committerGravatar Jeremy Cline <jeremycline@linux.microsoft.com> 2025-01-31 10:52:54 -0500
commit4b4a83b33f8eff8f7f13f35b61b4f5464ea4444a (patch)
tree9de25370cf83c665d5f7b51861e5efe1f2144988 /config.sh
parent90f4f3a8201789fbce511db06311afe88993762b (diff)
downloadkiwi-descriptions-4b4a83b33f8eff8f7f13f35b61b4f5464ea4444a.tar.gz
kiwi-descriptions-4b4a83b33f8eff8f7f13f35b61b4f5464ea4444a.zip
Add a WSL definition and config snippets
This introduces the beginnings of an image definition for Windows Subsystem for Linux (WSL). The package list is based on the core and standard grouplists. Some packages, like the kernel, dracut, and so on, are omitted as they are unnecessary. Others, like audit, don't work in the environment. Finally, many packages are omitted since I thought "people probably won't want that", so the package list is completely up for debate. This is just a reasonable starting point that works. Build/test instructions: To build the tarball: $ ./kiwi-build --image-profile=WSL-Base --image-type=tbz --output-dir=./build/ Get it to a Windows host with WSL installed. To boot it with cgroupsv2, add the following to `.wslconfig` in the Windows host home folder: [wsl2] kernelCommandLine=systemd.unified_cgroup_hierarchhy=1 cgroup_no_v1=all This assumes the latest WSL release is installed, at least version 2.4.4: $ wsl --install --from-file .\path\to\the\fedora.tar.xz Alternatively, if you're using something prior to version 2.4.4: $ wsl --import --version=2 Fedora C:\path\to\storage\Fedora\ .\path\to\the\fedora.tar.xz Finally, run it with: $ wsl -d Fedora If you are using 2.4.4+, you will be prompted for a username and then dropped into an interactive shell with that user and passwordless sudo access. If you're using an older version, you need to do: $ wsl -d Fedora -u root # /usr/libexec/wsl/oobe.sh Signed-off-by: Jeremy Cline <jeremycline@linux.microsoft.com>
Diffstat (limited to 'config.sh')
-rwxr-xr-xconfig.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.sh b/config.sh
index fb10431..5034b83 100755
--- a/config.sh
+++ b/config.sh
@@ -33,7 +33,7 @@ rm -f /var/lib/systemd/random-seed
#======================================
# Configure grub correctly
#--------------------------------------
-if [[ "$kiwi_profiles" != *"Container"* ]] && [[ "$kiwi_profiles" != *"FEX"* ]]; then
+if [[ "$kiwi_profiles" != *"Container"* ]] && [[ "$kiwi_profiles" != *"FEX"* ]] && [[ "$kiwi_profiles" != *"WSL"* ]]; then
## Works around issues with grub-bls
## See: https://github.com/OSInside/kiwi/issues/2198
echo "GRUB_DEFAULT=saved" >> /etc/default/grub
@@ -58,7 +58,7 @@ fi
#======================================
# Delete & lock the root user password
#--------------------------------------
-if [[ "$kiwi_profiles" == *"Cloud"* ]] || [[ "$kiwi_profiles" == *"Disk"* ]] || [[ "$kiwi_profiles" == *"Live"* ]]; then
+if [[ "$kiwi_profiles" == *"Cloud"* ]] || [[ "$kiwi_profiles" == *"Disk"* ]] || [[ "$kiwi_profiles" == *"Live"* ]] || [[ "$kiwi_profiles" == *"WSL"* ]]; then
passwd -d root
passwd -l root
fi