-
Notifications
You must be signed in to change notification settings - Fork 849
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
WSL2 Increase the maximum amount of inotify user watches #4293
Comments
@Comevius thank you, thank you, thank you! This is really a brilliant workaround, and actually the only one that works. I spent several hours trying to make it work and the most of 'google' solutions claimed that: This really needs to be documented (at least) or implemented in WSL2. |
I use the result : fail |
@jiangbo0216 it works for me. You don't need to enable password for root, just use You can't use vim directly to edit There is already a line in
You need to exit the editor the changes to take effect. To check, that everything works just open another bash shell and try to execute: After placing script call into the |
https://auo.nu/posts/wsl2-livereload/ This blog post says that WSL2 only watches file in the WSL-related folders. So I move my original one from Windows-related to WSL-related and it works! Many thanks to this blog. |
Please consider increasing the maximum amount of inotify user watches (
fs.inotify.max_user_watches
) in WSL2.The current limit (8192) is too low for most projects.
For a seamless Visual Studio Code Remote Development experience a new limit of 524288 is suggested. That would allow to watch up to 524288 files, using up to 540 MiB kernel memory.
Alternatively make
fs.inotify.max_user_watches
configurable, which would probably require the init system of WSL2 to read configuration files placed in/etc/sysctl.d/
. See #4232.The current workaround is:
sudo chown root:root
andsudo chmod 755
on the scriptsudo chattr +i
on it, otherwise it can be deletedsudo EDITOR=nano visudo
and add this:%sudo ALL=(ALL:ALL) NOPASSWD:/path/to/script.sh
sudo /path/to/script.sh
The text was updated successfully, but these errors were encountered: