"mkdir: cannot create directory '/cygdrive/c/WINDOWS/system32/config' [..] Setting HOME to /tmp" when starting Cygwin's terminal

2

Suddenly I've been getting the following error when starting up Cygwin's terminal:

mkdir: cannot create directory '/cygdrive/c/WINDOWS/system32/config': Permission denied
/cygdrive/c/WINDOWS/system32/config/systemprofile could not be created.
Setting HOME to /tmp.

The terminal was previously working for me without this error. I have not made changes since this the last successful start. I'm not sure why the terminal needs to make a directory in the windows directory, anyway.

I had set the HOME variable to be %USERPROFILE% as per these instructions.

If I run the terminal as an administrator, I do not get this error and my home directory is correct.

What could have changed to cause this error and how can I fix it?

Kat

Posted 2014-09-09T17:12:12.950

Reputation: 711

Answers

3

You need to set HOME as a USER variable.
I detected the same behavior when it was set as a SYSTEM variable.

zigarn

Posted 2014-09-09T17:12:12.950

Reputation: 146

+1, Confirmed this was the fix to the problem. – David Refoua – 2017-08-25T18:33:38.247