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

Install VNC Viewer/Client on Fedora and CentOS Linux

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to install TigerVNC client or viewer on linux?

This post covers installing a VNC client or VNC viewer on your linux machine. You can install the VNC viewer packages from the yum repository on RPM based linux distributions. With this VNC client you can access to  Linux and Windows running VNC servers remotely. This is a cross platform application.
Applicable to: RHEL, Redhat, CentOS, Redhat, etc.

Install VNC viewer from YUM
(If your linux is not connected to internet directly, enable yum commands through a proxy server
[root@server ~]# yum -y install tigervnc

After installing Go to Applications=>Internet=>TigerVNC Viewer

Starting a New VNC Session on Linux

FREQUENTLY ASKED QUESTIONS (VNC Server)
Q: How to start a new VNC session on Linux?

This article will talk about creating and managing VNC sessions in a Linux server. Hope you read my previous articles about installing and configuring VNC server and some troubleshooting tips for VNC.
Continue reading...

Create a new User account for VNC access (can also use existing ones)
[root@server ~]# useradd admin

Login as the New User and setup VNC password (for VNC access only)
[root@server ~]# su admin
[admin@server ~]# vncpasswd
Password:
Verify:

Start the VNC Session for the new user with any Display number (here i used :1)
[admin@server ~]# vncserver :1
xauth:  creating new authority file /home/admin/.Xauthority

New 'localhost.localdomain:1 (admin)' desktop is localhost.localdomain:1

Creating default startup script /home/admin/.vnc/xstartup
Starting applications specified in /home/admin/.vnc/xstartup
Log file is /home/admin/.vnc/localhost.localdomain:1.log

Now allow firewall (iptables) to allow port 5901/TCP to accept incoming VNC connections.
(Login as root first)
[root@server ~]# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[root@server ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

Now access the VNC server








Killing a VNC session
To kill or stop a VNC session you need to login as the associated user first.
[admin@server ~]# vncserver -kill :1
Killing Xvnc process ID 2675

Kill VNCServer Window Sessions Command

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to Kill VNC Window Sessions in Linux?

Stop entire VNC service
[root@server ~]# service vncserver stop


Kill individual VNC Sessions
To stop individual VNC session, you need to first login as the user account that associated with the VNC session. For example if you assigned VNC session 1 (:1) for the user "James", login as "James" and run the below command

[james@server ~]# vncserver -kill :1


To start VNC session again
[james@server ~]# vncserver :1


Command to Start new VNC Session
[james@server ~]# vncserver :2


Find Running VNC server sessions (login as associated user first)
[james@server ~]# vncserver -list


Note: Also open firewall to allow all incoming connections (new sessions) to VNC Server.

Install TigerVNC Server On Fedora 17

FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to install and configure TigerVNC Server in Fedora 17?

Install VNC server packages from YUM in Fedora 17
[root@server ~]# yum -y install tigervnc-server



Create 2 new user for VNC access (also can use existing users) and set user passwords
[root@server ~]# useradd james
[root@server ~]# passwd james
[root@server ~]# useradd john
[root@server ~]# passwd john


VNC Remote Control


Setup a password for user's VNC access
Login as the new user (James). The VNC password must be at least 6 charactors 
[root@server ~]# su james
[james@server ~]# vncpasswd
Password:  <type a password>
Verify:    <retype same password>

Now logout from james and login as "john"
[james@server ~]# su john
[john@server ~]# vncpasswd
Password:  <type a password>
Verify:    <retype same password>

Now logout and login as root user
[john@server ~]# su

Configure vnc service in Fedora17
[root@server ~]# vi /etc/sysconfig/vncservers
Now add the below 3 lines to the bottom of the configuration file.
VNCSERVERS="1:james 2:john"
 VNCSERVERARGS[1]="-geometry 950x700"
 VNCSERVERARGS[2]="-geometry 950x700"
#Now save the file

Open firewall for VNC Server ports (TCP/5901 and TCP/5902) in Fedora 17
[root@server ~]# iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5901 -j ACCEPT
[root@server ~]# iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5902 -j ACCEPT

Start VNC Server service (Start both VNC1 and VNC2)
[root@server ~]# service vncserver start

OR
Start each VNC individually (Login as appropriate user first)
[james@server ~]# vncserver :1
[john@server ~]# vncserver :2


Download VNC viewer for windows
Or install VNC viewer for Linux from YUM (Fedora and CentOS)
[root@server ~]# yum -y install tigervnc


Access VNC by the below method <ipaddress>:<VNC number>





Troubleshoot Linux TigerVNC server Errors


If you having a Linux box with a VNC server and having any problem with VNC server to start,  try this..
This is mainly a solution for if VNC server did not shutdown properly(power failure) and after starting the VNC server VNC service will not start properly by boot. And also will fail of stoping and start again.


Step1: Review the system log in /var/log/messages.

Step2: Review vnc log file of users in  /home/<username>/.vnc/<hostname>:<display Number>.log
eg:   /home/user/.vnc/hostname:5.log

Step3: If cannot find the reason from log files, then try to remove the "X" files located in   /tmp/.X11-unix
Stop VNC server first. then goto /tmp/.X11-unix/ directory and delete the files named "X<display number>" 
(If your VNC server runs with display number 2 and 3 then delete files X2 and X3 )            
[Important: Do not Delete file named 'X0']
[root@server ~#]rm /tmp/.X11-unix/X2
[root@server ~#]rm /tmp/.X11-unix/X3


Step4: Now try to restart the vnc server 
[root@server ~#]service vncserver start


Stop VNC Displays Individually
Also can try by stoping individual VNC windows by below command ( first logout from root, and login as the appropriate user, here vnc display 1 is for user "james")
[james@server ~#]vncserver -kill :1            (this command will kill the window number 1)
[james@server ~#]vncserver :1                     (to start again)


Related posts: Click here for VNC configuration in Linux

Configure VNC server in Linux

VNC provide secure remote desktop control(GUI) sharing to other machines over network. VNC server is capable of  sharing multiple desktop to more than one users at a time. Many users can work on a single PC with GUI at a time.This Post will help you to configure VNC in all RPM based Linux distributions(Redhat, CentOS, Fedora, etc)
Steps to install and configure VNC server/client in linux OSThis example helps you to configure a vnc server with two VNC windows. So two different  users (user1 and user2)can access the vnc server at a time.


Step1: Install the packages server and client(4nos)
[root@server ~#]yum install tigervnc*

Step2: Edit the vnc configuration file with your requirements
[root@server ~#]vi /etc/sysconfig/vncservers
#add 3 new lines or edit existing lines like below( user1 & user2 are two new VNC users, 1 & 2 are Display numbers, 950×700 is display resolution, depth 24 is color depth)
VNCSERVERS=”1:user1 2:user2″
VNCSERVERARGS[1]=”-geometry 950×700 -nolisten tcp -depth 24″
VNCSERVERARGS[2]=”-geometry 950×700 -nolisten tcp -depth 24″
#save the file


Step3: Create users and set password(users are user1 & user2)
[root@server ~#]useradd user1
[root@server ~#]useradd user2


Step4: Note: logout from root and login as two new users and set vnc access password
[root@server ~#]su user1
[user1@server ~#]vncpasswd
#(input vnc password and verify, this password is required for vnc connection)
[root@server ~#]su user2
[user2@server ~#]vncpasswd
#(input vnc password and verify, this password is required for vnc connection)


Step5: Login as root and start vnc service
[root@server ~#]service vncserver start


Step6:Acess vnc server from client computers(windows and linux)
Important: By default VNC server will listen ports based on Display number. Here i used two displays(1 and 2) . so VNC server will listen in 5901/tcp and 5902/tcp . So u must  open these port in firewall(iptables) or Disable firewall(iptables).
VNC client In linux
[root@server ~#]yum listall tigervnc


and go to Applications>Internet>TigerVNC Viewer
and input address in the below format
<ipaddress>:<display number>


For example: if ip address of vnc server is 192.168.10.1
192.168.10.1:1   and       192.168.10.1:2
And input vnc password(we set in step3)
VNC Client In Windows
VNC viewer for Windows VNC Download
and input server address and display number same as above (Linux)
VNC Server managemant


Start/stop/restart/reload service
[root@server ~#]service vncserver start
[root@server ~#]service vncserver stop
[root@server ~#]service vncserver restart
[root@server ~#]service vncserver reload


kill a vnc Window (eg: display 1)  , Note: first login as user1
[user1@server ~#]vncserver -kill :1


to start again
[user1@server ~#]vncserver :1

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons