VNC เป็นเครื่องมือสำหรับการ Remote เข้าไปจัดการกับเครื่องอื่น เป็นโปรแกรมประภท Remote Desktop
ซึ่งทำให้เกิดความสะดวกในการจัดการเครื่องปลายทาง
โดยทั่วไปแล้วบน Linux จะมีชุดโปรแกรมนี้มาให้ด้วยแล้ว และมีชื่อว่า vncserver
การติดตั้งในส่วนของ server และ client
#yum install vnc-server
#yum install vnc
ทำการตรวจสอบว่าเครื่อง server ของคุณได้ทำการติดตั้ง x windows และ GNOME หรือยัง หากว่ายัง ให้ดำเนินการโดยใช้คำสั่ง
yum หรือจะติดตั้งผ่านทาง rpm ก็ได้เช่นกัน
#yum groupinstall “GNOME Desktop Environment”
ในกรณีที่การติดตั้ง GNOME เกิดข้อผิดพลาด
missing xxxxxxxxxxx.so.0.
ให้ทำการดาว์นโหลดไฟล์ package มาติดตั้งเอง โดยค้นหาไฟล์ได้จาก
http://mirror.centos.org/centos/5/os/i386/CentOS/
และทำการติดตั้งด้วยคำสั่ง
#rpm -Uvh –nodeps xxxxxxxxxxxxxxx.rpm
ขั้นตอนต่อมาเป็นการสร้าง user และกำหนด password (หากมี user อยู่แล้วก็ไม่จำเป็นต้องสร้างใหม่)
# useradd suppakit
# passwd suppakit
ทำการ login ด้วย user ที่ต้องการ และทำการกำหนด password สำหรับ vnc ด้วยคำสั่ง
#vncpasswd
จะมีการสร้างไฟล์ path .vnc และไฟล์ passwd ให้เข้าไปดูผ่านทางคำสั่ง
#cd .vnc
#ls
ทำการแก้ไข Server configuration ด้วยคำสั่ง
#vi /etc/sysconfig/vncservers
และเพิ่มรายละเอียดของ user ที่ต้องการใช้งาน vnc เข้าไปดังนี้
VNCSERVERS=”1:suppakit”
VNCSERVERARGS[1]=”-geometry 800×600″
ทำการสร้างไฟล์ xstartup โดยการ startและ stop vncserver ดังนี้
#service vncserver start
#service vncserver stop
หากคุณลอง ls ดูจะมีไ ฟล์ .log, passwd แ ละ xstartup
ทำการแก้ไขไฟล์ xstartup ดังนี้
#!/bin/sh (-)
# Add the following line to ensure you always have an xterm available.
#( while true ; do xterm ; done ) &
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
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 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
exec gnome-session &
ในส่วนสีแดง ผมลองแล้ว ไม่ work เพราะมีการเปิดหน้าต่าง xterm ค้างใน process ไว้มาก
ทดสอบการทำงานด้วยโปรแกรม vnc โดยกำหนดค่าดังนี้
vncviewer 192.168.0.10:1
วิธีการกำหนดใ ห้ vncserver ทำการทุกครั้งหลังการ boot ด้วยคำสั่ง
#chkconfig vncserver on
From http://wiki.centos.org/HowTos/VNC-Server
Linux
ความเห็นล่าสุด