WSL Basics
Install WSL
wsl -l -o# Open Powershell & get a list of available Linux distributions available for downloadwsl --install -d Ubuntu-22.04- If
Error: 0x800706d9 There are no more endpoints available from the endpoint mapper, Services -> Host Network Service -> Start, and rerun the commandwsl --install -d Ubuntu-22.04
Uninstall && Remove WSL
- Settings -> Apps -> Installed apps -> Ubuntu -> Uninstall
wsl -l -v# Open Powershell & Get WSL versionwsl --unregister Ubuntu
Keeping WSL Running in the Background (even after closing the terminal window)
wsl --exec dbus-launch truein powershell
Accessing a WSL service from a remote machine (Mirror a WSL ip address and port to that of the host)
wsl hostname -I# Get WSL local IP address (CMD or Powershell)netsh interface portproxy add v4tov4 listenport=11434 listenaddress=0.0.0.0 connectport=11434 connectaddress=172.19.98.153# Run in CMD as administrator- Open the port in
Inbound RulesinWindows Defender Firewall with Advanced Security on Local Computer
How to Shrink a WSL2 Virtual Disk
wsl --shutdown# Open Powershell and shutdown the running WSL distributionsdiskpart
DISKPART> select vdisk file="C:\Users\penl\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc\LocalState\ext4.vhdx"
DiskPart successfully selected the virtual disk file.
DISKPART> compact vdisk
100 percent completed
DiskPart successfully compacted the virtual disk file.
Share this post
Related Posts
Basic tmux Commands for Terminal Sessions
Learn the basic tmux commands to create, list, detach, reattach, rename, and remove terminal sessions.
Xesim Guide for Chinese iPhones
Using Xesim to Manage Multiple Numbers or Data Plans from Different Countries on the Second SIM Card of a Chinese iPhone 17
The Evolution of Infrastructure Management
The evolution of infrastructure management goes from clicking in the cloud console to AI-assisted operations.
Linux Commands Cheat Sheet
Linux commands cheat sheet: comprehensive reference covering basic commands, man pages, and help options.