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

"LxRun.exe /setdefaultuser" fails if temp folder is not accessible #752

Closed
zzpxyx opened this issue Aug 4, 2016 · 8 comments
Closed

"LxRun.exe /setdefaultuser" fails if temp folder is not accessible #752

zzpxyx opened this issue Aug 4, 2016 · 8 comments

Comments

@zzpxyx
Copy link

zzpxyx commented Aug 4, 2016

  • A brief description
    LxRun.exe /setdefaultuser will fail if Windows temp folder is not accessible, either because of privilege or unsupported file systems like RAM disk, etc.
  • Expected results
    The default user should be set to the given user without any error.
  • Actual results (with terminal output if applicable)
    An error message like:
    /bin/bash: /mnt/d/TEMP/uid.txt: No such file or directory
    or
    /bin/bash: /mnt/c/WINDOWS/TEMP/uid.txt: No such file or directory
    Note that the first error message appears when my Temp folder is on a RAM disk, and the second appears when I'm using the system-level Temp folder (C:\Windows\Temp).
  • Your Windows build number
    10.0.14393
  • Steps / commands required to reproduce the error
    Set the Temp folder to a RAM disk or use the system-level Temp folder. Then execute the command:
    LxRun.exe /setdefaultuser <username>
@benhillis benhillis added the bug label Aug 4, 2016
@rainabba
Copy link

rainabba commented Aug 26, 2016

First hit on Google for this error, 21 days ago and no so much as another comment?! I'm not REALLY the 2nd person who's hit this bug am I?

I followed all instructions to get this far and had no other issues along the way so I don't think I caused it. I even used an elevated cmd prompt and tried lxrun.exe /setdefaultuser after hitting it the 2nd time so I don't think it's actually a permissions error on the standard Windows side and I started investigating.

My TEMP environment variable reports as TEMP=C:\TEMP, but my actual folder is c:\Temp. This cannot be changed at standard runtime because of app using the folder and being a Linux user, I'm aware of case issues in POSIX environments so I updated my environment variable with set TEMP=c:\Temp then tried again and it worked.

Workaround: set TEMP={your actual temp folder, including case sensitivity}

Fix: MS should check any environment variables and/or registry settings that this bash environment will be dependant on and make sure case is updated in those variables if it doesn't match. In Linux, suggesting such a thing would seem absurd since it's a standard requirement, but for a Windows user with limited bash experience, something this simple could be a real nightmare.

UPDATE: Turns out that I ended up here because I didn't like C:\WINDOWS\TEMP as a temp folder (because filling up the OS folder with temp content is asinine) and I created a new one in a more sensible partition then overwrote the system variable with a user variable without considering case.

@benhillis
Copy link
Member

This had the same root cause as #598 for which a fix is incoming. Marking this as a duplicate. Thanks again for reporting!

@kimfaint
Copy link

kimfaint commented Dec 9, 2016

I hit this issue when installing today. Cause was on my system C:\Temp was actually C:\temp. Had to rename directory then rerun lxrun.exe /setdefaultuser.

@benhillis
Copy link
Member

Which Windows build are you on? This is fixed in recent insider builds.

@kimfaint
Copy link

kimfaint commented Dec 9, 2016

OS Build 14393.0.

@leonhui
Copy link

leonhui commented Dec 14, 2016

**/bin/bash: /mnt/c/TEMP/uid.txt: Input/output error**

Bug occurs for me if the TEMP directory is a JUNCTION.

My TEMP=C:\TEMP, where TEMP is also mounted to a different volume via diskmgmt.msc.

Under cmd.exe it shows it as:

12/02/2016 02:31 <JUNCTION> TEMP [\??\Volume{xxxxxxxxxxxxxxxxxxxxxxxxxx}\]

However, under bash, ls or ll does not show it but cd /mnt/c/TEMP errors with

bash: cd: TEMP: Input/output error

@aseering
Copy link
Contributor

@leonhui -- that sounds related to #559 and #1475 . In general, WSL doesn't support Windows Junctions right now. Those tickets have more details.

@benhillis
Copy link
Member

@leonhui - Are you on build 14393? This will not be a problem in recent insider builds.

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

No branches or pull requests

6 participants