Windows 10: WSL run commands on boot as sudo

Discus and support WSL run commands on boot as sudo in Windows 10 Support to solve the problem; I have pihole installed on ubuntu linux. It works fine except i have to manually run couple of commands on windows boot. I am running windows 10 home... Discussion in 'Windows 10 Support' started by edvrfn, May 22, 2020.

  1. edvrfn Win User

    WSL run commands on boot as sudo


    I have pihole installed on ubuntu linux. It works fine except i have to manually run couple of commands on windows boot. I am running windows 10 home 18363.836. I want those commands to run on windows boot and if it can happen even before i logon to windows would be best. And that sudo elevation is needed to run those commands . How can this be achieved.

    pihole restartdns
    service lighttpd restart

    :)
     
    edvrfn, May 22, 2020
    #1

  2. WSL unable to perform DNS lookup

    Can you go back and check that WSL hasn’t over written resolv.conf

    If it has can you fix it again and then run:

    sudo chmod 444 /etc/resolv.conf

    Regards,

    Ross
     
    rossmcbain, May 22, 2020
    #2
  3. Error "Server execution failed" when trying to run bash command in Windows 10 (Version 10.0.17763.475)

    As the title says, when I try to run the "bash" command, I get an error saying, "Server execution failed". I got this problem after I ran the "sudo apt-get update" and "sudo apt-get upgrade -y" commands during my last successful run of the WSL and then
    exiting out of it immediately. I'm not sure if that could've caused the issue, though.

    Any help would be greatly appreciated. Thanks in advance. (Is this posted under the right category?)
     
    OsmanZakir, May 22, 2020
    #3
  4. Bree Win User

    WSL run commands on boot as sudo

    Installation media boots to command prompt

    I've just booted from known working install media to see exactly what it does when booting. The sequence of events is...

    1. Windows logo on a black screen
    2. circling dots appear beneath the logo
    3. light blue 'Please wait' screen with circling dots
    4. a command prompt window (very briefly)
    5. the initial Setup page appears

    Do you see steps 1-3? If so, it appears you have stopped at step 4, suggesting that something on the disc cannot be read.

    Does the disc boot properly in another machine? If so, try cleaning the laptop's drive lens then try booting from the disc again.

    If not, make new install media with Microsoft's Media Creation Tool, either as a bootable USB, on an ISO that you can burn to another disc. At Step 8 in Option One of this tutorial you can choose between making a USB or an ISO.

    Download Windows 10 ISO File
     
Thema:

WSL run commands on boot as sudo

Loading...
  1. WSL run commands on boot as sudo - Similar Threads - WSL run commands

  2. How to run Sudo Command in Windows 11/10

    in Windows 10 News
    How to run Sudo Command in Windows 11/10: [IMG]With the help of the Sudo command, one will be able to run commands in elevated mode without having to run the console in elevated mode. In this post, we will see how to run Sudo Command on your Windows computer. What is Sudo Command? Sudo (short for “Superuser Do“) is a...
  3. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 Gaming
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  4. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 Software and Apps
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  5. WSL Windows Subsystem For Linux "wsl" command not found

    in Windows 10 BSOD Crashes and Debugging
    WSL Windows Subsystem For Linux "wsl" command not found: Guys help, I've contacted ms support multiple times and none of the agents have been able to solve the issue.so, I have Windows Subsystem for Linux WSL with Ubuntu installed. yesterday, i tried to install docker, and it was kind of a mess, so i just uninstalled it in every...
  6. WSL problem -- all wsl commands don't work

    in Windows 10 Installation and Upgrade
    WSL problem -- all wsl commands don't work: Hello everyone,I got an issue with the windows subsystem for Linux WSL.Context :I'm using a Windows 10 lap-top shared by my companyHow I got to the problem :- I first reinstall windows 10 - I installed WSL through this link .- Everything was working though with the Ubuntu...
  7. WSL problem -- all wsl commands don't work

    in Windows 10 Gaming
    WSL problem -- all wsl commands don't work: Hello everyone,I got an issue with the windows subsystem for Linux WSL.Context :I'm using a Windows 10 lap-top shared by my companyHow I got to the problem :- I first reinstall windows 10 - I installed WSL through this link .- Everything was working though with the Ubuntu...
  8. WSL problem -- all wsl commands don't work

    in Windows 10 Software and Apps
    WSL problem -- all wsl commands don't work: Hello everyone,I got an issue with the windows subsystem for Linux WSL.Context :I'm using a Windows 10 lap-top shared by my companyHow I got to the problem :- I first reinstall windows 10 - I installed WSL through this link .- Everything was working though with the Ubuntu...
  9. Run Brasero on WSL?

    in Windows 10 Ask Insider
    Run Brasero on WSL?: So, I am a Linux user right now(actually, I have a Windows PC, but it's old and never gets used), I am thinking about going back to Windows because of the better gaming experience at this time. One program I use, Brasero, is not available on Windows natively. Is it possible...
  10. Add, Remove, and List Sudo Users in a WSL Linux Distro in Windows 10

    in Windows 10 Tutorials
    Add, Remove, and List Sudo Users in a WSL Linux Distro in Windows 10: How to: Add, Remove, and List Sudo Users in a WSL Linux Distro in Windows 10 How to Add, Remove, and List Sudo Users in Windows Subsystem for Linux (WSL) Distro in Windows 10 The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run...