Detecting and Shutting Down VNC Server in CentOS-7

To list the ports and the Xvnc session’s associated user, as root, enter:

# lsof -i -P | grep vnc
Xvnc        2267     root    5u  IPv6    76766      0t0  TCP *:6003 (LISTEN)
Xvnc        2267     root    6u  IPv4    76767      0t0  TCP *:6003 (LISTEN)
Xvnc        2267     root    9u  IPv4    76775      0t0  TCP *:5903 (LISTEN)
Xvnc        2267     root   10u  IPv6    76776      0t0  TCP *:5903 (LISTEN)

Apparently, there is some Xvnc running. To do a quick shutdown

# systemctl |grep vnc
vncserver@:1.service                                                                             loaded active running   Remote desktop service (VNC)
  system-vncserver.slice                                                                           loaded active active    system-vncserver.slice
# systemctl stop vncserver@:1.servic
# systemctl stop system-vncserver.slice

Check that the XVNc again

# systemcl stop xvnc.socket
# systemctl status xvnc.socket
* xvnc.socket - XVNC Server
   Loaded: loaded (/usr/lib/systemd/system/xvnc.socket; disabled; vendor preset: disabled)
   Active: inactive (dead)
   Listen: [::]:5900 (Stream)
Accepted: 0; Connected: 0
# systemctl |grep vnc

If however, you are interested in setting up VNC, there is a good article for you to consider
Remote-desktop to a host using VNC¶

Installing and Configuring Red Hat Enterprise Virtualisation

Step 1: Ensure that you have subscribed to Red Hat Virtualisation Channels. For more information, see Subscribing to Red Hat Virtualisation Manager Channels

Step 2: Install RHEVM packages.

This will take a while…… 1.6GB of downloads…….

# yum install rhevm rhevm-reports

Step 3: Link the Directory Server to the Red Hat Enterprise Virtualisation Manager.

See Joining RHEVM-Manage-Domain tool to join AD Domain

Step 4: Install RHEV manager

# rhevm-setup

Step 5: Go to the website – Administration Portal

RHEV_portal

Step 6: Logon to the Portal with admin

RHEV_Portal2

Step 7: Create Data Centre

Step 8: Create and Populate a New ISO NFS Storage Domain

Step 9: Creation of Logical Network

Step 10: Creation of Windows 7 with Virtio

Using TurboVNC 0.6 and VirtualGL 2.1.4 to run OpenGL Application Remotely on CentOS

 
Acknowledgement:
Much of these materials come from VirtualGL documents with additional notes by me from the field.

 

1. What is VirtualGL?
According to VirtualGL Project Website:

“VirtualGL is an open source package which gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration…..With VirtualGL, the OpenGL commands and 3D data are instead redirected to a 3D graphics accelerator on the application server, and only the rendered 3D images are sent to the client machine……” For more information see What is VirtualGL? from Project Website

2. System Requirements:
See VirtualGL System Requirements from Project Website.

Taken from Virtual GL

3. Download and Install TurboJPEG and VirtualGL on CentOS 5.x.

For more detailed information, see
User Guide for Virtual 2.1.4

a. Download and Install TurboJPEG….

Go to the VirtualGL Download page

# rpm -Uvh turbojpeg*.rpm

b. Download and Install VirtualGL….

Go to the VirtualGL Download page

# rpm -Uvh VirtualGL*.rpm
 
4. Accessing to the 3D Xserver
According to the Project Website, VirtualGL requires access to the application server’s 3D graphics card so that it can create off-screen pixel buffers (Pbuffers) and redirect the 3D rendering from applications into these Pbuffers.

a. Shutdown Display Manager

# init 3

 

5. Configure VirtualGL Server Configuration

a. Run

# /opt/VirtualGL/bin/vglserver_config

b. Only users in the vglusers group can use VirtualGL

Restrict local X server access to vglusers group (recommended)?
[Y/n] Y

c. Only users in the vglusers group can run OpenGL applications on the VirtualGL server

Restrict framebuffer device access to vglusers group (recommended)?
[Y/n] Y

d. Disabling XTEST will prevent them from inserting keystrokes or mouse events and thus hijacking local X sessions on that X server.

Disable XTEST extension (recommended)?
[Y/n] Y

e. If you choose to restrict X Server or framebuffer device access to the vglusers group, then add root and users to the vglusers group

# vim /etc/group
vglusers:x:1800:root,user1,user2

f. Restart the Display Manager.

# init 5
(To verify that the application server is ready to run VirtualGL, log out of the server, log back into the server using SSh, and execute the following commands in the SSh session)

g. If you restricted 3D X server access to vglusers

xauth merge /etc/opt/VirtualGL/vgl_xauth_key
xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0

h. If you did not restrict 3D X server access

xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0

6. SSH Server Configuration

# vim /etc/ssh/sshd_config
X11Forwarding yes
# UseLogin No

*7. Checking that the OpenGL are using hardware drivers and direct rendering enabled to maximise performance.

# glxinfo |grep render

For example,

direct rendering: Yes
OpenGL renderer string: Quadro FX 3450/4000 SDI/PCI/SSE2
GL_NVX_conditional_render, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod,

*8. Install and configure TurboVNC Server at the VirtualGL Server

a. Firstly, I uninstall the CentOS default vncserver

# yum remove vnc-server

b. Go to the VirtualGL Download to obtain and install the TurboVNC.rpm

# rpm -Uvh turbovnc*.rpm

c. The default rpm install places TurboVNC at /opt. You can create softlink at /usr/bin to /opt/TurboVNC

# ln -s /opt/TurboVNC/bin/vncserver /usr/bin/vncserver
# ln -s /opt/TurboVNC/bin/vncviewer /usr/bin/vncviewer
# ln -s /opt/TurboVNC/bin/vncpasswd /usr/bin/vncpasswd
# ln -s /opt/TurboVNC/bin/Xvnc /usr/bin/Xvnc

*9. Using TurboVNC

Open a session of VNC by simply typing

# vncserver
New 'kittycool:1 (root)' desktop is kittycool:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/kittycool:1.log

(In the VNC Client, type)
kittycool:1

To Test whether the Virtual Server is working, type

# cd /opt/VirtualGL/bin
# ./vglrun glxgears


You will see a near smooth generation of the glxgears relative to hardware. Congrat!