How to create a .wslconfig file to increase memory

Hi all,
I already had this issue in the past, but I still cannot find an answer to it. Im trying to run WebODM with 161 images in ultra-quality mode. I was able to run it with no issues two times and all of a sudden it tells me that I do not have enough memory. I went to the MS website to see the instructions on how to create the .wslconfig file to adjust the memory, but it doesnt say really how to (Im still learning this kind of stuff). Ive watched many YT vids but they are all different.

Can someone send a link of a video of someone doing this? or even somewhere where I can read the proper steps?
Do I need to use notepad to create the file?
After creating it, what do I need to do for it to take effect?

My PC specs are: 16 GB RAM, Processor: Intel core i5-1035G1 CPU @1.00 GHz System type: 64-bit OS


Thanks in advance!!

1 Like

Yep, you use notepad to make it, and it needs to be at the root level of your user folder.

So, it’d be like:

C:\Users\Saijin_Naib\.wslconfig

You’ll need to restart your machine for the Linux Hypervisor service to re-read the config.

I already did exactly what you are telling me, but I `m still having trouble getting more than 4GB of RAM

I’m still pretty noob at this but here is what I’ve set

[wsl2]

memory=48GB

processors=24

swap=48GB

swapfile=o:\temp\wsl-swap.vhdx

pageReporting=false

localhostforwarding=true

nestedVirtualization=false

debugConsole=true

My PC is 64 GB ram and a Core I9-10940
I have my Windows Swap file on an m.2 drive 60757MB in size

1 Like