{"id":23172862,"url":"https://github.com/SadarSSI/WSL-WatchDog","last_synced_at":"2025-08-18T08:32:53.969Z","repository":{"id":267046866,"uuid":"479439903","full_name":"SadarSSI/WSL-WatchDog","owner":"SadarSSI","description":"Monitor wsl2 : start or restart wsl distribution automatically, update or create firewall rules \u0026 proxy, create task...","archived":false,"fork":false,"pushed_at":"2023-02-08T13:38:38.000Z","size":27,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-07T23:27:38.205Z","etag":null,"topics":["powershell","watchdog","windows","wsl2","wsl2-forwarding-port"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SadarSSI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-08T15:16:32.000Z","updated_at":"2024-12-03T10:58:35.000Z","dependencies_parsed_at":"2024-12-07T23:27:47.141Z","dependency_job_id":"4ae3d400-9b3c-4013-a199-2aef59ffeb73","html_url":"https://github.com/SadarSSI/WSL-WatchDog","commit_stats":null,"previous_names":["sadarssi/wsl-watchdog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadarSSI%2FWSL-WatchDog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadarSSI%2FWSL-WatchDog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadarSSI%2FWSL-WatchDog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadarSSI%2FWSL-WatchDog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SadarSSI","download_url":"https://codeload.github.com/SadarSSI/WSL-WatchDog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230219749,"owners_count":18192177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","watchdog","windows","wsl2","wsl2-forwarding-port"],"created_at":"2024-12-18T04:53:20.928Z","updated_at":"2024-12-18T04:53:22.812Z","avatar_url":"https://github.com/SadarSSI.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# WSL-WatchDog\nmonitor wsl: start or restart wsl automatically, update or create firewall rules \u0026 proxy, create scheduled task...\n\n## Why ?\nthe latest version of wsl stops if you are not connected to the console, or if there is not a job / process a foreground (it can be just a loop in a shell for example)\n\n### My need :\n\n- have a linux wsl running in the background\n- that wsl can be launched when windows is launched\n- a scheduled task check every xx minutes that wsl run\n- create / recreate the firewall rules\n- create / recreate portproxy v4tov4 rules\n- change the @IP address of the vEthernet card (WSL) and disable the @IP V6 if necessary\n- store wsl, scheduled task, firewell rules, etc settings in yaml file\n\n### What should you do in the linux distribution ? \nCreate a start.sh file, you can change the name (see in the yaml file in WSLCommon/StartWSL), in which you will have to launch a process or create an infinite loop for WSL to remain active.\n\n### What wsl_watchdog.ps1 does ?\n- An elevation of privilege (admin) if necessary like \"run as administrator\"\nreads wsl_params.yml\n- load wsl_params.yml\n- check if the wsl distribution is active (see Distro in wsl_params.yml)\n- check Firewall rules (see Ports in wsl_params.yml)\n- check Forwardings rules (see ProxyV4 in wsl_params.yml)\n\n### What do you need to ro create wsl_watchdog sheduled task : ?\nInstall [Powershell-Yaml](https://github.com/cloudbase/powershell-yaml)\n\n* In PowerShell as Administrator\n\n    `Install-Module powershell-yaml`\n\nEdit wsl_params.yml for the WSL distro to use and the location of WSL-Watchdog scripts. `wsl --list` shows installed distros.\n\nCall wsl_create_task.ps1. This script read thle yaml file wsl_params.yml, create wsl_watchdog task with 2 triggers :\n- atstartup : to start wsl_watchdog.ps1 script\n- daily : start wsl_watchdog.ps1 script evry 5mn (see TaskDuration in wsl_params.yml)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSadarSSI%2FWSL-WatchDog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSadarSSI%2FWSL-WatchDog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSadarSSI%2FWSL-WatchDog/lists"}