温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Redhat 6.x 系列如何安装vncserver实现图形化访问

发布时间:2021-11-23 09:12:25 来源:亿速云 阅读:235 作者:小新 栏目:网络安全

这篇文章给大家分享的是有关Redhat 6.x 系列如何安装vncserver实现图形化访问的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

一、配置 163 的 yum 源

1.导入 CentOS CentOSCentOS -6的 GPG 证书:

#rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

2. 让 yum 使用网易的源:

#cd /etc/yum.repos.d

# wget http://mirrors.163.com/.help/CentOS-Base-163.repo

3. 修改 repo reporepo文件:

在所有mirrorlist前面加上#,把所有$releasever替换成6,保存

# sed -i 's/^mirrorlist/\#mirrorlist/g' CentOS-Base-163.repo

#sed -i '/\[addons\]/,/^$/d' CentOS-Base-163.repo

#sed -i 's/\$releasever/6/' CentOS-Base-163.repo

#sed -i 's/RPM-GPG-KEY-CentOS-5/RPM-GPG-KEY-CentOS-6/' CentOS-Base-163.repo

4. 清理并重新生成 清理并重新生成 yum 缓存

# yum clean all

# yum makecache

注意:如果系统已经配置了yum源就不用执行上述步骤了哦

二、 安装 gnome-desktop

安装 gnome图行画界面

#yum groupinstall -y "X Window System"

#yum groupinstall -y "Desktop"

#yum groupinstall -y "Chinese Support"

#yum -y install libXfont      
#yum -y install xorg-x11-xfs      
#yum -y install xorg-x11-xfs-utils      
#yum -y install xorg-x11-xinit      
#yum -y install xorg-x11-xdm      
   

yum install xorg-x11-fonts*  

三、 安装 vncserver 并配置

1.检查系统是否已经安装 VNC

# rpm -qa|grep vnc

tigervnc-server-1.1.0-16.el6.centos.x86_64
tigervnc-1.1.0-16.el6.centos.x86_64    有如上返回表示已经安装

2. 安装 vncserver
#yum install tigervnc-server tigervnc

3. 配置 vncserver

1) 检查开机自动启设置

# chkconfig --list|grep vnc
vncserver       0:off   1:off   2:off   3:off   4:off   5:off   6:off

2) 配置为开机自启动

# chkconfig --level 345 vncserver on

执行完成使用上面的命令查看下启动设置 ,如下图 :

# chkconfig --list|grep vnc
vncserver       0:off   1:off   2:off   3:on    4:on    5:on    6:off

发现 3,4,5项已经修改为 on

3) 配置 vnc 密码

#vncserver #vncserver #vncserver#vncserver #vncserver#vncserver
You will require a password to access your desktop.
Password:
Verify:

4) 配置为使用 gnome 桌面

修改 /root/.vnc/xstartu 文件,把最后的 twm & 删掉 加上 gnome-session &

# sed -i '/twm \&/d' /root/.vnc/xstartup
# sed -i '$a\gnome-session &' /root/.vnc/xstartup

5) 配置 vncserver  启动后监听端口和环境参数

修改/etc/sysconfig/vncservers 文件添加以下内容

# sed -i '$a\VNCSERVERS="1:root"' /etc/sysconfig/vncservers

# sed -i '$a\VNCSERVERARGS[1]="-geometry 1200x800"' /etc/sysconfig/vncservers

6) 重启 vncserver 服务

# service vncserver restart

4.测试

Redhat 6.x 系列如何安装vncserver实现图形化访问

Redhat 6.x 系列如何安装vncserver实现图形化访问

感谢各位的阅读!关于“Redhat 6.x 系列如何安装vncserver实现图形化访问”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI