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

Was this helpfull ?

0 comments:

Related Posts Plugin for WordPress, Blogger...

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