TigerVNC on RHEL7

0

From RHEL7/Centos7, chkconfig was removed, and replaced by systemctl, that combine with chkconfig and service, and powerful. But I found that have some issue when interactive with tigervnc, that maybe tigervnc issue, i use default rpm for “tigervnc-server-1.2.80”.

Install and Enable TigerVNC

When you install the TigerVNC on RHEL7/Centos7, maybe work normal by  follow step:

[root@frank yum.repos.d]# yum install tigervnc-server.x86_64 
[root@frank yum.repos.d]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
[root@frank yum.repos.d]# vim /etc/systemd/system/vncserver@:1.service 
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 1024x768"
PIDFile=/home/root/.vnc/%H%i.pid
[root@frank yum.repos.d]# systemctl disable firewalld.service

But I found more issue and report alarms(that waste long time!!!), follow only one issue:

[root@frank system]# systemctl status vncserver@3.service
vncserver@3.service - Remote desktop service (VNC)
   Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled)
   Active: failed (Result: exit-code) since Wed 2014-10-01 18:26:26 EDT; 5s ago
  Process: 8771 ExecStart=/sbin/runuser -l  -c /usr/bin/vncserver %i (code=exited, status=1/FAILURE)
  Process: 8768 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Oct 01 18:26:26 frank runuser[8771]: runuser: user  does not exist
Oct 01 18:26:26 frank systemd[1]: vncserver@3.service: control process exited, code=exited status=1
Oct 01 18:26:26 frank systemd[1]: Failed to start Remote desktop service (VNC).
Oct 01 18:26:26 frank systemd[1]: Unit vncserver@3.service entered failed state.

So I give up use systemctl to control vnc, I change follow way that resolved vnc auto reload after chassis reboot. In RHEL7/Centos7, default remove execute permissions for /etc/rc.d/rc.local, so if you use the way, you need change it:

[root@frank rc.d]# chmod 777 rc.local
[root@frank rc.d]# vim rc.local 
/sbin/runuser -l root -c /usr/bin/vncserver :1
/sbin/runuser -l cisco -c /usr/bin/vncserver :2

After reboot RHEL7, you will found VNC normal work.

Change VNC Port-2021 Updated

Due to only have 8080 port can be accessed on CentOS, so need to change default port 5900. (tigervnc-1.8.0-22.el7.x86_64)

Follow info before modified:

[root@localhost ~]# grep "59" /usr/bin/vncserver -n
21:#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
188:$vncPort = 5900 + $displayNumber;
500:# n is taken if something is listening on the VNC server port (5900+n) or the
519:# (5900+n) or the X server port (6000+n).
536:    if (!bind(S, pack('S n x12', $AF_INET, 5900 + $n))) {

Follow info after modified:

[root@localhost ~]# grep "80" /usr/bin/vncserver -n
188:$vncPort = 8078 + $displayNumber;
536:    if (!bind(S, pack('S n x12', $AF_INET, 8078 + $n))) {

After restart:

[root@localhost ~]# netstat -ntpl|grep vnc
tcp        0      0 0.0.0.0:5802            0.0.0.0:*               LISTEN      2992/Xvnc
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      2992/Xvnc
tcp        0      0 0.0.0.0:6002            0.0.0.0:*               LISTEN      2992/Xvnc
tcp6       0      0 :::5802                 :::*                    LISTEN      2992/Xvnc
tcp6       0      0 :::8080                 :::*                    LISTEN      2992/Xvnc
tcp6       0      0 :::6002                 :::*                    LISTEN      2992/Xvnc
本文出自 Frank's Blog

版权声明:


本文链接:TigerVNC on RHEL7
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接
你可以留言,或者trackback 从你的网站

留言哦

blonde teen swallows load.xxx videos