Quick tip I wish was easier to find: how to get access to your WSL2 files when you’re not currently running Windows and need to access a script that’s stored there.
- Go to
Users/<USERNAME>/AppData/Local/Packages/
- Enter either
CanonicalGroupLimited...
orTheDebianProject...
, depending on whether you got Ubuntu or Debian from the Store - Your rootfs is in
LocalState/ext4.vhdx
You can mount it with libvhdi:
$ sudo apt install vhdiutils
$ sudo vhdimount ext4.vhd /mnt/vhd
$ sudo mount -o ro /mnt/vhd/vhd1 /mnt/wsl