VNC configure on Oracle Linux 7

Configure tigervnc-server on Oracle Linux 7


 This guide will help you configure tigervnc-server on an Oracle Linux 7 server.

Note: This guide assumes that this is a first time setup.
Note: "tigervnc-server" and "tigervnc" are different. For "tigervnc" view (Doc ID 1512402.1)

SOLUTION

 Installing and configuring tigervnc-server:

1. Install the tigervnc-server rpm.

       Note: The RPM is available under the Channel: Oracle Linux 7 Latest (x86_64)

# yum install tigervnc-server
2. Copy the configuration file, /lib/systemd/system/vncserver@.service, to the directory /etc/systemd/system/ following the naming of ' vncserver_<username>@:<port>.service '

Note: It is common to create different configuration files for each user. As a best practice we can add the username to the configuration file as this will help to identify which file belongs to each user. This is not required.
For example:

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver_root@:2.service
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver_oracle@:3.service
3. Modify the configuration files that have been created for each user (In this example we are going to use ROOT and ORACLE) :

       A. Replace "<USER>" with "root" for file "vncserver_root@:2.service" and "oracle" for file "vncserver_oracle@:3.service" with #vi .

 # vi /etc/systemd/system/vncserver_root@:2.service
 # vi /etc/systemd/system/vncserver_oracle@:3.service

           You may also use #sed to automatically make the username replacement:

# sed -i 's/<USER>/root/g' /etc/systemd/system/vncserver_root@:2.service
# sed -i 's/<USER>/oracle/g' /etc/systemd/system/vncserver_oracle@:3.service

       B. Add the geometry to the configuration file as well for each user. In this example we are going to add "-geometry 800x800" to the configuration file. This will be at the end of the line starting with "ExecStart". You can perform this task as well manually with #vi or with #sed .

           #sed example is available below:

# sed -i 's/i"/i -geometry 800x800"/g' /etc/systemd/system/vncserver_root@:2.service
# sed -i 's/i"/i -geometry 800x800"/g' /etc/systemd/system/vncserver_oracle@:3.service


After making the modifications in step A and B the line we have modified under the configuration file should look similar to these:

For file "vncserver_root@:2.service"
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 800x800"

For File "vncserver_oracle@:3.service"
ExecStart=/sbin/runuser -l oracle -c "/usr/bin/vncserver %i -geometry 800x800"

4. We will now enable the vncserver service for each user on the selected port, this will also enable autostart on system boot, with the commands below:

# systemctl enable vncserver_root@:2.service
# systemctl enable vncserver_oracle@:3.service

5. Configure a password for each user to be used with vncserver. You will need to execute #vncserver in the command line while logged in as the user. This will automatically ask you to create a new password for the user.

oracle$ vncserver

6. You will need to restart the server. This is required, otherwise you will encounter a black screen when trying to access via eg, VNCVIEWER.

7. After server boots you will need to open the ports to be able to reach the server. 
For example via #iptables

 Note: In this example we have configured root to use port 2 and oracle to use port 3, as per the configuration file naming "vncserver_root@:2.service" and "vncserver_oracle@:3.service" . If you are going to access from an external network you will need to make sure the ports needed are opened and available, you may require assistance from your local network departments.
iptables -I INPUT -m state --state NEW -p tcp --destination-port 5902 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --destination-port 5903 -j ACCEPT
 
8. You can now try to connect via VNC Viewer using the format below: 

eg:
< Server IP> :5902
< Server IP> :5903

No comments:

SHRD0014: GLLEZL - process exiting with failure

  SYMPTOMS Journal Import completes with the following error: Error ------ ORA-01653 : unable to extend table GL.GL_IMPORT_REFERENCES ORA-01...