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

Is there a way to run wslbridge as a system service? #10

Open
ElTopo opened this issue Apr 19, 2017 · 2 comments
Open

Is there a way to run wslbridge as a system service? #10

ElTopo opened this issue Apr 19, 2017 · 2 comments

Comments

@ElTopo
Copy link

ElTopo commented Apr 19, 2017

Hello,

I want to run WSL as a system service for some servers (such as sshd, crond, tftpd) in the background, before Windows user log in, and it continues to run after I close all mintty terminals(connections).

Is it possible?
Thanks.

@rprichard
Copy link
Owner

Are you sure wslbridge is relevant here? wslbridge is a way to bridge from a Cygwin (or MSYS2) pty to a WSL pty.

Both WSL and Cygwin have servers like sshd. If you were to run Cygwin's SSH server, then you could use wslbridge after logging in to start a WSL shell.

My impression is that you're interested in running WSL servers rather than Cygwin servers, though. There's an issue open here (microsoft/WSL#612) about running WSL sshd as a Windows service, but after skimming it, I couldn't tell if anyone figured out a solution. It seems that each Windows account has an independent WSL installation, so running WSL sshd as "SYSTEM"(?) won't work, because it won't see your real home directory? Maybe you could run the WSL sshd Windows service with your ordinary Windows account. I'm not familiar with WSL's security model or how it handles multiple accounts.

@ElTopo
Copy link
Author

ElTopo commented Apr 20, 2017

Well I thought it would be nice for wslbridge to provide a "service mode" that it does not connect to mintty while still can run some bash processes in the background, thus it acts like "Windows service".

Per your question regarding Windows account, you can always specify to run service using a normal account instead of SYSTEM.

I used to run a user console executable as service with an older version of Windows. But Windows 10's bash.exe seems to have console issue that my service could not be fully stopped and stays STOPPING state.

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

2 participants