Windows – Cygwin – Cannot or does not create user profile files – /home/User/

cygwin;windowswindows 7

I have a fair amount of experience with Cygwin and it's setup, however this time it is behaving strangely. When I installed it everything seemed to work great, but upon opening the Cygwin prompt I received none of the usual setup your account info lines. Upon looking in my c:/cygwin/home/ directory I found that it did not create a user for me or any of the files it normally does, like .bashrc, etc.
I then set Cygwin to run as an Administrator, with no effect. Next I ran the cygwin.bat file as a possible fix suggested it might force the user profile file creation. Next I created a User directory of my name(the same as my windows user account name and what Cygwin is expecting from the /etc/passwd file) and put my .ssh directory in there and was able to use the ssh keys as normal to connect to remote servers. However, Cygwin still did not create any of the Cygwin files. I then chmod'ed the directory to 777 to make sure cygwin could write to it, also with no effect.

So it appears Cygwin is able to read from that directory but cannot or does not even try to create the user files.

Best Answer

The answer to this question was fairly simple: I was unaware that the windows environment would be the first option for setting the $HOME variable, so cygwin was trying to read my config files from /cygdrive/c/User/[UserName] rather than /home/[UserName]. I put symbolic links to the cygwin location in my Windows user directory and that fixed the issue.

I was able to find enough useful info to help me debug my problem from this related superuser post: Cygwin .bashrc not being source because cygwin starting in Windows home

Related Question