Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Ubuntu on WSL or Bash as an administrator #5727

Closed
harjeet-m opened this issue Aug 6, 2020 · 6 comments
Closed

Unable to run Ubuntu on WSL or Bash as an administrator #5727

harjeet-m opened this issue Aug 6, 2020 · 6 comments

Comments

@harjeet-m
Copy link

Hi Team,

I've enabled WSL on my Windows 10 machine running on OS build 19041.388. I have installed Ubuntu on top of it. While I'm trying to download SSL Root Certs, it does not allow shows error (screenshot attached). I've figured that this is because it requires elevated access to download and save the certs in .root directory. So while I try to run Ubuntu on WSL as an administrator, it throws an error (screenshot attached). Also, it does not let me run Bash as an administrator, the Bash windows just flashes and disappears.

I need a fix to run either of these as an administrator to download SSL certs.

Thanks,
Harjeet
SSL CLI Cert Error
Ubuntu Error

@harjeet-m harjeet-m changed the title Unable to run Ubuntu or Bash as an administrator Unable to run Ubuntu on WSL or Bash as an administrator Aug 6, 2020
@therealkenc
Copy link
Collaborator

therealkenc commented Aug 6, 2020

Please provide the CLI steps leading up to sudo ssltool-cli, and also the output of cat /proc/version.

So while I try to run Ubuntu on WSL as an administrator

Do not run WSL as Windows Admin.

@therealkenc
Copy link
Collaborator

image

@harjeet-m
Copy link
Author

Please provide the CLI steps leading up to sudo ssltool-cli, and also the output of cat /proc/version.

So while I try to run Ubuntu on WSL as an administrator

Do not run WSL as Windows Admin.

I'm running Ubuntu or Bash as an administrator as the SSL Root Cert it's trying to download needs access to the ./root directory of Ubuntu distro running on WSL.

The command ending to sudo ssltool-cli is following:
sudo curl -o /usr/local/bin/ssltool-cli https://ssltool.rackspace.com/cli/ssltool-cli && sudo chmod +x /usr/local/bin/ssltool-cli

This command is specific to the internal environment for the organization I'm working with so will not work in your test environment.

What I've found is the error is appearing because the Bash is not running as an administrator and does not have modify or write access to ./root directory.

So currently I need to know how can I run Bash as an administrator so that it allows Certs to download in the ./root directory.

@ghost ghost removed the needs-author-feedback label Aug 7, 2020
@therealkenc
Copy link
Collaborator

Did you install your WSL distribution from the Store, or was the distribution installed manually?

Are you able to start WSL with wsl.exe (or wsl.exe -d Ubuntu-20.04) when run from an elevated cmd.exe prompt, logged into Windows as user 'you'? Looks like:

image

If not, please collect networking logs and submit via the feedback hub.

Another approach would be do the ssltool-cli operation in /mnc/c/Users/you/somewhere, and then copy the result over to C:\WINDOWS\system32 on the Windows side.

@simon-rechermann
Copy link

I have the same problem. When I try to start wsl.exe from a admin powershell it says that I have no distros installed. When I try to run ubuntu as admin I get the same error as shown in the first comment from @harjeet-m (Windows cannot find 'C:\ProgramFiles....). Without admin rights everything works. But I need windows admin rights in ubuntu. Is there a workaround or something?

@eliasmarcelin0
Copy link

eliasmarcelin0 commented Dec 1, 2023

Did you install your WSL distribution from the Store, or was the distribution installed manually?

Are you able to start WSL with wsl.exe (or wsl.exe -d Ubuntu-20.04) when run from an elevated cmd.exe prompt, logged into Windows as user 'you'? Looks like:

image

If not, please collect networking logs and submit via the feedback hub.

Another approach would be do the ssltool-cli operation in /mnc/c/Users/you/somewhere, and then copy the result over to C:\WINDOWS\system32 on the Windows side.

Yo, this from almost two years ago now though, but you mentioned "able to start WSL when run from an elevated 'cmd.exe'", so I thought you might have the answer I've been looking for. T_T
TLDR: WSL/Ubuntu only runs as admin. Doesn't matter what terminal or program I open it, that terminal or program must be ran as Admin or I get the errors below:

Errors: (I LISTED THESE even if they don't matter. These are the errors I get if I DON'T run WSL in an elevated state)
WSL.exe:
Doesn't even open unless as admin.

Ubuntu:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070490
Error: 0x80070490 Element not found.

Vscode:
Element not found.
Error code: Wsl/ERROR_NOT_FOUND

I just now have this problem and I'm not sure how much I've already changed looking at fixes online. But I've just realized that I can't open WSL/Unbuntu without any admin rights. This happens every way to open it. Opening from cmd/Powershell requires running as admin. Opening wsl.exe or ubuntu.exe requires being run as admin. Even VScode requires it.

At least my Vscode is working again with Admin rights. At first, it wasn't even working, even as admin, but something changed as I was looking for solutions online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants