trouble with VNC Server
I'm running RHEL 7.4. I'm trying to get VNC Server working. I have followed the instructions at https://access.redhat.com/solutions/966063 as best as I can. I've installed TigerVNC on my Windows 10 remote computer.
At first, when I ran TigerVNC from Win10 and provided the IP address appended by :5901, I was prompted for a password. This seemed proper. Later, testing, I provided an incorrect password and got an expected error. When I provided the correct password, things seemed to move forward, but the window was all black inside.
Google research suggested "sudo kill $(pgrep Xvnc)" then "sudo vncserver" on the Linux computer
After that, I retried TigerVNC from the Win10 computer. This time I got my KDE screen successfully...
HOWEVER, I appear to be logged in as root, when I intended to be logged in as user "flast" (for Firstname Lastname abbreviation). This is my primary problem. My secondary problem is that it appears I'm going to have to do the kill/vncserver after each boot of the Linux computer, when I'd rather it remember this.
DETAILS...
When I log in directly to the Linux computer as "flast", I have created a folder ~/.vpn that contains file xstartup per the link far above.
I am also able to find a /root/.vpn/xstartup file.
When I do the kill/vncserver commands mentioned, I get screen output that says "Starting applications specified in /root/.vnc/xstartup".
So this makes me think that the kill/vncserver commands are specifically setting me up so that from Win10 I end up logging in as root instead of flast. It also makes me think that after reboot, OpenVPN is appropriately using ~/.vpn/xstartup, and that is is somehow wrong and therefore the reason that I get a black screen after boot.
I could look for parameters to vncserver, so that my kill/vncserver sequence uses the correct xstartup. I would expect to get back to the black screen problem. I would then expect that I need to fix ~/.vnc/xstartup. Rather than going through that, I think I need to fix ~/.vnc/xstartup directly. [EDIT: I ran vncserver --help to find -xstartup option. I've now run "vncserver -xstartup ~/.vnc/xstartup" and "vncserver -xstartup /root/.vnc/xstartup" and gotten the expected results. So it indeed seems to be a problem with ~/.vnc/xstartup. HOWEVER, I now have a new problem trying to log in as root. Rather than being already logged in, I'm now prompted to log in. When I do so, it then hangs at the login. Specifically, the screen starts black. I mouse over to get login as root. I provide password and click "Unlock". Screen is then frozen.]
I'm posting right now via Win10, so I can't cut/paste my ~/.vnc/xstartup file content. Instead, I'll just say that it matches the link exactly as much as it should. With that said, I'll recreate it here:
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#vncconfig -iconic &
#dbus-launch --exit-with-session gnome-session &
startkde &
Maybe it's instead about my /etc/systemd/system/vncserver@:1.service file. That file contains what the link suggests, with flast replacing testuser1 of the example at the link.
I just don't know. I'm thinking the black screen is because my xstartup isn't right, even though it matches the link's advice...
Responses