Skip to content

Can't start elevated process in non-elevated bash #1237

Closed

Description

  • A brief description
    WSL since Build 14951 allows launching Windows binaries in Bash. But I cannot launch a Windows binary, such as regedit.exe which requires UAC elevation from a non-elevated bash.
  • Expected results
    I expect to see a UAC elevation confirmation dialog box when starting a privileged process, or auto-elevate for files like regedit.exe if my UAC setting is the default level.
  • Actual results (with terminal output if applicable)
    Silently fail (without launching the process nor displaying error).
  • Your Windows build number
    Build 10.0.14951
  • Steps / All commands required to reproduce the error from a brand new installation
    1. Set Windows UAC setting to the default level
    2. Launch bash.exe (don't run it as administrator)
    3. Run the following commands in bash: export PATH=$PATH:/mnt/c/Windows and then mnt/c/Windows/regedit.exe
    4. Registry Editor is not launched, and no error message is given.
  • Strace of the failing command
  • Required packages and commands to install
    None

Activity

  1. fpqc commented on Oct 20, 2016

    @fpqc

    This is expected.

  2. fpqc commented on Oct 20, 2016

    @fpqc

    NextPrime (@nextprime) I think what would be ideal is if we could do something like "winsudo" that calls up a UAC prompt (in general for powershell stuff too).

  3. benhillis commented on Oct 20, 2016

    @benhillis
    Member

    The process exit code will be non-zero in this case indicating a failure. You're right, an error message would maybe be nice.

  4. goreliu commented on Oct 23, 2016

    @goreliu

    Run with cmd.exe /C regedit.

  5. benhillis commented on Oct 31, 2016

    @benhillis
    Member

    fpqc "winsudo" is an interesting idea but I feel like it is potentially a can of worms. I think if you need to run admin things from within bash you should just run bash.exe elevated.

    I'm looking at adding some error text for when the binfmt interpreter fails to launch an NT process.

  6. fpqc commented on Oct 31, 2016

    @fpqc

    Ben Hillis (@benhillis) it's too late, Bitcrazed I think has confirmed that it will be a console improvement. Porting to bash will automatically come from your console redirection work muahahahahahaha

  7. benhillis commented on Oct 31, 2016

    @benhillis
    Member

    fpqc Do you have a reference to his comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions