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

Creating UNIX user failed - 0x80070040 #410

Closed
nhardy opened this issue May 21, 2016 · 18 comments
Closed

Creating UNIX user failed - 0x80070040 #410

nhardy opened this issue May 21, 2016 · 18 comments
Labels

Comments

@nhardy
Copy link

nhardy commented May 21, 2016

Bash on Windows seems to fail for me when creating a UNIX user account. I have tried lxrun /uninstall /full and reinstalling to no avail. Have run in command prompt (Administrator) and otherwise.

C:\WINDOWS\system32>bash
-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowterms

Type "y" to continue: y
Downloading from the Windows Store... 100%
Extracting the filesystem, this will take a few minutes...
Installation successful!
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: nhardy
Creating UNIX user failed, this can be done later by running lxrun.exe /setdefaultuser
The environment will start momentarily...
Documentation is available at: https://aka.ms/wsldocs
Error: 0x80070040

C:\WINDOWS\system32>lxrun.exe /setdefaultuser
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: nhardy
Error: 0x80070040

@benhillis
Copy link
Member

This is mysterious, 0x80070040 is an error code that means "network name not available" and I can't figure out what in the create user path could be returning this. Could you please try a couple of things for me?

  1. After "lxrun.exe /uninstall /full" could you check to see if %localappdata%\lxss exists on your machine?
  2. Reinstall (lxrun.exe /install) and exit out of the window while it's prompting you to create a username. Then try to launch bash.exe. Does that return the same error?

@nhardy
Copy link
Author

nhardy commented May 22, 2016

  1. %localappdata%\lxss no longer exists after lxrun.exe /uninstall /full.
  2. I get the same error when running bash.exe after reinstalling, with no prompt for creating a UNIX username:
C:\WINDOWS\system32>bash.exe
Error: 0x80070040

@benhillis
Copy link
Member

@nhardy Thanks - This is a little bit mysterious. I think I'll need to collect some logs and see what's falling over. I'm talking with some people internally about how you'll be able to collect the logs we'll need to figure out what's going on. As soon as I have that information I'll follow up with you.

@benhillis
Copy link
Member

benhillis commented May 25, 2016

@nhardy Ok I consulted with some people and figured out the right way to have you send us logging. If you could do the below it would be extremely helpful to us:

  1. Download the below two .txt files and rename them .cmd
  2. Run start_lxcore_trace.cmd from an admin command prompt
  3. Launch bash.exe
  4. Wait until you see the error 0x80070040 error.
  5. Run stop_lxcore_trace.cmd from an admin command prompt
  6. You should now see three .etl files in the directory you ran the script from.
  7. Email the logs to: [email protected]. Include in the subject / message to forward to the WSL team. In the body of the email mention it is for russalex and benhill. Also kindly include the build number you're running.

If you need a hand with any of the above let me know, I'm very interested in looking at the logs to see what's wrong. Thanks!

start_lxcore_trace.txt
stop_lxcore_trace.txt

@benhillis
Copy link
Member

benhillis commented May 27, 2016

A new Windows Insider fast ring build was released today. Would it be possible to install that build and see if this problem goes away?

@nhardy
Copy link
Author

nhardy commented May 28, 2016

Sorry for the delay, only just had a chance to do this today. Did it before and after the upgrade to build 14352 and still experiencing the same error code. Sent the requested .etl files you requested.

@benhillis
Copy link
Member

benhillis commented May 30, 2016

No problem at all! I got the traces you sent but turns out my above scripts are missing a provider... Would it be possible to run the repro again with the new version of the scripts. Sorry for the inconvenience.

start_lxcore_trace.txt
stop_lxcore_trace.txt

@aappleby
Copy link

Unchecking "Use legacy console" in the Windows command shell properties fixed this issue for me.

@nhardy
Copy link
Author

nhardy commented Jun 6, 2016

@aappleby: This wasn't the case for me. I never had it checked, but tried it with it checked and again after unchecking and my issue hasn't been resolved.

@benhillis: Sent the updated .etl files today.

@benhillis
Copy link
Member

@nhardy I was able to root cause your issue from the etl files you sent. We've submitted a fix to our dev branch and it should be an in Insider fast ring build soon.

@leictreon
Copy link

leictreon commented Jun 14, 2016

Similar issue for me as @nhardy...I'm excited for the fix...
mine's a little different - my message is:

C:\WINDOWS\system32>lxrun /setdefaultuser
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: roconnell
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
/bin/bash: -c: line 1: syntax error: unexpected end of file
Creating UNIX user failed, this can be done later by running lxrun.exe /setdefaultuser

I collected the etl files - let me know if you want me to send them

rob

@benhillis
Copy link
Member

benhillis commented Jul 8, 2016

@leictreon Sorry I did not see your comment until just now. The issue you are seeing is probably due to the same bug reported in #598. To confirm, does your Windows username have a " or ' character in it?

@benhillis
Copy link
Member

Closing this out since the #598 is tracking the remaining issue.

@aaronendsley
Copy link

any update on how to fix this i am currently experiencing the same issue, with it not creating the user and just defaulting me to root.

@benhillis
Copy link
Member

This is fixed in recent insider builds.

@aaronendsley
Copy link

Im going to sound really dumb here but thats okay lol, what is an insider build?

@aseering
Copy link
Contributor

@VeritasX -- good question :-) An Insider build is a public pre-release build of Windows. It contains all the latest features, including changes that might not be fully implemented yet and that aren't fully tested yet so can cause system instability.

Generally, new Windows features are released to the Insider "Fast" lane every week or two. Periodically, if a "Fast"-lane build is found to be particularly stable, it is released to the "Slow" Insider lane. Eventually, those releases turn into Release Candidates and, in theory (though no official commitment) at least once per year, get rolled into the next Windows release. So if a change makes it into an Insider build, that means both that it's available for testing and that it's on track to eventually ship in an official build.

The Insider track is separate from regular Windows Updates. Windows Updates are just security fixes and bugfixes to stable features. (WSL is not yet considered "stable".)

You can learn more, and sign up if you want, here: https://insider.windows.com

@gabefair
Copy link

Just curious, is anyone using windows home?

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

No branches or pull requests

7 participants