[CentOS] Centos7 Cant start vncserver

Fri May 26 05:04:57 UTC 2017
anax <anax at ayni.com>

Hi Robert
apparently vncserver writes its PID file somewhere else than into 
/home/root/.vnc/homebase.home.htt:3.pid, where systemd expects it to be.
Go into /lib/systemd/system/vncserver.service and correct the PID file 
location there, so that it matches the location where vncserver writes 
its PID file.
And then do a
systemctl deamon-reload
systemctl start vncserver

and then after the SECOND start of vncserver (not the first) it will work.

suomi

On 05/25/2017 07:00 PM, Robert Moskowitz wrote:
> Actually it is running:
> 
> netstat -tuln | grep 590
> tcp        0      0 0.0.0.0:5901            0.0.0.0:* LISTEN
> tcp        0      0 0.0.0.0:5902            0.0.0.0:* LISTEN
> tcp        0      0 0.0.0.0:5903            0.0.0.0:* LISTEN
> tcp6       0      0 :::5901                 :::* LISTEN
> tcp6       0      0 :::5902                 :::* LISTEN
> tcp6       0      0 :::5903                 :::* LISTEN
> 
> Why 5901 and 2 are listening, I don't know...
> 
> when I vnc to my server I get that basic nasty blank X11 screen.  I 
> modified /root/.vnc/xstartup with:
> 
> exec /bin/sh /etc/xdg/xfce4/xinitrc
> 
> But restarting vncserver@:3 does not seem to get the vnc client to get 
> my xfce desktop, only the blank x11 desktop.
> 
> Oh and restart gives the same errors as start does, but the pids are there:
> 
> # ls .vnc/
> homebase.home.htt:1.log  homebase.home.htt:2.pid  passwd
> homebase.home.htt:1.pid  homebase.home.htt:3.log  xstartup
> homebase.home.htt:2.log  homebase.home.htt:3.pid
> 
> I see:
> 
> cat .vnc/homebase.home.htt\:1.log
> 
> Xvnc TigerVNC 1.3.1 - built Nov 16 2016 13:38:44
> Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
> See http://www.tigervnc.org for information on TigerVNC.
> Underlying X server release 11702000, The X.Org Foundation
> 
> 
> Thu May 25 12:45:56 2017
>   vncext:      VNC extension running!
>   vncext:      Listening for VNC connections on all interface(s), port 5901
>   vncext:      created VNC server for screen 0
> /root/.vnc/xstartup: line 5: /etc/xdg/xfce4/xinitrc: Permission denied
> /root/.vnc/xstartup: line 5: exec: /etc/xdg/xfce4/xinitrc: cannot 
> execute: Permission denied
> 
> 2.log has different errors.
> 
> 3.log actually has connection information (as I am connecting to 5903?)
> 
> thanks
> 
> On 05/25/2017 12:37 PM, Robert Moskowitz wrote:
>> OK, first time configuring vncserver on Centos7.  I have read through 
>> a bunch of old messages here on vncserver and thought I had it. 
>> Obviously not.
>>
>> 1)    cp /usr/lib/systemd/system/vncserver at .service 
>> /etc/systemd/system/vncserver at .service
>> 2)    vi /etc/systemd/system/vncserver at .service
>>
>> I changed <USER> in both places to root
>>
>> 3)    systemctl daemon-reload
>> 4)    systemctl enable vncserver@:3.service
>> 5)    vncpasswd
>>         To create /root/.vnc/passwd
>> 6)    systemctl start vncserver@:3.service
>>
>> # systemctl -l status vncserver@:3
>> ● vncserver@:3.service - Remote desktop service (VNC)
>>    Loaded: loaded (/etc/systemd/system/vncserver at .service; enabled; 
>> vendor preset: disabled)
>>    Active: failed (Result: resources) since Thu 2017-05-25 12:31:13 
>> EDT; 13s ago
>>   Process: 5173 ExecStart=/usr/sbin/runuser -l root -c 
>> /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
>>   Process: 5170 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > 
>> /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
>>
>> May 25 12:31:10 homebase.home.htt systemd[1]: Starting Remote desktop 
>> service (VNC)...
>> May 25 12:31:13 homebase.home.htt systemd[1]: PID file 
>> /home/root/.vnc/homebase.home.htt:3.pid not readable (yet?) after start.
>> May 25 12:31:13 homebase.home.htt systemd[1]: Failed to start Remote 
>> desktop service (VNC).
>> May 25 12:31:13 homebase.home.htt systemd[1]: Unit 
>> vncserver@:3.service entered failed state.
>> May 25 12:31:13 homebase.home.htt systemd[1]: vncserver@:3.service 
>> failed.
>>
>>
>> Thanks for all help.
>>
>>
>>
>>
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> https://lists.centos.org/mailman/listinfo/centos
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos