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

WSL2 always running #5488

Closed
ekrogh opened this issue Jun 25, 2020 · 6 comments
Closed

WSL2 always running #5488

ekrogh opened this issue Jun 25, 2020 · 6 comments
Labels

Comments

@ekrogh
Copy link

ekrogh commented Jun 25, 2020

Is your feature request related to a problem? Please describe.
With WSL 2 the mounted remote network drives are unmounted when the last shell is closed.
On my system it takes a long time to mount the network drives (I guess that is why mountFsTab = true in wsl.conf doesn't work though fstab is configured and sudo mount -a is working)

Describe the solution you'd like
It would be nice if it was possible to let wsl2 run in the background (I know I can let the last shell run, but if wsl2 could mount the network drives at windows boot time that would be nice).

Best
Eigil

@therealkenc
Copy link
Collaborator

If you start any service (daemon) on WSL it will run forever. "sudo service cron start" will do but pick any. WSL shuts itself down by-design to conserve resources unless there is at least one process running.

@yzgyyang
Copy link

Any ideas on how to keep it (a WSL 2 distro) running utilizing a dummy daemon without sudo privilege? Hoping to automate the process a bit without having to type the password everytime ;)
@therealkenc

@therealkenc
Copy link
Collaborator

utilizing a dummy daemon without sudo privilege?

sudoers

@aagha
Copy link

aagha commented Oct 26, 2022

@therealkenc Has this functionality changed? It seems it's no longer the case that WSL will run forever giving the example you just cited.

@plashenkov
Copy link

plashenkov commented Nov 9, 2022

@aagha I can confirm, I have the Docker service running (service docker start), but VmmemWSL closes after a while if there is no activity like Terminal or VS Code are open.

@ovidiupruteanu
Copy link

Same here. I have nginx and mariadb running but it shuts off after I close the shell.

WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819

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

No branches or pull requests

6 participants