1、首先安装与下载图形界面GNOME
yum groupinstall "Desktop"
yum groupinstall "X Window System"
yum groupinstall "Chinese Support" (可选项)
假如提示有以下错误产生:
Loaded plugins: fastestmirror, presto
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
原因:
dns服务器没有配置正确
解决办法:
打开文件/etc/resolv.conf在其中添加DNS配置(XXX.XXX.XXX.XXX表示你的DNS地址):
search localdomain
nameserver XXX.XXX.XXX.XXX
nameserver XXX.XXX.XXX.XXX
2、修改/etc/gdm/custom.conf
[daemon]
[security]
AllowRemoteRoot=true
[xdmcp]
Port=177 //gdm允许177端口访问
Enable=true
[gui]
[greeter]
[chooser]
[debug]
3、修改/etc/inittab
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:5:initdefault: // 3 to 5
4、修改防火墙设置
打开/etc/sysconfig/iptables,增加如下一行:
-A INPUT -m state --state NEW -m udp -p udp --dport 177 -j ACCEPT
保存完后,重启防火墙服务 service iptables restart
5、重启gdm服务
[[email protected] ~]# gdm-restart
如果上面的语句不行表示无/usr/sbin/gdm-restart文件,没关系,我们重启linux服务器一样可以。
6、使用Xmanager的Xstart来启动界面
(1)、配置属性。
输入框的命令为:/usr/bin/gnome-session --display $DISPLAY
(2)点击高级选项
7、大功告成,可以连接linux服务器桌面了。