Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wslconfig file being ignored #6728

Closed
Joanthan17 opened this issue Mar 28, 2021 · 28 comments
Closed

wslconfig file being ignored #6728

Joanthan17 opened this issue Mar 28, 2021 · 28 comments

Comments

@Joanthan17
Copy link

So, I've compiled WSL2-Kernel, copied bzImage to %USERPROFILE% and created a .wslconfig file there pointing to this bran new kernel. However, WSL seems to be ignoring my .wslconfig file as uname -r still shows the original version. Any clues on this?

PS I'm running version 20H2 (OS Build 19042) on windows home edition

@Biswa96
Copy link

Biswa96 commented Mar 28, 2021

What is in the .wslconfig file?

@Joanthan17
Copy link
Author

[wsl2]
kernel=c:\\wslkernel\\bzImage
memory=4GB # Limits VM memory in WSL2 to 4 GB
processors=2 # Makes the WSL2 VM use two virtual processors

@Joanthan17
Copy link
Author

the wslconfig file location - C:\Users\Jonathan Elkabas.wslconfig

@hoang-himself
Copy link

The wslconfig file location should be C:\Users\Jonathan Elkabas\.wslconfig

@Joanthan17
Copy link
Author

yeah I know, it was a typo ><

@Reignable
Copy link

Reignable commented Mar 31, 2021

I'm having the same issue but not trying a different kernel.
The only setting I have is:

[wsl2]
memory=4GB

Same Build and Version as @Joanthan17 but Pro rather than Home

@Joanthan17
Copy link
Author

I fear that the whole .wslconfig file thing is a feature available only on Pro edition although i didn't find any mention about it in the documentation

@therealkenc
Copy link
Collaborator

The kernel= feature is not limited to Pro.

@benhillis
Copy link
Member

@Joanthan17 - are you running x64 or arm64?

@0xbadfca11
Copy link

Make sure you are definitely using WSL2.
So far there is no evidence that you are using WSL2. You may be using WSL1 by mistake.

  • wsl.exe -l -v
    Is the VERSION column 2?
  • uname -r
    Isn't the kernel version 4.4? It's WSL1.

@Joanthan17
Copy link
Author

@benhillis im using x64-based processor
@0xbadfca11 please have a look:
on debian:
image
on PS:
image

@hoang-himself
Copy link

@Joanthan17 I'm not sure about the kernel, but memory and processors definitely requires WSL2. You can find more information here.

@Joanthan17
Copy link
Author

image

@hoang-himself
Copy link

@Joanthan17

wsl --set-version Ubuntu-20.04 2

@Joanthan17
Copy link
Author

turns out i was running wsl1 and not wsl2 ><
image

now the wslconfig file work!
image

guys thanks a lot for your help (:

@Reignable
Copy link

So I am on WSL2 and the wslconfig file is still being ignored
image

@hoang-himself
Copy link

@Reignable Are you using version 19041? .wslconfig is only available on build 10941 and later.

@Reignable
Copy link

Reignable commented Apr 1, 2021

@Smithienious I'm currently on 19042
image

But have just gotten insider builds available

@hoang-himself
Copy link

@Reignable can you show the content of wslconfig?

@Reignable
Copy link

[wsl2]
memory=4GB
swap=0

@hoang-himself
Copy link

@Reignable how do you know the file is being ignored? Excessive ram usage?

@Reignable
Copy link

Yeah, especially when using Docker although when running other node applications it gets sucked up and doesn't get freed again

image

@hoang-himself
Copy link

@Reignable try running the program given here. If WSL is still using more than 4GB, shut down WSL completely then try again. If it still doesn't work, delete and create a new .wslconfig, shutdown WSL then try again. If these don't work, you should create a new issue.

@Reignable
Copy link

Thanks @Smithienious, I've managed to limit it by updating Windows to 21343 which brings in the changed default WSL memory to 8GB which is fine for me. I've done with you suggested and .wslconfig still isn't recognised but it's not a problem anymore
Thanks for your help.

@ThiloFink
Copy link

You have to make sure that the .wslconfig is not a txt file but a wslconfig-file type.
2021-07-13_11h07_12

Create the .wslconfig not with a text-editor, but inside the C:\Users\<user> with:
code .wslconfig

@ThiloFink ThiloFink mentioned this issue Jul 13, 2021
2 tasks
@starkblaze01
Copy link

Make sure when you create a .wslconfig file the type of the file is WSLCONFIG File, not TXT Document:
ba0fe00d-6035-4578-bda2-a02e012bd76c

@moon548834
Copy link

You have to make sure that the .wslconfig is not a txt file but a wslconfig-file type. 2021-07-13_11h07_12

Create the .wslconfig not with a text-editor, but inside the C:\Users\<user> with: code .wslconfig

you save my life!!

@MerlijnBusch
Copy link

MerlijnBusch commented May 26, 2023

Hello can some help me, I have followed all the steps here. But the issue is still there
image
Its saved as an WSConfig so not a text what should be correct the insides of the files are as follows
image
But some1 how the memory goes to 8k what is the default max setting for windows but it just ignore the file?

If some1 can let me know what I'm doing wrong it would be amazing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests