[Linux] VNC 서버 설치 및 설정하기

VNC를 잘 쓰지 않지만 의외로 필요로 하는 사람들이 있는것 같아 기록함.

1. 환경설정
X Windows가 설치되어 있는 시스템이라면 그냥 통과.

# yum grouplist  // Group List에 X windows 와 GNOME or KDE 그룹 이름을 알아둔다.
# yum groupinstall "X window System"
# yum groupinstall "GNOME Desktop Environment"

2. VNC 설치

# yum search vnc-server // vnc server가 yum으로 존재하는 지 확인
# rpm -qa | grep vnc  //vnc 가 설치되어 있는지 확인 
# yum install vnc-server  // vnc 설치하기

3.VNC 설정하기

  • /etc/sysconfig/vncserver 파일 편집
  • 암호 설정
  • startup 파일 수정
  • #vim /etc/sysconfig/vncserver
     VNCSERVERS="1:root"
     VNCSERVERARGS[2]="-geometry 800x600"
    
    # cd $HOME/.vnc
    #vncpasswd
    password : //암호 입력 (6자리이상)
    verify : // 암호 확인
    # /etc/init.d/vncserver start

    4. xstartup 파일 수정하기
    이상없이 start 될 경우에는 .vnc 디렉토리 밑에 xstartup 파일이 생긴다. 이 파일을 편집하자

    #vim xstartup
    #!/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 &
    

    주석처리 되어 있는 unset… 과 exec.. 의 주석을 해제하면 모든 것이 완료!!

    관련 포스트

    About Gyuuuuu~*

    Twitter: @gyu7e "사람은 누구나 자신의 인생을 살 권리가 있다"
    This entry was posted in 리눅스 이야기 and tagged , , , , , , , . Bookmark the permalink.

    Comments are closed.