Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
2 added 318 characters in body
source | link

Update

Microsoft has addressed this. Background / daemon processes are now allowed to continue running even after bash.exe (or other WSL launcher process) is closed. A recent build of Win10 (spring 2018 for public releases, build 17046 or greater) is required.

The below is preserved for posterity.


Sadly/absurdly, there is no way to do this. Microsoft, in their infinite wisdom, have decided that WSL (Windows Subsystem for Linux) will only run while you have a bash.exe process open. Close the last one (or possibly even close the last window; I'm not sure if it'll tolerate being run headless) and WSL shuts down, killing all of its processes.

The justification for this was "to conserve resources", which is absurd on several different levels but most notably because, dammit, my computer has those resources and they are there to be used! If I want a process to run, it should run; if I don't want it to run, I can kill it. For something explicitly intended as a developer tool, it sometimes feels like WSL is only usable as a plaything and its users can't be trusted to know what they're doing.

Anyhow, if you want this fixed, vote for Consider enabling cron jobs, daemons and background tasks on the UserVoice page. It's currently the second-most-voted-for request, and is "on the backlog".

Sadly/absurdly, there is no way to do this. Microsoft, in their infinite wisdom, have decided that WSL (Windows Subsystem for Linux) will only run while you have a bash.exe process open. Close the last one (or possibly even close the last window; I'm not sure if it'll tolerate being run headless) and WSL shuts down, killing all of its processes.

The justification for this was "to conserve resources", which is absurd on several different levels but most notably because, dammit, my computer has those resources and they are there to be used! If I want a process to run, it should run; if I don't want it to run, I can kill it. For something explicitly intended as a developer tool, it sometimes feels like WSL is only usable as a plaything and its users can't be trusted to know what they're doing.

Anyhow, if you want this fixed, vote for Consider enabling cron jobs, daemons and background tasks on the UserVoice page. It's currently the second-most-voted-for request, and is "on the backlog".

Update

Microsoft has addressed this. Background / daemon processes are now allowed to continue running even after bash.exe (or other WSL launcher process) is closed. A recent build of Win10 (spring 2018 for public releases, build 17046 or greater) is required.

The below is preserved for posterity.


Sadly/absurdly, there is no way to do this. Microsoft, in their infinite wisdom, have decided that WSL (Windows Subsystem for Linux) will only run while you have a bash.exe process open. Close the last one (or possibly even close the last window; I'm not sure if it'll tolerate being run headless) and WSL shuts down, killing all of its processes.

The justification for this was "to conserve resources", which is absurd on several different levels but most notably because, dammit, my computer has those resources and they are there to be used! If I want a process to run, it should run; if I don't want it to run, I can kill it. For something explicitly intended as a developer tool, it sometimes feels like WSL is only usable as a plaything and its users can't be trusted to know what they're doing.

Anyhow, if you want this fixed, vote for Consider enabling cron jobs, daemons and background tasks on the UserVoice page. It's currently the second-most-voted-for request, and is "on the backlog".

1
source | link

Sadly/absurdly, there is no way to do this. Microsoft, in their infinite wisdom, have decided that WSL (Windows Subsystem for Linux) will only run while you have a bash.exe process open. Close the last one (or possibly even close the last window; I'm not sure if it'll tolerate being run headless) and WSL shuts down, killing all of its processes.

The justification for this was "to conserve resources", which is absurd on several different levels but most notably because, dammit, my computer has those resources and they are there to be used! If I want a process to run, it should run; if I don't want it to run, I can kill it. For something explicitly intended as a developer tool, it sometimes feels like WSL is only usable as a plaything and its users can't be trusted to know what they're doing.

Anyhow, if you want this fixed, vote for Consider enabling cron jobs, daemons and background tasks on the UserVoice page. It's currently the second-most-voted-for request, and is "on the backlog".