Coder Social home page Coder Social logo

c4ys / wsl-autostart Goto Github PK

View Code? Open in Web Editor NEW

This project forked from troytse/wsl-autostart

0.0 2.0 0.0 147 KB

Support for starting the Linux services in Windows Subsystem for Linux (WSL) on Windows startup

License: MIT License

Batchfile 66.71% Visual Basic 33.29%

wsl-autostart's Introduction

WSL Autostart

Support for starting the Linux services in Windows Subsystem for Linux (WSL) on Windows startup.

README | 中文文档

Table of Contents

Installation

  • Clone to any directory using the git command: (e.g C:\wsl-autostart)
git clone https://github.com/troytse/wsl-autostart
  • Add a startup item to the registry. run-regedit

  • Add a string item under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run (e.g WSLAutostart) regedit-new-item

  • Set the path to the script (e.g C:\wsl-autostart\start.vbs) regedit-set-path

Usage

  • Modify /etc/sudoers in the WSL to specify the service commands calling on startup without a password. e.g:
%sudo ALL=NOPASSWD: /etc/init.d/cron
%sudo ALL=NOPASSWD: /etc/init.d/ssh
%sudo ALL=NOPASSWD: /etc/init.d/mysql
%sudo ALL=NOPASSWD: /etc/init.d/apache2
  • Modify commands.txt in the wsl-autostart directory to specify the service commands for your need. e.g:
/etc/init.d/cron
/etc/init.d/ssh
/etc/init.d/mysql
/etc/init.d/apache2

Other methods

  • Using gpedit.msc, it is possible to define a program that runs when the computer starts

    Note that the configured program will run as the system user.

  • Using taskschd.msc, it is possible to schedule a task after the startup of the computer.

    You may configure which user will run the program, a delay before a run and a number of retries. the same taskschd.msc program will show a specific log regarding the execution of the task

wsl-autostart's People

Contributors

troytse avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.