- Helps WSL(Windows Subsystem for Linux) startup on your Windows boot.
- Automatically configure your Windows and WSL's static ip address, firewall, proxy ports.
- WSL Service will startup and executes init commands your WSL without Windows logon.
- You can run web server like as linux daemon with init commands.
- You can configure your own settings with json file.
- Python 3 is required in your Windows.
- Tested with Windows 10, Windows 11, Python 3.8, Python 3.9, Python 3.10, WSL2 Ubuntu-20.04, WSL2 Ubuntu-22.04
- Download or clone this repository.
- Execute
wslservice.bat
, to test if it works on your environment. - Follow next described step for automatic startup on Windows boot.
- Register as Windows Service or Task Scheduler
- Only works in Windows 10, has problem in Windows 11, does not allow mounted WLS directory permission while accessing thru Windows 11 File Explorer.
-
Install NSSM(Non-Sucking Service Manager). Download form nssm.cc and install or install with following command. Windows administrator privileges are required.
choco install nssm
-
Register
wslservice.bat
as windows service. windows administrator privileges are required.nssm.exe install WSLService
-
Open Windows Service panel with following command and start
WSLService
.services.msc
-
Open Windows Service panel with following command and stop
WSLService
.services.msc
-
Remove with following command.
nssm.exe remove WSLService
- Resolves WLS directory permission problem while accessing thru Windows 11 File Explorer.
-
Install NirCmd. Download form nirsoft.net and install or install with following command. Windows administrator privileges are required.
choco install nircmd
-
Create new task with
wslservice.bat
script at Task Scheduler.taskschd.msc
Create New Task
General Tab
Triggers Tab
Actions Tab
Program/script:
nircmd
Add arguments:
elevatecmd exec hide "path/to/wsl-service/wslservice.bat"
Start in:
path/to/wsl-service
-
If you want to execute manually for a specific purpose, or to create shortcut icon, use
wslservicetask.bat
file which run task registered at scheduler.
Default settings fie is wsl-service/source/settings.json
. Copy to wsl-service/settings.json
then config your own settings.
BINDING_ADDRESS
: Static local ip address for your WSL.FIREWALL_ALLOWED_PORTS
: Automatic registeration on Windows firewall allowed port.PROXY_FORWARDING_TCP_PORTS
: Automatic registeration on Windows proxy port forwarding.INITD_SERVICES
: Automatically executes startup services such as ssh, nginx, mysql, redis, ...INITD_EXECUTES
: Automatically executes additional commands on startup such as your own server.
- Automatic Windows service registration.
- Accessing network applications with WSL
- Advanced settings configuration in WSL