Jl. Projosumarto II Kab. Tegal
Jawa Tengah, Kode Pos 52193
0812-1788-7688
[email protected]
[email protected]

Install VNC Server di CentOS 6

VNC adalah sebuah protokol yang digunakan untuk sharing desktop/remote desktop didalam sebuah jaringan.

Agar lebih mudah dalam me-remote desktop, maka perlu meng-install GUI version dari CentOS disini menggunakan Gnome sebagai Desktop Environment nya.

Install Desktop Gnome

[email protected]:# yum groupinstall Desktop
[email protected]:# yum install xorg-x11-fonts-Type1

Install VNC Server dan Konfigurasi

Install Tiger VNC via yum

[email protected]:# yum install tigervnc-server

Konfigurasi VNC Server dengan mengedit file /etc/sysconfig/vncservers

[email protected]:# vi /etc/sysconfig/vncservers

Kemudian tambahkan baris konfigurasi diakhir seperti ini:

VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 800x600 -depth 24"

Keterangan:
Angka 1: adalah nomer dari window nya
root: adalah user yang akan me-remote
geometry 800×600: adalah resolusi yang tampil saat diremote
depth 24: adalah bersifat true color 24 bpp

Setting Password VNC

Perlu diketahui, password VNC tidak harus sama dengan password ssh, maka perlu disetup password vnc untuk setiap user yang akan me-remote

[email protected]:# vncpasswd

Mengaktifkan service VNC Server

Sebelum konfigurasi lebih lanjut, VNC Server harus diaktifkan terlebih dahulu dan di setting agar aktif saat server di boot

[email protected]:# service vncserver start
[email protected]:# chkconfig vncserver on

Setting Gnome Session VNC

Agar setiap masuk ke VNC langsung masuk ke Desktop Environment Gnome, maka perlu diubah sessionya

[email protected]:# vi ~/.vnc/xstartup

Kemudian pada bagian bawah konfigurasi pastikan seperti dibawah ini:

#twm &
exec gnome-session &v

Meremote Server

Untuk meremote server, silahkan download software VNC Client di http://www.realvnc.com

kemudian saat mau konek, masukkan hostname/IP disertai nomer window nya
misal:

192.168.0.1:1
atau
servindo.co.id:1

Mematikan service VNC Server

Untuk mematikan VNC Server bisa langsung menggunakan perintah “service vncserver stop”, tapi jika hanya mematikan VNC Server untuk user tertentu, maka bisa menggunakan perintah

[email protected]:# vncserver -kill :<nomer desktop>
[email protected]:# vncserver -kill :1

Troubleshoot

Sudah konfigurasi VNC Server tapi tidak bisa connect?

Kemungkinan firewall server (iptables) aktif dan port untuk VNC belum dibuka, maka perlu menambahkan rule firewallnya

[email protected]:# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5801 -j ACCEPT
[email protected]:# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
[email protected]:# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 6001 -j ACCEPT
[email protected]:# iptables-save