VNCserver ใน CentOS 5


สามารถเข้าถึง remote server แบบ graphic ได้ผ่าน port 5900+

Centos 5 ติดตั้ง package ต่างๆ ดังนี้

# yum install vnc-server
# yum install vnc
# yum groupinstall "GNOME Desktop Environment"

หากต้องการแก้ไขให้ vncserver ทำงานที่ port อื่นๆ ให้ทำดังนี้

vi /usr/bin/vncserver
แก้ไข บรรทัด
$vncPort = 5900 + $displayNumber;

log in เป็น root

# su -
# useradd user1
# passwd user1

เปลี่ยนเป็น user1


# su user1
# vncpasswd
# vi /etc/sysconfig/vncservers

สร้าง configuration ให้ vncserver

VNCSERVERS="1:user1"
VNCSERVERARGS[1]="-geometry 640x480"

สร้าง xstartup scripts โดย ทำงาน as root


# /sbin/service vncserver start
# /sbin/service vncserver stop
# su usera
# cd .vnc
# vi xstartup

แก้ไขบรรทัดที่ 5-6 โดย uncomment เอาเครื่องหมาย # ออก

#!/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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

กลับมาเป็น root


# su
# /sbin/service vncserver start

ทดสอบโดยใช้ web browser ที่สนับสนุน Java

http://192.168.0.10:5901

สั่งให้ vncserver เริ่มพร้อมกับการ boot

#chkconfig vncserver on
 
อ้างอิง http://wiki.centos.org/HowTos/VNC-Server
คำสำคัญ (Tags): #vncserver
หมายเลขบันทึก: 484551เขียนเมื่อ 7 เมษายน 2012 22:26 น. ()แก้ไขเมื่อ 21 มิถุนายน 2012 21:52 น. ()สัญญาอนุญาต: ครีเอทีฟคอมมอนส์แบบ แสดงที่มา-ไม่ใช้เพื่อการค้า-อนุญาตแบบเดียวกันจำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท