Cannot start vnc server because the USER environment variable is not set
We cannot load vnc server on startup. The only way we can get to run is to stop and start the service once were in KDE. This is unacceptable because we need to remotely administrate it.
How do we set the USER environment variable for VNC server?
Startup error looks like this
“Starting vncserver: Starting VNC server: 3: root vncserver: The USER environments variable is not set”
I am guessing this is you:
/root/.vnc/xstartup: !/bin/sh: No such file or directory
sh: /lib/cpp: No such file or directory
xset: bad font path element (#37), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
This message tells me that the file /root/.vnc/xstartup doesn't exist. If it does, do chown root:root /root/.vnc/xstartup and make sure you own it. Not sure of rights needed on it but I would guess 722 would do it.
I was hoping I could find you an answer. I have not ever had that problem on any distro. I know you have to log in least once and start vncserver from command line to build required dirs and files and configure passwords.
Please let us know what happens and what the problem was.
Thanks for the quick reply.
that is me
the file xstartup does exist and it looks like this
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
As far as permissions go im not that knowledgable. But in the permissions tab root is the owner and ive given read write and exec permissions to user, group, and others
Have you tried creating a small rc script with USER and HOME in it? Something like:
export USER HOME
Of course you may want to reconsider running it as root.
the reason for this is that when the vncserver was started the login user is not the one who executed the vncserver at startup.
to solve this, do this:
edit your /etc/rc.local
and add this: su -c "vncserver -depth 32 -geometry 1024x768" your_username
save and close then reboot your pc.
|All times are GMT -5. The time now is 09:50 PM.|