Before shrinking a WSL2 virtual disk, you need to ensure that WSL2 is not running.
You can check if it’s running with the command wsl.exe --list --verbose in PowerShell:
PS C:\Users\valorin> wsl.exe --list --verbose
NAME STATE VERSION| --- | |
| version: '3.5' | |
| networks: | |
| default: | |
| name: kafka-net | |
| services: | |
| zookeeper: | |
| image: confluentinc/cp-zookeeper:4.1.1 | |
| hostname: zookeeper |