r/bashonubuntuonwindows • • 21m ago

HELP! Support Request The 5 errors I hit installing a Linux-only AI tool on Windows (WSL), and the fix for each

• Upvotes

I’m not a developer. I tried to install an AI CLI (Composio) on Windows and the installer said “Windows is not supported. Use WSL.” Then I hit error after error. Here’s every fix, so you don’t lose an afternoon like I did:

1. 0x80370102 when installing WSL
Turn on virtualization in BIOS (Intel VT-x / AMD SVM), tick Virtual Machine Platform and Windows Subsystem for Linux in Windows Features, restart, then wsl --update.

2. unzip is required
sudo apt update && sudo apt install -y unzip

3. Could not resolve host (Ubuntu has no DNS)
printf '\n[network]\ngenerateResolvConf = false\n' | sudo tee -a /etc/wsl.conf
then wsl --shutdown in PowerShell, reopen Ubuntu, and:
sudo rm -f /etc/resolv.conf && echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
(On a VPN? Try networkingMode=mirrored + dnsTunneling=true in .wslconfig instead.)

4. command not found right after installing
source ~/.bashrc or close and reopen Ubuntu.

5. Duplicated config key warning
Harmless. Remove the extra lines with sudo nano /etc/wsl.conf.

I made a 4-minute video showing all of it step by step: https://youtu.be/CtT1BxWFLFM

What other errors have you hit with WSL? I’m collecting them.


r/bashonubuntuonwindows • • 2h ago

self promotion I got tired of ext4.vhdx eating my C: drive, so I wrote one tool for clean + backup + compact

7 Upvotes

Deleting files inside WSL doesn't give the space back to Windows. I moved about 20 GB of project data out of my distro to another drive, and ext4.vhdx stayed at 66.7 GB. C: was down to 21 GB free, while the distro itself now held about 33 GB.

The fix is known (clean up, wsl --shutdown, Optimize-VHD), but I was doing it with 8 different scripts and kept forgetting a step. So I merged them into one tool:

  • maint audit / maint space - what is taking the space, per cache rule and per folder, plus how much a compact would return. Deletes nothing.
  • maint clean - cleans caches from a rules file (npx, pip, the journal, Playwright browsers no project pins any more, and so on), with --dry-run
  • maint docker - prunes the build cache and anonymous dangling volumes. Named volumes only if you opt in, and db-data/mysql/postgres-like names are never touched
  • maint.bat full - clean, export the distro to a zstd archive, verify it, rotate old backups, shut WSL down, compact both ext4.vhdx and docker_data.vhdx

Result on that run (clean, then winclean for %TEMP% and the recycle bin, then compact): ext4.vhdx 66.7 -> 42.8 GB, docker_data.vhdx 33.3 -> 31.0 GB, about 3.8 GB from TEMP and the bin, C: free 21 -> 56 GB.

Things to know before you run it:

  • full and compact shut WSL down and need admin (UAC prompt)
  • compact needs the Hyper-V PowerShell module, so on Windows Home only the cleanup and backup parts work
  • the shipped rules.conf is from my machine, review it first. audit and --dry-run are safe to try

Bash on the WSL side, PowerShell 5.1 on the Windows side, one shared config. MIT.

https://github.com/tegos/wsl-maint

There's a demo gif in the README. Feedback welcome, especially from people on Windows Home or with the distro on a non-C: drive.