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

home directory inaccessible after upgrading to 14951 #1260

Closed
dreyks opened this issue Oct 23, 2016 · 9 comments
Closed

home directory inaccessible after upgrading to 14951 #1260

dreyks opened this issue Oct 23, 2016 · 9 comments

Comments

@dreyks
Copy link

dreyks commented Oct 23, 2016

Upgraded to 14951 from 14946
Can't access user home directory even as root

  • Actual results (with terminal output if applicable)
root@laptop:/home# ls -la
total 12 # on a side note why does it say 12?
drwxr-xr-x 0 root  root  0 Apr 11  2014 .
drwxr-xr-x 0 root  root  0 Sep 27 00:03 ..
drwxr-xr-x 0 dreyk dreyk 0 Oct 13 20:07 dreyk
root@laptop:/home# cd dreyk/
root@laptop:/home/dreyk# ls -la
ls: reading directory '.': Permission denied
total 0

Alternatively C:\Users\dreyk\AppData\Local\lxss\home\dreyk is completely accessible including the ability to open/view files, so this has to be a permissions problem rather than data corruption (which I already faced several builds ago)

  • Your Windows build number
    14951

Any suggestions how to overcome this?

UPD: running bash.exe as windows admin didn't change anything

@rodrymbo
Copy link

rodrymbo commented Oct 23, 2016

Here's a way that might get things going again, and maybe reveal what happened.

Move that C:\Users\dreyk\AppData\Local\lxss\home\dreyk directory somewhere else outside of that lxss directory tree using Explorer, e.g. to x:\wherever. Use lxrun to set the default user to root, if it isn't already, then go into bash.exe and copy the files from /mnt/x/wherever to /home/dreyk. Then chown and chmod appropriately, and try su - dreyk to see if the user works.

Folders and files in x:\whatever are accessible by default from within WSL (unless configured in Windows to not be accessible). If you copy from whatever to /home from within WSL, they should become accessible there.

And if that doesn't work, we'll know that there's a different problem.

Rescuing inaccessible files is about the only time you might get away with accessing files in C:\Users\dreyk\AppData\Local\lxss\home\dreyk with Windows tools. Otherwise, it is best if you pretend that you don't know how to find it. Files written in that area with Windows tools become inaccessible (as a general rule) from within WSL.

@dreyks
Copy link
Author

dreyks commented Oct 23, 2016

Yep I know about the last part. Will try your solution and report. Thanks

@fpqc
Copy link

fpqc commented Oct 24, 2016

You should be able to automate fixing permissions on the user home directory with setting 755 and 644, except your ssh private key which must be 400.

@dreyks
Copy link
Author

dreyks commented Oct 26, 2016

@fpqc I can't do this as this folder is fully inaccessible including the root user. doing chmod -R +r . leads to the same permission error

@dreyks
Copy link
Author

dreyks commented Oct 26, 2016

This seems to be caused by sshd. I've reinstalled WSL from scratch but the moment I started ssh I got this error once again

@rodrymbo
Copy link

rodrymbo commented Oct 26, 2016

So before you start sshd, you can access the home directory as root or the user, but as soon as you start sshd the home directory becomes inaccessible? Is it still inaccessible if you reboot and enter bash.exe without starting sshd?

Could you review for us how you start sshd? Can you log in to WSL via ssh when it is running?

@dreyks
Copy link
Author

dreyks commented Oct 26, 2016

I'm trying different things right now. But it seems that now i get this error even on clean uninstall/install of wsl. i'll investigate further and report

@dreyks
Copy link
Author

dreyks commented Oct 26, 2016

btw i somehow have a System Volume Information folder in my home directory which i cannot delete from windows side.

@dreyks
Copy link
Author

dreyks commented Oct 26, 2016

Ok, it seems that this System Volume Information folder was really to blame. I changed its owner to Administrators, deleted it and instantly the error was gone. Don't know how did this folder appear there though and why did it happen after a new build installed

I think the issue can be closed now

@dreyks dreyks closed this as completed Oct 26, 2016
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

3 participants