상세 컨텐츠

본문 제목

CentOS GUI 설치

시스템설정

by webtattoo 2015. 5. 5. 18:21

본문


CentOS 6.x 기준 GUI 설치


http://selene0301.tistory.com/267

http://takuma99.tistory.com/233

http://takuma99.tistory.com/234

http://hwangji.kr/sub/dev_leader/link/os/default.aspx?NHBBSID=NHBoardWebTip&NHBBSIDX=69




################################################################################

# GNOME 설치

yum update

yum -y groupinstall "Desktop"

yum -y groupinstall "X Window System"

yum -y groupinstall "Fonts"

# yum -y groupinstall "General Purpose Desktop"

yum install fonts-korean

yum groupinstall korean-support


# yum -y groupinstall "Desktop Platform"

# yum -y groupinstall "Graphical Administration Tools"

# yum -y groupinstall "Internet Browser"

# yum -y groupinstall "General Purpose Desktop"

# yum -y groupinstall "Office Suite and Productivity"

# yum -y groupinstall "Graphics Creation Tools"



################################################################################

# 자동으로 X11모드로 실행되도록 세팅하면 완료.

vi /etc/inittab       

id:3:initdefault: 

->

id:5:initdefault:



################################################################################

#로그인 할 계정 설정 

adduser uniwiz






################################################################################

# VNC 서버 설치

yum install tigervnc-server


vim /etc/sysconfig/vncservers


VNCSERVERS="1:uniwiz"

VNCSERVERARGS[1]="-geometry 1024x768"


################################################################################

# VNC 비밀번호 설정

-> uniwiz로 로그인한 후에

vncpasswd


################################################################################

# VNC 서버 시작

root 계정으로 실행

/etc/init.d/vncserver start

/etc/init.d/vncserver stop


iptables -I INPUT 1 -p tcp --dport 5901 -j ACCEPT

service iptables save

service iptables restart




################################################################################

################################################################################

# CentOS 7 GNOME & VNC 설치


https://www.howtoforge.com/vnc-server-installation-on-centos-7

https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1835







yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target


# ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target



yum install tigervnc-server


cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service

vi /etc/systemd/system/vncserver@:2.service

(유저부분을 2군데 바꿔준다.)


firewall-cmd --permanent --zone=public --add-service vnc-server

firewall-cmd --reload


vncserver


systemctl daemon-reload


4) VNC 서버 시작 

systemctl start vncserver@:2.service


디스플레이번호 2번의 VNC서버를 시작한다. 

서버 부팅 시 자동으로 서비스가 실행될 수 있게 다음과 같이 설정한다.

~]# systemctl enable vncserver@:2.service



VNC 서버 재시작

systemctl daemon-reload


6) VNC 서버 비활성화

~]# systemctl stop vncserver@:2.service 


디스플레이번호 2번의 VNC서버 서비스를 종료한다.

서버 부팅 시 자동으로 서비스가 실행되는 부분을 다음과 같이 제거한다.

~]# systemctl disable vncserver@:2.service









################################################################################ 

VNC서버 프로그램을 설치하였다면 VNC 서버 설정을 해야 한다.

CentOS 6 이하 버전은 /etc/sysconfig/vncservers 파일을 편집기로 열어 설정하였지만 

CentOS 7 부터는 /lib/systemd/system/vncserver@.server으로 변경되었고 

vncserver@.service 파일을 vncserver@:디스플레이번호.service 형식으로 복사하여 사용한다.

예를 들면 디스플레이 번호 2번을 사용하고자 한다면 다음과 같이 복사한다.

cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service



# 파일 편집 

[Service]

Type=forking

# Clean any existing files in /tmp/.X11-unix environment

ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

#ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"

#PIDFile=/home/<USER>/.vnc/%H%i.pid

ExecStart=/sbin/runuser -l srijan -c "/usr/bin/vncserver %i"

PIDFile=/home/srijan/.vnc/%H%i.pid

ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'








관련글 더보기