Hướng dẫn cài đặt VNC Server trên CentOS

Bước 1 : Cài X Windows System (KDE và GNOME Desktop Environement !)

Kiểm tra xem svr đã cài gói này chưa bằng cách dùng lệnh :

Code - [#]
yum grouplist
Nếu chưa thấy trong mục Installed thì tiến hành cài !

Để cài GNOME Desktop Environnement chạy lệnh :

Code - [#]
yum groupinstall "X Window System" "GNOME Desktop Environment"

Nếu thấy như đoạn dưới đây là thành công :

Code - [#]
Installed: NetworkManager-gnome.x86_64 0:0.3.1-5.el4 file-roller.x86_64 0:2.8.1-1 gconf-editor.x86_64 0:2.8.0-2 gedit.x86_64 1:2.8.1-4 ggv.x86_64 0:2.8.0-1 gimp-print-utils.x86_64 0:4.2.7-2 gnopernicus.x86_64 0:0.9.12-1 gok.x86_64 0:0.11.8-1 gpdf.x86_64 0:2.8.2-7.7.2.el4_7.4 gtk-engines.x86_64 1:0.12-6.el4 gtk-engines.i386 1:0.12-6.el4 gtk2-engines.i386 0:2.2.0-7.el4 hwbrowser.noarch 0:0.19-0.EL4.4 nautilus-media.x86_64 0:0.8.1-3 vino.x86_64 0:2.8.1-1.5 yelp.x86_64 0:2.6.4-2
Dependency Installed: gimp-print.x86_64 0:4.2.7-2 gtk+.i386 1:1.2.10-36 gtksourceview.x86_64 0:1.1.0-4 imlib.i386 1:1.9.13-23 libungif.i386 0:4.1.3-1.el4.2 pyparted.x86_64 0:1.6.8-2
Sau khi cài đặt xong GNOME Desktop Environnement chúng ta chuyển qua KDE chạy lệnh :

Code - [#]
yum groupinstall "X Window System" "GNOME Desktop Environment"
Cài đặt tương tự như GNOME cũng hỏi y/n chọn y rồi ngồi đợi
Cái này chắc ko phải nói nhiều ^_^ !

Bước 2 :
Cài đặt VNC Server :

Dùng lệnh :

Code - [#]
yum install vnc-server
Đợi nó cài :

Nếu được như đoạn dưới đây bạn đã cài xong vnc server :

Code - [#]
[root@vps1161 ~]# yum install vnc-server
Loading "priorities" plugin
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
contrib 100% |=========================| 951 B 00:00
centosplus 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages in global exclude list
0 packages excluded due to repository priority protections
Parsing package install arguments
Nothing to do
Bước 3 : Hiệu chỉnh config của VNC Server

Bây h chúng ta edit file config của vnc server chạy lệnh :

Code - [#]
vi /etc/sysconfig/vncservers
Các bạn nào chưa biết sử dụng lệnh vi trong SSH thì mình xin hướng dẫn qua luôn 1 số lệnh cơ bản
Sau khi chạy lệnh

Code - [#]
vi /etc/sysconfig/vncservers
Các bạn sửa nội dung file config vncserver như sau:
Bỏ 2 dấu # ở 2 câu cuối cùng :

Code - [#]
# 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
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

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

# Use "-nohttpd" to prevent web-based VNC clients connecting.

# 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.

VNCSERVERARGS[1]="-geometry 800x600"
ESC để thoát Insert Mode rồi dùng lệnh :wq để save file đó lại và trở về command của SSH !

Bước 4 : Khởi động VNC Server :

Code - [#]
Nếu nó đòi pass thì bạn nhập pass vào pass này sẽ để bạn dùng VNC CLient connect tới svr !

Bước 4 : Sửa file xstartup

Code - [#]
vi /root/.vnc/xstartup
Bỏ 2 dấu thăngs ở 2 đoạn như code dưới :

Code - [#]
exec /etc/X11/xinit/xinitrc
Code - [#]

# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Bước 5 : Khởi động lại vnc server :

Code - [#]
/etc/init.d/vncserver restart
Bước 6 : Khởi động khi bật máy

Code - [#]
chkconfig vncserver on
Bước 7 : Tắt firewall

Code - [#]
/etc/init.d/iptables stop
Bước 8 : Tắt firewall khi bật máy

Code - [#]
chkconfig iptables off
Bước 9 : Download VNC CLient về và chén thôi 

Code - [#]
Bật VNC Client nhập IP SVR theo dạng
IP:1 hoac IP:2 do bạnconfig trong files /etc/sysconfig/vncservers



Skysper With a huge array of technical cycling clothing now available on the market at a whole range of prices, there’s really no excuse to be throwing on your long-sleeved winter cycling jersey when its 30 degrees and boiling-in-the-bag. Lightweight materials with wicking properties will help you cool off and prevent the uncomfortable build-up of arm sleeves.

happy wheels

happy wheels

Your installation guide helped me a lot.

happy wheels

aftab ali


Good fortunes and we trust you win your diversions. Furthermore, rememberArticle Search, be a mindful card shark! Roulette

muneer ahmed


Paddy Power Poker is a division of the Paddy Power web based gaming kingdom. Mr green

muneer ahmed


They have an extraordinary idea - Supercharged wins! Each time you play a diversion and you win, Slotty Vegas Casino will fill each champ with additional money reward, regardless of how huge or little your triumphant turn was. goldenpark

aftab ali


Internet diversions take you to a dreamland where there is just fun and amusement. The free web based amusements can be delighted in by anybody whenever.  ahti casino

muneer ahmed


A mess of dissatisfaction and the misfortunes can be dodged by honing with these free online club recreations. ojo


thank you

Your article is very meaningful, the content is also quite good and impressive, I hope the next time you will have more good and meaningful articles to give readers the knowledge

color switch



wh0cd2577801 Viagra Cheap Online

muneer ahmed


We may have something bothering us, or a distraction, or perhaps a bad night’s sleep. These factors can lead to inconsistent results. finmax

Database error


DB Error: Database query failed!
» Error No: 1062
» Error detail: Duplicate entry '11700399' for key 'PRIMARY'
» Query: INSERT INTO bd_estore_online_users (id,store_id,sid,uid,username,usertype,ip,last_updated,last_page) VALUES (NULL,'9412','bs5s2pq5hvj546hmkeicknael1','0','Guest','0','','2018-09-21 03:23:21','/a178444/huong-dan-cai-dat-vnc-server-tren-centos.html')