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

I can't enter my username #10

Closed
jgoux opened this issue Nov 21, 2019 · 21 comments
Closed

I can't enter my username #10

jgoux opened this issue Nov 21, 2019 · 21 comments

Comments

@jgoux
Copy link

jgoux commented Nov 21, 2019

Hello,

I'm trying to install the service but my username isn't accepted.

I have a microsoft account, and passing my email address gets me a "specified domain doesn't exist".

So I tried to get my local username using "net user" which is "Julien Goux", but as soon as I type it I got the error "invalid username", I can't even type my password.

Maybe it's because I have a space in my username?

@alansikora
Copy link

I have a similar issue and even when creating a new administrator user I still get the following error:

2019/11/22 11:29:14 failed to start wsl2host: could not start service: The service did not start due to a logon failure.

I tried all different combinations, changed password and username. No game.

@davidwudv
Copy link

davidwudv commented Dec 3, 2019

same issue

@SolomonHD
Copy link

SolomonHD commented Dec 6, 2019

I've had similar issues in the past, going to Services App -> Right Click WSL2 Host -> Properties -> Log On Tab -> Browse -> Advanced -> Find Now -> [Select your proper username] -> Ok
Then make sure the selected user has the proper password, stop and restart the WSL2 Host service.

Fixed what issues I was having logging in.

@shayne
Copy link
Owner

shayne commented Dec 17, 2019

Linked to this thread on Readme

@shayne shayne closed this as completed Dec 17, 2019
@nickescobedo
Copy link

Tried using the fix from @SolomonHD but mine still doesn't start and says logon failure.

@shayne
Copy link
Owner

shayne commented Mar 10, 2020

@nickescobedo sorry about that. Want to jump on Gitter and try to figure it out?

https://gitter.im/go-wsl2-host/community

@nickescobedo
Copy link

nickescobedo commented Mar 11, 2020

So we figured something else out. In addition to the username and password if you're still receiving The service did not start due to a logon failure it could mean that your user is not allowed to logon as a service.

You could have typed your password in correctly but if the security policy isn't set it still won't allow it.

The steps to check are:
Start > Administrative Tools > Local Security Policy > Local Policies > User Rights Assignment > Log on as a service

Make sure the user you set the user/pass for are allowed to log on as a service or it won't allow you.

Hope this helps someone and thank you again Shayne!

@tikarei
Copy link

tikarei commented May 7, 2020

Thanks, this solved my problem!

If you are on Windows 10 Home and do not have Local Security Policy under Administrative Tools, you can download and install it using a .bat script provided here: https://www.majorgeeks.com/content/page/how_to_enable_local_security_policy_in_windows_10_home.html

@MichaelBelgium
Copy link

Can't find any "WSL2 service" in the services app (windows 10 version 2004)

@mpetuska
Copy link

mpetuska commented Jun 6, 2020

Has anyone managed to set this up with microsoft account (not local)?

@wujingquan
Copy link

Has anyone managed to set this up with microsoft account (not local)?

me! windows 10 version 2004

@bmo-at
Copy link

bmo-at commented Aug 29, 2020

@wujingquan How did you do it? In what form did you enter your credentials?

@wafflepie
Copy link

wafflepie commented Sep 16, 2020

Managed to start the service with a Microsoft account using the following steps:

  1. I can't enter my username #10 (comment), i.e. select the proper user in services.msc. Entering the username from C:\Users\<username> during setup should be sufficient.
  2. I can't enter my username #10 (comment), i.e. add the service logon permission to the user in "Local Security Policy".
  3. Lock your computer via WinKey+L, then log in via the Microsoft account password (not via Windows Hello), this should be necessary just once. You might need to go to "Sign-in options" and disable the "Require Windows Hello sign-in for Microsoft accounts" to do so.

@ishaqx
Copy link

ishaqx commented Dec 3, 2020

Thanks @SolomonHD & @nickescobedo - got it working using your instructions and thanks to @shayne for wsl2-host.

I'm running ubuntu2004 and debian - I just have one weird issue: Both instances have the same IP address! At first I thought this issue may have been a problem with wsl2-host when I checked the host file, but when I checked the assigned IP addresses in both the machine, the IPs are the same, even after restarting them.

@xywc-s
Copy link

xywc-s commented Aug 10, 2021

Managed to start the service with a Microsoft account using the following steps:

  1. I can't enter my username #10 (comment), i.e. select the proper user in services.msc. Entering the username from C:\Users\<username> during setup should be sufficient.
  2. I can't enter my username #10 (comment), i.e. add the service logon permission to the user in "Local Security Policy".
  3. Lock your computer via WinKey+L, then log in via the Microsoft account password (not via Windows Hello), this should be necessary just once. You might need to go to "Sign-in options" and disable the "Require Windows Hello sign-in for Microsoft accounts" to do so.

U saved me!!!
Step 3 is the key point for me!!
Since I've been logging in via Windows Hello, I'm always prompted with a login failure no matter how much I try to start the service until I turn off Windows Hello and log in with my Microsoft account password, and it finally succeeds.

@krystofwoldrich
Copy link

So we figured something else out. In addition to the username and password if you're still receiving The service did not start due to a logon failure it could mean that your user is not allowed to logon as a service.

You could have typed your password in correctly but if the security policy isn't set it still won't allow it.

The steps to check are:
Start > Administrative Tools > Local Security Policy > Local Policies > User Rights Assignment > Log on as a service

Make sure the user you set the user/pass for are allowed to log on as a service or it won't allow you.

Hope this helps someone and thank you again Shayne!

I don't know if someone already didn't mention this but it would be nice if during the installation process this would be check and the user was asked if the record with his username should be added. I know it is possible to automatize this the question is do you think it makes sense?

@AlexanderAllen
Copy link

AlexanderAllen commented Mar 27, 2022

Thank you all for the detailed solutions above. Tried them all, none of them worked.
What actually worked for me ended up being far more simpler. Just follow #10 (comment), but use Local System account instead:

image

Success:
image

However while the service is running, the hosts file is not reflecting any new .wsl hosts :(

After some tinkering with the executable, the hosts file got automagically updated !?!

image

From command line type C:\Windows\System32\drivers\etc\hosts:

image

@nicangtianws01
Copy link

Thanks, I am using debug param and the host file update.

@suseetherk
Copy link

Hello,

I am trying to install wsl2host but i always get invalid user error .

Windows Password: 2022/06/30 18:07:25 failed to install wsl2host: The account name is invalid or does not exist, or the password is invalid for the account name specified

Can any one help me fix this issue.

@TacticsJan
Copy link

I am facing the same issue as @suseetherk here. I have tried all solutions in this thread to no avail.

@Maple1401
Copy link

Maple1401 commented Nov 3, 2022

有可能是账号不对,用 windows 账号登陆时,你的账号名称也许不是 email , 可以在点运行,输入control userpasswords2,看看自己的账号到底是啥。

image

image

然后再用这个账户+你的微软账号密码登陆。 就能正常安装了


Maybe the account is wrong. When you log in with a windows account, your account name may not be email. You can run it at the point and enter control userpasswords2 to see what your account is.

Then use this account + your Microsoft account Password to log in. can be installed normally

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