From the host, edit the file c:\Users\<user>\.wslconfig
and append:
[wsl2]
memory=<size>
To create backups of existing WSL images, first ensure that WSL is not running
(wsl --shutdown
).
Then, run:
wsl --export <NAME> "$env:userprofile\WSL\Images\<NAME>_$(date -f yyyyMMdd_HHmmss).tar"
To make files in the host and guest accessible from within and outside the
virtualised environment, respectively, set the following in /etc/wsl.conf
:
[interop]
enabled=True
Note that this will reduce performance within the image.