第一章 系统环境
操作系统版本:
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Wed Nov 9 08:02:18 EST 2011 i686 i686 i386 GNU/Linux
第二章 问题描述
图形化界面无法启动:
可能导致问题出现的原因为:
安装过程中没有安装图形化包;
操作系统安装过程为文本安装模式,没有安装图形化包
X window
组件服务无法启动
第三章 解决办法
3.1 安装redhat 6.0的yum源
因为图形化涉及到非常多的关联
rpm
包,通过
rpm
命令一个一个去安装是不实际的,所以通过搭建本地
yum
服务来使用
yum
安装方式。
Redhat6.0
操作系统的
yum
安装方式和
5
类似:
检查本机是否有
yum
软件包:
[root@sinobest ~]# rpm -qa | grep yum
yum-metadata-parser-1.1.2-16.el6.i686
yum-utils-1.1.30-10.el6.noarch
yum-3.2.29-22.el6.noarch
yum-plugin-security-1.1.30-10.el6.noarch
yum-rhn-plugin-0.9.1-36.el6.noarch
mount
光盘到
/mnt
目录:
[root@localhost ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
修改
yum
的
yum
源响应文件:
[root@localhost mnt]# cat /etc/yum.repos.d/local.repo
[bash]
name=linux 6
baseurl=file:///mnt
gpgcheck=0
enable=1
注:这里我是直接
Mount
光盘到
/mnt
下,然后让
yum
去找
/mnt
下的包,这种做法是一次性的,当光盘取走或者
umount
下了
/mnt
后,
yum
就无法服务了。
如果需要长期使用
yum
,或者给其他主机做
Yum
软件包的源,则将光盘文件复制到本地某路径,然后通过
http
或者
ftp
共享那个路径即可
修改
yum
源的地址
# vi /usr/lib/python2.6/site-packages/yum/yumRepo.py
在上面的文件中找到下面这行
remote = url + '/' + relative
将其改为
remote + '/
mnt
' + relative
至此,本地
Yum
源搭建完成。
3.2 安装图形化界面的相关软件包
涉及到图形化的组件包括:
[root@redhat ~]# yum groupinstall “X Window System”
[root@redhat ~]# yum groupinstall “Desktop”
[root@redhat ~]# yum install “Xorg”
[root@localhost mnt]# type X
X is hashed (/usr/bin/X)
安装完成后,图形化桌面即可使用
第四章 X的相关
4.1 X版本:
XFree86
X.org
4.2 确定x版本:
[root@localhost ~]# type X
X is /usr/bin/X
Type
用于查找位于
PATH
变量中的程序
[root@localhost ~]# ll /usr/bin/X
lrwxrwxrwx. 1 root root 4 Jul 10 22:44 /usr/bin/X -> Xorg
[root@localhost ~]# /usr/bin/Xorg -version
X.Org X Server 1.10.4
Release Date: 2011-08-19
X Protocol Version 11, Revision 0
Build Operating System: x86-002 2.6.18-274.3.1.el5
Current Operating System: Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Wed Nov 9 08:02:18 EST 2011 i686
Kernel command line: ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 rhgb quiet rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
Build Date: 20 October 2011 12:03:36PM
Build ID: xorg-x11-server 1.10.4-6.el6
Current version of pixman: 0.18.4
Before reporting problems, check https://www.redhat.com/apps/support/
to make sure that you have the latest version.
[root@localhost ~]#
4.3 确认显示硬件:
[root@localhost ~]# lspci | grep VGA
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
确定显存地址:
[root@localhost ~]# cat /proc/iomem
00000000-0000ffff : reserved
00010000-0009f7ff : System RAM
0009f800-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000c8000-000c8fff : Adapter ROM
000c9000-000c9fff : Adapter ROM
000dc000-000fffff : reserved
000f0000-000fffff : System ROM
00100000-3feeffff : System RAM
00400000-008364e2 : Kernel code
008364e3-00a917c7 : Kernel data
00b15000-00c3af6f : Kernel bss
3fef0000-3fefefff : ACPI Tables
3feff000-3fefffff : ACPI Non-volatile Storage
3ff00000-3fffffff : System RAM
40000000-40007fff : 0000:00:0f.0
40008000-4000bfff : 0000:00:10.0
d0000000-d7ffffff : 0000:00:0f.0
d8000000-d87fffff : 0000:00:0f.0
d8800000-d880001f : 0000:00:10.0
d8a00000-d8bfffff : pnp 00:0c
d9200000-d9cfffff : PCI Bus 0000:02
当
X
在读写包含在
/proc/iomem
中的指定地址范围时,实际上它是在读写显卡的存储
[root@localhost ~]# ps -aux | grep X
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 3988 2.8 1.5 27684 16136 tty7 Ss+ 22:57 0:30 /usr/bin/Xorg :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-UQQAgQ/database -nolisten tcp
root 4613 1.3 1.5 27912 16280 tty8 Ss+ 23:01 0:11 /usr/bin/Xorg :1 -br -verbose -auth /var/run/gdm/auth-for-gdm-WcWKgN/database -nolisten tcp
root 5066 0.4 1.1 21792 11972 tty9 Ss+ 23:02 0:03 /usr/bin/Xorg :2 -br -verbose -auth /var/run/gdm/auth-for-gdm-dUODBF/database -nolisten tcp
root 5745 0.0 0.0 4332 740 pts/0 S+ 23:15 0:00 grep X
[root@localhost ~]# cat /proc/5066/maps | grep 4000 | grep mem
00693000-00694000 rw-p 00004000 fd:00 173217 /usr/lib/libXdmcp.so.6.0.0
008c2000-008c3000 rw-p 00004000 fd:00 151236 /usr/lib/xorg/modules/libfbdevhw.so
4.4 X监听的端口
默认情况下,
X
服务器监听端口
600n
,
n
为一个显示值。
[root@localhost ~]#X
这是以“
weave
”模式运行
X
,
[root@localhost ~]# netstat -an | grep 600
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 :::6000 :::* LISTEN
又或者:
[root@localhost ~]# ps -aux | grep X
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 6393 0.7 0.5 15884 6064 tty8 Ss+ 23:36 0:01 X
root 6417 0.0 0.0 4328 728 pts/2 S+ 23:39 0:00 grep X
[root@localhost ~]# lsof -n -P -p 6393
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
X 6393 root cwd DIR 253,0 4096 151220 /etc/X11/xorg.conf.d
X 6393 root rtd DIR 253,0 4096 2 /
X 6393 root txt REG 253,0 1993664 151224 /usr/bin/Xorg
X 6393 root mem REG 253,0 122232 13341 /lib/libgcc_s-4.4.6-20110824.so.1
X 6393 root mem REG 253,0 140036 151231 /usr/lib/xorg/modules/extensions/libextmod.so
X 6393 root mem REG 253,0 30324 151233 /usr/lib/xorg/modules/extensions/librecord.so
X 6393 root mem REG 253,0 42848 151229 /usr/lib/xorg/modules/extensions/libdri.so
X 6393 root mem REG 253,0 26212 151230 /usr/lib/xorg/modules/extensions/libdri2.so
X 6393 root mem REG 253,0 4928 151393 /usr/lib/xorg/modules/drivers/vmware_drv.so
X 6393 root mem REG 253,0 49936 151394 /usr/lib/xorg/modules/drivers/vmwlegacy_drv.so
X 6393 root mem REG 253,0 30288 151239 /usr/lib/xorg/modules/libshadowfb.so
X 6393 root mem REG 253,0 622836 145187 /usr/lib/libfreetype.so.6.3.22
X 6393 root mem REG 253,0 17968 151236 /usr/lib/xorg/modules/libfbdevhw.so
X 6393 root mem REG 253,0 430960 138784 /usr/lib/libpixman-1.so.0.18.4
X 6393 root mem REG 253,0 11460 2427 /lib/libpam_misc.so.0.82.0
X 6393 root mem REG 253,0 25964 173052 /usr/lib/libfontenc.so.1.0.0
X 6393 root mem REG 253,0 228244 178042 /usr/lib/libXfont.so.1.4.1
X 6393 root mem REG 253,0 36836 138604 /usr/lib/libpciaccess.so.0.10.8
X 6393 root mem REG 253,0 22928 151218 /usr/lib/xorg/modules/drivers/vesa_drv.so
X 6393 root mem REG 253,0 39600 151138 /usr/lib/xorg/modules/input/evdev_drv.so
X 6393 root mem REG 253,0 21060 173217 /usr/lib/libXdmcp.so.6.0.0
X 6393 root mem REG 253,0 161872 9460 /lib/libexpat.so.1.5.2
X 6393 root mem REG 253,0 133180 151235 /usr/lib/xorg/modules/libfb.so
X 6393 root mem REG 253,0 22048 151228 /usr/lib/xorg/modules/extensions/libdbe.so
X 6393 root mem REG 253,0 42820 145289 /usr/lib/libdrm.so.2.4.0
X 6393 root mem REG 253,0 71460 140837 /usr/lib/libhal.so.1.0.0
X 6393 root mem REG 253,0 18684 151446 /usr/lib/xorg/modules/drivers/fbdev_drv.so
X 6393 root mem REG 253,0 40292 13331 /lib/libcrypt-2.12.so
X 6393 root mem REG 253,0 302300 13328 /lib/libfreebl3.so
X 6393 root mem REG 253,0 52540 13337 /lib/libpam.so.0.82.2
X 6393 root mem REG 253,0 142480 9426 /lib/ld-2.12.so
X 6393 root mem REG 253,0 1876456 9427 /lib/libc-2.12.so
X 6393 root mem REG 253,0 19784 9429 /lib/libdl-2.12.so
X 6393 root mem REG 253,0 133136 1793 /lib/libpthread-2.12.so
X 6393 root mem REG 253,0 76880 9431 /lib/libz.so.1.2.3
X 6393 root mem REG 253,0 202040 9432 /lib/libm-2.12.so
X 6393 root mem REG 253,0 41724 9444 /lib/librt-2.12.so
X 6393 root mem REG 253,0 122436 9446 /lib/libselinux.so.1
X 6393 root mem REG 253,0 286380 2269 /lib/libdbus-1.so.3.4.0
X 6393 root mem REG 253,0 12356 151434 /usr/lib/xorg/modules/input/vmmouse_drv.so
X 6393 root mem REG 253,0 10008 143518 /usr/lib/libXau.so.6.0.0
X 6393 root mem REG 253,0 26960 151241 /usr/lib/xorg/modules/libvgahw.so
X 6393 root mem REG 253,0 453748 151232 /usr/lib/xorg/modules/extensions/libglx.so
X 6393 root mem REG 253,0 3180428 145330 /usr/lib/dri/swrast_dri.so
X 6393 root mem REG 253,0 1605932 177956 /usr/lib/libcrypto.so.1.0.0
X 6393 root mem REG 253,0 93248 13336 /lib/libaudit.so.1.0.0
X 6393 root mem REG 253,0 942040 177121 /usr/lib/libstdc++.so.6.0.13
X 6393 root mem REG 0,0 134217728 6682 /sys/devices/pci0000:00/0000:00:0f.0/resource1
X 6393 root mem REG 0,0 8388608 6683 /sys/devices/pci0000:00/0000:00:0f.0/resource2
X 6393 root 0w REG 253,0 26948 7127 /var/log/Xorg.0.log
X 6393 root 1u IPv6 70791 0t0 TCP *:6000 (LISTEN)
X 6393 root 2u CHR 136,0 0t0 3 /dev/pts/0
X 6393 root 3u IPv4 70792 0t0 TCP *:6000 (LISTEN)
X 6393 root 4u unix 0xee148440 0t0 70793 socket
X 6393 root 5u unix 0xf4a58dc0 0t0 70794 /tmp/.X11-unix/X0
X 6393 root 6r REG 253,0 31246 177864 /usr/lib/xorg/protocol.txt
X 6393 root 7w REG 0,3 0 4026531957 /proc/mtrr
X 6393 root 8u CHR 4,8 0t0 5239 /dev/tty8
X 6393 root 9u CHR 10,63 0t0 17 /dev/vga_arbiter
X 6393 root 10u REG 0,0 256 6680 /sys/devices/pci0000:00/0000:00:0f.0/config
X 6393 root 11w REG 0,3 0 4026531957 /proc/mtrr
X 6393 root 12u unix 0xf4a58bc0 0t0 70805 socket
X 6393 root 13u CHR 13,67 0t0 5405 /dev/input/event3
X 6393 root 14u CHR 13,66 0t0 5391 /dev/input/event2
X 6393 root 15u CHR 13,64 0t0 5387 /dev/input/event0
X 6393 root 16u CHR 13,65 0t0 5388 /dev/input/event1
4.5 桌面故障诊断思路
1.
每一个桌面都在用户的
Home
目录下保存了配置文件
KDE
为
$HOME/.kde
GNOME
为
$HOMW/.gnome
2.
检查桌面环境故障最佳方式为使用新用户账号来查看问题是否依旧存在,如新用户问题不存在,则可能是配置文件出错。
3.
确定问题是和用户有关还是和系统相关,然后再分析。
本文出自 “盛's Blog” 博客,请务必保留此出处http://hangcheng.blog.51cto.com/546317/926795