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
我已经装过了
3.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"
上面的分辨率可以根据我们自己的需要修改,比如可以改成800x600等。
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
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com