The HOME
environment variable is set automatically when you log in. Under normal circumstances you shouldn't find any of the login scripts modifying it in any way.
Environment variables are usually passed unmodified to programs executed in your login session. And there is hardly ever a reason to unset HOME
, thus the error condition you mention does not sound very likely.
You can try this command to see your current environment variables:
tr '\0' '\n' </proc/$$/environ
And you can replace $$
with the pid of any process whose environment variables you want to see (though there are obviously security restrictions to which processes you are allowed to look at, if you are not root).
If you find that HOME
does exist when you invoke the above from your shell, you can try using strace
to see at which point they disappear. You can try:
strace -fve execve vncserver
This will run vncserver
and show you which environment variables were passed to vncserver
and anything executed by vncserver
.
Finally you can try creating a new user to see if the problem relates to a specific user's configuration files or is a systemwide problem.