CentOS6.3 x86_64環境でxfc4ディスクトップのvncserverをインスール

1. rpm -ivh epel-release-6-7.noarch.rpm
# ls
CentOS-Base.repo CentOS-Base.repo.bak CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel.repo epel-testing.repo

2.# yum groupinfo xfce
Loaded plugins: fastestmirror, presto
Setting up Group Process
Loading mirror speeds from cached hostfile

3.# yum -y groupinstall xfce

4.vncserverのインストール
# yum -y install tigervnc-server

5.アカウント配置ファイル
# vncserver

You will require a password to access your desktops.
Password:
Verify:
xauth: (stdin):1: bad display name “bogon:1" in “add" command
New 'bogon:1 (root)’ desktop is bogon:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bogon:1.log
# su – tao
$ vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: (stdin):1: bad display name “bogon:2" in “add" command
New 'bogon:2 (tao)’ desktop is bogon:2
Creating default startup script /home/tao/.vnc/xstartup
Starting applications specified in /home/tao/.vnc/xstartup
Log file is /home/tao/.vnc/bogon:2.log
$ ls .vnc/
bogon:2.log bogon:2.pid passwd xstartup

6.xstartupを修正
[root@localhost ~]# cat ~/.vnc/xstartup
#!/bin/sh
/usr/bin/startxfce4 &

7.vncserver構成ファイルを変更してクライアントのアカウント情報を接続
# tail -n 3 /etc/sysconfig/vncservers
VNCSERVERS="1:root 2:tao "
VNCSERVERARGS[1]="-geometry 1024×768″
VNCSERVERARGS[2]="-geometry 1024×768″

8.vncserverが起動
# /etc/init.d/vncserver restart
自動起動の設定
# chkconfig vncserver on

9.selinuxを閉じる、ファイウォールを設定
# grep SELINUX /etc/sysconfig/selinux
# SELINUX= can take one of these three values:
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
SELINUXTYPE=targeted
# getenforce
Disabled
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all — anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp — anywhere anywhere
ACCEPT all — anywhere anywhere
ACCEPT tcp — anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp — anywhere anywhere state NEW tcp dpts:5901:5902
REJECT all — anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all — anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

10.クライアントの接続
VNC Host:XXXX
username :vnc_user
Password : startnews24_pwd

Linux

Posted by arkgame