Skip to content

Instantly share code, notes, and snippets.

@fsworld009
Last active February 2, 2025 04:06
Show Gist options
  • Save fsworld009/33adb703743520e68c54d6143a297559 to your computer and use it in GitHub Desktop.
Save fsworld009/33adb703743520e68c54d6143a297559 to your computer and use it in GitHub Desktop.
Windows 11 Pro + WSL2

Trying out Windows 11 Pro + WSL2 setup to build dev environment on my Framework 13

Goal:

General travel device (with Windows as host so it can run most of the apps when needed) + WSL2 to setup Linux development environment:

General web dev?

  • VSCode
  • Docker
  • nvm
  • fish, tmux, git...etc
  • KVM? (Possible?)

Installation

Create a installation image to allow local account https://guides.frame.work/Guide/Windows+11+Installation+on+the+Framework+Laptop+13+(AMD+Ryzen%E2%84%A2+7040+Series)/214

Pick local account + password

Post-Installation

  1. Use wire internet to download Framework 13 Driver bundle
    1. After installation, wifi should be available
  2. https://github.com/Raphire/Win11Debloat
  3. IMEs
    1. https://github.com/EasyIME/PIME/releases
    2. https://www.google.co.jp/ime/
  4. https://github.com/Aetherinox/windows-update-killer

Drive encryption

Enabled after loging to MS account

Check encryption status

Run cmd with administrator permission

manage-bde -status C:

Ref: https://4it.com.au/kb/article/check-bitlocker-status-from-the-command-line/

Stuck at 99.9

Pause and resume https://superuser.com/questions/1121447/full-drive-encryption-with-bitlocker-freezes-at-99-9

upload recovery keys with latest computer name

Go to bitlocker settings -> back up your recovery key -> MS account

enable wmic

https://techcommunity.microsoft.com/blog/windows-itpro-blog/how-to-install-wmic-feature-on-demand-on-windows-11/4189530

Find my device

https://answers.microsoft.com/en-us/windows/forum/all/find-my-device-setting-is-turned-on-but-the/736d05b2-146d-4394-8299-e7c45a3f8f80

Need to turn on both "Find my device" and "Location services" so we can locate the device from MS website.

Enable WSL2

https://learn.microsoft.com/en-us/windows/wsl/install

after reboot, type wsl in cmd to finish install

Update kernel

Stable is still 5.x, update to pre-lease kernel https://www.reddit.com/r/wsl2/comments/1ed915b/how_to_upgrade_ubuntu_2404s_linux_kernel_in_wsl2/

but it's still 5.x, the 6.6 is currently pulled off from pre-release

guess we have to use 5.x?

WSL2 Distro Manager

1.8.15+1 broken in Win11 bostrot/wsl2-distro-manager#269

Fedora

Guide: https://github.com/fedora-cloud/docker-brew-fedora/tree/$VERSION/x86_64

  1. Use distro manager to create the instance. The UI provides default user, but it doesn't work
    1. Use https://github.com/fedora-cloud/docker-brew-fedora/blob/41/x86_64/fedora-20241222.tar as rootfs
  2. Enter the instance, follow the guide to install basic packages and create user.

homebrew

https://brew.sh/ Need to install ps command, otherwise brew would fail

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/shellenv.sh: line 18: /bin/ps: No such file or directory
sudo dnf install procps

wslg

Tested firefox, can launch GUI, but problem: missing CJK fonts.

According to https://granule.medium.com/wsl2-gui-app-shortcuts-in-windows-with-wslg-fcc66d3134e7, the desktop file created inside distro will be picked by Windows and displayed in Start menu.

Problem:

Firefox:

  1. can't use anything from hamberger menu microsoft/wslg#1119
    1. has to disable Wayland in Firefox for now
  2. Bad performance with above workaround
  3. CJK fonts still don't work after syncing fonts from windows

Consider the limitation, it's probably better to run GUIs in windows and only use WSL for CLIs. VS Code has good support of working with WSL from Windows.

mount linux drive

luks https://gist.github.com/gtirloni/5b62ad835a06da21a6bd11aa78d3f7c4

Fonts

Since we are using Windows VS Code and Terminal app, the fonts for CLIs and VSCode need to be installed on Windows

choco install hackfont nerd-fonts-Hack dejavufonts

TODO:

  1. CJK Fonts and IME https://www.80shihua.com/archives/2994
  2. Build newer kernel, here's a guide for ubuntu https://learn.microsoft.com/en-us/community/content/wsl-user-msft-kernel-v6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment