11

I am completely new to Docker and Linux Subsystem on Windows [Ubuntu 22.04.1], which requires changing the CPU and RAM used in Docker, and I'm trying resolve a Parallel Computing on Windows Problem; however, as noted in the troubleshooting guide and on the Docker Settings' Advanced suboption in Resources, I need to change the .wslconfig file:

Any advice on how to fix this?

8
  • Since it’s missing you can create it, if the contents are invalid, it will be ignored. If the file is missing or malformed (improper markup formatting), WSL will continue to launch as normal without the configuration settings applied. which is from the link you provided
    – Ramhound
    Commented Jan 28, 2023 at 3:27
  • @Ramhound, so if I create the folder, would I then be able to change the CPU and RAM used so I can proceed with the parallel computing step from the first link? Is there anything I should put in the folder? Docker does not let me change the CPU or RAM usage unless I change .wslconfig
    – ineedhelp
    Commented Jan 28, 2023 at 4:30
  • @Ramhound apologies for the follow up comment, at the bottom of the microsoft link there is an example, what type of file should I save it as and for an Ubuntu subsystem would the CPU I want it to use = 1?
    – ineedhelp
    Commented Jan 28, 2023 at 4:33
  • The filename is .wslconfig
    – Ramhound
    Commented Jan 28, 2023 at 5:30
  • @Ramhound and the file type is a text document? processors = CPU?
    – ineedhelp
    Commented Jan 28, 2023 at 5:34

1 Answer 1

24

Any advice on how to fix this?

  1. Create file: %UserProfile%\.wslconfig
  2. Within %UserProfile%\.wslconfig, paste:
    [wsl2]
    memory=4GB # Limits VM memory in WSL 2 to 4 GB
    processors=2 # Makes the WSL 2 VM use two virtual processors
    
  3. Since you are unlikely to be compiling and creating your own WSL2 Linux kernel, I have removed the line that sets the custom kernel that ALL WSL2 distributions would use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .