Showing posts with label VNC. Show all posts
Showing posts with label VNC. Show all posts

Monday, February 27, 2017

Annoying GUI Pop-up in VNC and how to disable it?

# ls -l /etc/xdg/autostart/gpk-update-icon.desktop
-rw-r--r-- 1 root root 7115 Feb 16 16:04 /etc/xdg/autostart/gpk-update-icon.desktop
Append below line in above mentioned file:
X-GNOME-Autostart-enabled=false

Once done, restart server and the pop-up shown above should be gone.

Thursday, April 26, 2012

How to configure VNC on Redhat Linux 6?

I was trying to configure VNC on my RHEL6U1 test machine using my old method of editing /etc/xinetd/vncservers file when I came across the difference between RHEL6 and previous versions of RHEL. In RHEL6, the VNC Server configuration is rather easy than previous versions of Linux. Here is what I had to do:
# cat /etc/sysconfig/vncservers 
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.  
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 1680x1050 -depth 24"


# cat /etc/sysconfig/iptables 
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 5902 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Thursday, March 5, 2009

VNC with two monitors

Note : This article is true for Redhat Linux.

My users need big display because of type of their software tools. In this article, I will explain how to modify VNC's configuration to support two monitors.

I assume that the VNC is already working fine for other (single monitor) resolution. If this is the case, then go on reading. If you yet to setup VNC from scratch, it may not be the right article.

In my case, I did the two monitors setup in three steps: (note that my servers are already running VNC)


STEP 1) Edit /etc/services to add a new VNC port. In my case I added following line in /etc/services:

vnc-2500x1000x24 5976/tcp

STEP 2) Edit /etc/xinetd.d/vncserver to add new resolution entry given below:

############# FOR DUAL MONITOR #########################################################################
service vnc-2500x1000x24
{
disable = no
socket_type = stream
protocol = tcp
port = 5976
wait = no
user = demo
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 2500x1000 -depth 24 -SecurityTypes=None
}
#########################################################################################################


STEP 3) Restart xinetd service by following command:

# service xinetd restart


Once above three steps are done, then users can connect to VNC using their favorite VNC viewer (in my case RealVNC) to the IP address and port number 76.

For example 10.10.10.10:76

Friday, January 23, 2009

VNC server setup on Linux

Setting up VNC on linux is very straight forward provided we follow ALL steps.

Here are the steps to setup VNC on Redhat Linux:
1) Edit /etc/services to add VNC related information/ports
2) Edit /etc/xinetd.d/vncserver to specify which user and which ports to use to run VNC
3) Check the status of vncserver, if disabled then enable it for run level 3/4/5.
4) Invoke "gdmconfig" and enable XDMCP protocol.
5) Restart "xinetd" service. Viola! You are done setting up VNC.
6) Use any VNC viewer to connect the server on ports mentioned in /etc/xinetd.d/vncserver (in this case, it is port 5972 or 5972/ or simply port 72 or 73 for a VNC viewer).



# cat /etc/services
:
:
:
# Local services
#
# VNC Servers
#
vnc-640x480x8 5950/tcp
vnc-800x600x8 5951/tcp
vnc-1024x768x8 5952/tcp
vnc-1280x1024x8 5953/tcp
vnc-1600x1200x8 5954/tcp

vnc-640x480x16 5960/tcp
vnc-800x600x16 5961/tcp
vnc-1024x768x16 5962/tcp
vnc-1280x1024x16 5963/tcp
vnc-1600x1200x16 5964/tcp

vnc-640x480x24 5970/tcp
vnc-800x600x24 5971/tcp
vnc-1024x768x24 5972/tcp
vnc-1280x1024x24 5973/tcp
vnc-1600x1200x24 5974/tcp

vnc-640x480x32 5980/tcp
vnc-800x600x32 5981/tcp
vnc-1024x768x32 5982/tcp
vnc-1280x1024x32 5983/tcp
vnc-1600x1200x32 5984/tcp

# cat /etc/xinetd.d/vncserver
# description: This vnc server serves vnc-1024x768x24 VNC sessions
service vnc-1024x768x24
{
disable = no
socket_type = stream
protocol = tcp
port = 5972
wait = no
user = demo
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24 -SecurityTypes=None
}
# end
# description: This vnc server serves vnc-1024x768x24 VNC sessions
service vnc-1280x1024x24
{
disable = no
socket_type = stream
protocol = tcp
port = 5973
wait = no
user = demo
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 24 -SecurityTypes=None
}
# end


# chkconfig --list vncserver
vncserver 0:off1:off2:off3:on4:on5:on6:off

# /sbin/service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

# /usr/sbin/gdmconfig





# echo "With gdmconfig.... enabled XDMCP (from the last tab)"
With gdmconfig.... enabled XDMCP (from the last tab)

# /sbin/service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
#

OPTIONAL:
Important tip:
Following section is applicable ONLY when gdmsetup gui is not available/disabled for any reason.
In this case, first take the backup of /etc/X11/gdm/gdm.conf file so that it can be restored if needed. Then edit this file for XDMCP section to look like below:

Originally, it will look like below:

[xdmcp]
Enable=false


For VNC, it should look like below (need to modify manually if gdmsetup gui is not available):
[xdmcp]
Enable=true
HonorIndirect=true
MaxPending=4
MaxPendingIndirect=4
MaxSessions=16
MaxWait=15
MaxWaitIndirect=15
DisplaysPerHost=2
PingInterval=1
Port=177
Willing=/etc/X11/gdm/Xwilling



After this change is done, restart the xinetd service as mentioned above. VNC should work now.

Wednesday, July 9, 2008

VNC Server on Solaris

Following are the steps to install and use VNC on a Solaris server:

1) Download and install following packages from SunFreeware.com:


x11vnc-0.7-sol9-sparc-local (Main package)
jpeg-6b-sol9-sparc-local (dependency package)
zlib-1.2.3-sol9-sparc-local (dependency package)


2) Once above packages are installed, then run the command below to start VNC server on server:

# x11vnc -display :0

3) On any local machine (laptop/workstation where you want to see the server screen), open the VNC viewer and give the "servername:5900" to see the server's screen.

In step 3, "servername" has to be replaced with the Solaris server's actual name or IP address. Remember that VNC server, by default, works on port 5900. This can be changed later depending upon requirements.