오래전 이야기/Open Tools

vncserver

리눅스 엔지니어였던 2008. 9. 15. 17:58

1. VNC 서버 설치 유무 확인

-> rpm -qa | grep vnc


2. VNC 사용자 생성 (root 계정)

-> /etc/sysconfig/vncservers 파일에 VNCSERVERS="1:root" 추가


3. 사용자 홈디렉토리에 .vnc 디렉토리 생성


4. vncpasswd 명령으로 vnc 접속 패스워드 설정, .vnc/passwd 파일 생성 확인


5. vnc 서버 가동

-> service vncserver start

-> service uncserver status  // 서버 가동 유무 확인


6. vnc 클라이언트 접속 (구린 화면)

-> ip:1


7. 예쁜 화면 만들기

-> ./vnc/xstartup 의 4, 5행 주석 제거

 

#!/bin/sh

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


8. vnc 서버 재시작

-> service vncserver restart


9. vnc 클라이언트 재접속 (좋은 화면)


10. ntsysv로 부팅시 마다 vnc서버 자동 가동 설정



## config file


[root@widzet .vnc]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# 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/vnc/sshvnc.html>.

 VNCSERVERS="1:root 10:kkang"
 #VNCSERVERS="2:kkang"
 VNCSERVERARGS[1]="-geometry 1024x768"
 VNCSERVERARGS[2]="-geometry 1024x768"