How can I run services in WSL

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












After searching this site and various Q, it is clear that services and systemd is not available for WSL.
I need to run a program in WSL everytime I start my pc so I read this page on how to use crontab: How to run Ubuntu service on Windows (at startup)? | Super User but I got confused because the format does not tally with the format in crontab.
However this is my cron:



PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH=cd /usr/local/src/:cd xmr-stak-cpu:cd bin/
@reboot . sudo ./xmr-stak-cpu


I have also done this:



Run bash/cron loop on start



Create a file called linux.bat in shell:startup 

Paste: C:WindowsSystem32bash.exe -c 'while [ true ]; do sudo /usr/sbin/cron -f; done'


It does not work.



How can I run a service in WSL?
Surely there must be a way that does not require me to be a Linux phd?
Or is there a way to use Windows



Because in Windows I have tried the following: using https://github.com/Microsoft/WSL/issues/612



Run: When the computer starts, 
Action: Start a program,
Program: c:Windowssystem32bash.exe,
Arguments: -c "sudo /xmr-stak-cpu/bin/xmr-stak-cpu -D"
Start in: /usr/local/src/


And as you guessed, it still does not work.
Frankly I wish I could do this in WSL because it is my preferred way but I will take any way.
Please help guys.







share|improve this question





















  • @Zanna: Alright. Done.
    – David Foerster
    Apr 16 at 10:09










  • Cross-posted to SU: superuser.com/questions/1343558/…
    – slhck
    Jul 30 at 15:41
















up vote
2
down vote

favorite












After searching this site and various Q, it is clear that services and systemd is not available for WSL.
I need to run a program in WSL everytime I start my pc so I read this page on how to use crontab: How to run Ubuntu service on Windows (at startup)? | Super User but I got confused because the format does not tally with the format in crontab.
However this is my cron:



PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH=cd /usr/local/src/:cd xmr-stak-cpu:cd bin/
@reboot . sudo ./xmr-stak-cpu


I have also done this:



Run bash/cron loop on start



Create a file called linux.bat in shell:startup 

Paste: C:WindowsSystem32bash.exe -c 'while [ true ]; do sudo /usr/sbin/cron -f; done'


It does not work.



How can I run a service in WSL?
Surely there must be a way that does not require me to be a Linux phd?
Or is there a way to use Windows



Because in Windows I have tried the following: using https://github.com/Microsoft/WSL/issues/612



Run: When the computer starts, 
Action: Start a program,
Program: c:Windowssystem32bash.exe,
Arguments: -c "sudo /xmr-stak-cpu/bin/xmr-stak-cpu -D"
Start in: /usr/local/src/


And as you guessed, it still does not work.
Frankly I wish I could do this in WSL because it is my preferred way but I will take any way.
Please help guys.







share|improve this question





















  • @Zanna: Alright. Done.
    – David Foerster
    Apr 16 at 10:09










  • Cross-posted to SU: superuser.com/questions/1343558/…
    – slhck
    Jul 30 at 15:41












up vote
2
down vote

favorite









up vote
2
down vote

favorite











After searching this site and various Q, it is clear that services and systemd is not available for WSL.
I need to run a program in WSL everytime I start my pc so I read this page on how to use crontab: How to run Ubuntu service on Windows (at startup)? | Super User but I got confused because the format does not tally with the format in crontab.
However this is my cron:



PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH=cd /usr/local/src/:cd xmr-stak-cpu:cd bin/
@reboot . sudo ./xmr-stak-cpu


I have also done this:



Run bash/cron loop on start



Create a file called linux.bat in shell:startup 

Paste: C:WindowsSystem32bash.exe -c 'while [ true ]; do sudo /usr/sbin/cron -f; done'


It does not work.



How can I run a service in WSL?
Surely there must be a way that does not require me to be a Linux phd?
Or is there a way to use Windows



Because in Windows I have tried the following: using https://github.com/Microsoft/WSL/issues/612



Run: When the computer starts, 
Action: Start a program,
Program: c:Windowssystem32bash.exe,
Arguments: -c "sudo /xmr-stak-cpu/bin/xmr-stak-cpu -D"
Start in: /usr/local/src/


And as you guessed, it still does not work.
Frankly I wish I could do this in WSL because it is my preferred way but I will take any way.
Please help guys.







share|improve this question













After searching this site and various Q, it is clear that services and systemd is not available for WSL.
I need to run a program in WSL everytime I start my pc so I read this page on how to use crontab: How to run Ubuntu service on Windows (at startup)? | Super User but I got confused because the format does not tally with the format in crontab.
However this is my cron:



PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PATH=cd /usr/local/src/:cd xmr-stak-cpu:cd bin/
@reboot . sudo ./xmr-stak-cpu


I have also done this:



Run bash/cron loop on start



Create a file called linux.bat in shell:startup 

Paste: C:WindowsSystem32bash.exe -c 'while [ true ]; do sudo /usr/sbin/cron -f; done'


It does not work.



How can I run a service in WSL?
Surely there must be a way that does not require me to be a Linux phd?
Or is there a way to use Windows



Because in Windows I have tried the following: using https://github.com/Microsoft/WSL/issues/612



Run: When the computer starts, 
Action: Start a program,
Program: c:Windowssystem32bash.exe,
Arguments: -c "sudo /xmr-stak-cpu/bin/xmr-stak-cpu -D"
Start in: /usr/local/src/


And as you guessed, it still does not work.
Frankly I wish I could do this in WSL because it is my preferred way but I will take any way.
Please help guys.









share|improve this question












share|improve this question




share|improve this question








edited Apr 11 at 1:06









muru

127k19266452




127k19266452









asked Apr 10 at 17:56









seanbw

113




113











  • @Zanna: Alright. Done.
    – David Foerster
    Apr 16 at 10:09










  • Cross-posted to SU: superuser.com/questions/1343558/…
    – slhck
    Jul 30 at 15:41
















  • @Zanna: Alright. Done.
    – David Foerster
    Apr 16 at 10:09










  • Cross-posted to SU: superuser.com/questions/1343558/…
    – slhck
    Jul 30 at 15:41















@Zanna: Alright. Done.
– David Foerster
Apr 16 at 10:09




@Zanna: Alright. Done.
– David Foerster
Apr 16 at 10:09












Cross-posted to SU: superuser.com/questions/1343558/…
– slhck
Jul 30 at 15:41




Cross-posted to SU: superuser.com/questions/1343558/…
– slhck
Jul 30 at 15:41










1 Answer
1






active

oldest

votes

















up vote
1
down vote













WSL can’t run true services without additional support from and configuration of the Windows host system because it lacks an “init” daemon among other sub-systems and features that all fully fledged Linux systems have. Such differences are off topic here on Ask Ubuntu but you’re welcome to ask over on our sister site Super User.






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023747%2fhow-can-i-run-services-in-wsl%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    WSL can’t run true services without additional support from and configuration of the Windows host system because it lacks an “init” daemon among other sub-systems and features that all fully fledged Linux systems have. Such differences are off topic here on Ask Ubuntu but you’re welcome to ask over on our sister site Super User.






    share|improve this answer

























      up vote
      1
      down vote













      WSL can’t run true services without additional support from and configuration of the Windows host system because it lacks an “init” daemon among other sub-systems and features that all fully fledged Linux systems have. Such differences are off topic here on Ask Ubuntu but you’re welcome to ask over on our sister site Super User.






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        WSL can’t run true services without additional support from and configuration of the Windows host system because it lacks an “init” daemon among other sub-systems and features that all fully fledged Linux systems have. Such differences are off topic here on Ask Ubuntu but you’re welcome to ask over on our sister site Super User.






        share|improve this answer













        WSL can’t run true services without additional support from and configuration of the Windows host system because it lacks an “init” daemon among other sub-systems and features that all fully fledged Linux systems have. Such differences are off topic here on Ask Ubuntu but you’re welcome to ask over on our sister site Super User.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Apr 16 at 10:09









        David Foerster

        25.5k1360104




        25.5k1360104






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023747%2fhow-can-i-run-services-in-wsl%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491