WSL: .wslconfig is ignored

Windows Build Number

Microsoft Windows [version 10.0.19042.964]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020

Distro Version

Debian 10

Other Software

Docker Desktop 3.3.1

docker-desktop Running 2 Debian Running 2 docker-desktop-data Running 2

Repro Steps

I made a simple .wslconfig inside %userProfile%.wslconfig who looked like this :

[ws12]
memory=3GB
localhostForwarding=true

restart wsl (wsl --shutdown + closing docker desktop)

Expected Behavior

.wslconfig to be used by wsl

Actual Behavior

WSL don’t use the .wslconfig.

image

It can go up to 6GB of ram used.

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

@Nicolas-Menettrier You may have mistakenly made it .wslconfig.txt instead of .wslconfig. E.g. If you enter .wslconfig in the notepad’s save dialog, the .txt extension will be added unless with double quote or change “Save as type”. In addition, notepad’s title bar hides the .txt extension. Run notepad "%USERPROFILE%\.wslconfig" from Win+R dialog. Did the expected file open?

Another reason is the character code. Should be UTF-8. ANSI may works. UTF-8 with BOM, UTF-16 LE and UTF-16 BE don’t work.

And your first post [ws12] is 1 of the number, not lower of L, is that okay?

@souradeep100 Where is “ig”? image

souradeep@DESKTOP-GQJDF6F:~$ ls -l  /mnt/c/Users/soura/.wslconf
-rwxrwxrwx 1 souradeep souradeep 80 Apr 30 14:00 /mnt/c/Users/soura/.wslconf
souradeep@DESKTOP-GQJDF6F:~$ cat  /mnt/c/Users/soura/.wslconf
[wsl2]
memory=4GB
localhostForwading=true
pageReporting=true
idleThreshold=1souradeep@DESKTOP-GQJDF6F:~$ file  /mnt/c/Users/soura/.wslconf
/mnt/c/Users/soura/.wslconf: ASCII text, with CRLF line terminators

So I have ascii test and encoded as UTF only.