Linux ETC

VNC-server 설치 및 설정

2012.10.12 20:28

호스트웨이 조회 수:4155

원격에서 x-windows 모드로 접속할 수 있게 해주는 vnc-server의 설치 및 설정에 대해 알아 보겠습니다.

 

1. vnc-server 설치

# yum install vnc-server

 

 

2. /etc/sysconfig/vncserver 파일 수정

파일 내용에 아래의 두 줄을 추가 합니다.

VNCSERVERS="1:root"

VNCSERVERARGS[2]="-geometry 800x600"

 

 

3. 원격에서 vnc-server로 접속할 때의 패스워드 설정

# vncpasswd

 

 

4. vnc-server 구동 및 확인

# /etc/init.d/vncserver start

# netstat -natp | grep vnc
tcp        0      0 0.0.0.0:5801                0.0.0.0:*                   LISTEN      3230/Xvnc
tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      3230/Xvnc
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      3230/Xvnc

 

 

5. xstartup 파일 수정

# vi /root/.vnc/xstartup

 

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER  <--- 주석 제거
# exec /etc/X11/xinit/xinitrc <--- 주석 제거

 

 

6. 원격에서 접속 확인

vncviewer나 Xming 등의 접속 프로그램을 이용해 'IP:5901' 혹은 'IP:1'을 입력하여 접속 합니다.