centos6.8 xfce+vncのインストール

5166 ワード

linux環境

[root@server1 ~]# uname -a
Linux server1.52chenqi.cn 4.10.5-1.el6.elrepo.x86_64 #1 SMP Wed Mar 22 14:55:33 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@server1 ~]# cat /etc/issue
CentOS release 6.9 (Final)
Kernel \r on an \m

xfceのインストール


1.yum upgrade
[root@server1 ~]# yum upgrade
Loaded plugins: fastestmirror
Setting up Upgrade Process
Loading mirror speeds from cached hostfile
 * base: mirrors.syringanetworks.net
 * elrepo-kernel: repos.lax-noc.com
 * extras: mirror.hostduplex.com
 * updates: repos-lax.psychz.net

2.yum install -y wget
[root@server1 ~]# yum install -y wget
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.tocici.com
 * elrepo-kernel: repos.lax-noc.com
 * extras: mirror.hostduplex.com
 * updates: repos-lax.psychz.net
Package wget-1.12-10.el6.x86_64 already installed and latest version
Nothing to do

私はもう入れました.wget http://www.rpmfind.net/linux/centos/6.9/extras/x86_64/Packages/epel-release-6-8.noarch.rpm
[root@server1 ~]# wget http://www.rpmfind.net/linux/centos/6.9/extras/x86_64/Packages/epel-release-6-8.noarch.rpm
--2018-05-31 09:40:29--  http://www.rpmfind.net/linux/centos/6.9/extras/x86_64/Packages/epel-release-6-8.noarch.rpm
Resolving www.rpmfind.net... 195.220.108.108
Connecting to www.rpmfind.net|195.220.108.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-6-8.noarch.rpm”

100%[======================================>] 14,540      88.7K/s   in 0.2s

2018-05-31 09:40:30 (88.7 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]

4.rpm -ivh epel-release-6-8.noarch.rpm
[root@server1 ~]# rpm -ivh epel-release-6-8.noarch.rpm
Preparing...                ########################################### [100%]
        package epel-release-6-8.noarch is already installed

5.既にepel-releaseがインストールされている場合は、まずアンインストールしてから# rpm -e epel-release # rpm -ivh epel-release-6-8.noarch.rpmを再インストールしてください.
[root@server1 ~]# rpm -e epel-release
warning: /etc/yum.repos.d/epel.repo saved as /etc/yum.repos.d/epel.repo.rpmsave
[root@server1 ~]# rpm -ivh epel-release-6-8.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

6.xfce yum groupinstall xfceをインストールする
[root@server1 ~]# yum groupinstall xfce
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * base: repos.forethought.net
 * elrepo-kernel: repos.lax-noc.com
 * epel: mirrors.develooper.com
 * extras: mirror.hostduplex.com
 * updates: repos-lax.psychz.net
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package NetworkManager-gnome.x86_64 1:0.8.1-113.el6 will be installed
--> Processing Dependency: NetworkManager-glib = 1:0.8.1-113.el6 for package: 1:NetworkManager-gnome-0.8.1-113.el6.x86_64
--> Processing Dependency: NetworkManager = 1:0.8.1-113.el6 for package: 1:NetworkManager-gnome-0.8.1-113.el6.x86_64
--> Processing Dependency: libnotify >= 0.4.3 for package: 1:NetworkManager-gnome-0.8.1-113.el6.x86_64
.......

7.vnc yum install vnc vnc-serverのインストール
[root@server1 ~]# yum install tigervnc-server
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.syringanetworks.net
 * elrepo-kernel: repos.lax-noc.com
 * epel: mirrors.develooper.com
 * extras: mirror.hostduplex.com
.........

8.VNCシステム及び解像度の構成
vi /etc/sysconfig/vncservers

次にコンテンツに追加
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"

上記の解像度は、800 x 600など、私たち自身のニーズに合わせて変更できます.9.VNCパスワードvncserverの設定
[root@server1 ~]#  vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  file /root/.Xauthority does not exist

New 'server1.52chenqi.cn:1 (root)' desktop is server1.52chenqi.cn:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/server1.52chenqi.cn:1.log

10.xstartupプロファイルの変更
vi /root/.vnc/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 &
startxfce4 &

11.権限の設定とVNC/起動の設定
service vncserver restart
chkconfig vncserver on