linux输入密码后花屏,RedHat Linux AS4.0 后花屏的解决方法

在虚拟机上安装 RedHat Linux AS4.0 后,由于视频配置时选择颜色深度太高,把 16 位色配置为 24 位色,导致打开图形界面时出现花屏,屏幕宽度非常大,严重变形,不能操作。

既然是显卡配置部分出现问题,就必须修改该部分的配置信息。在这种情况下,这些应该进入单用户模式下完成:

首先重新启动机器,在出现 grub 后,按字母“e”,然后会出现 grub 的配置文件,再按键盘移动光标到第二行“Kernal……”,再按“e”,然后在编辑界面输入 single,回车。然后按“b”重启,就进入了“单用户模式”。

进入后在提示符 # 后敲入:vi /etc/X11/xorg.conf,然后会打开这个视频配置文件,再输入“/Screen”(注意S是大写)检索到 Screen 部分,会显示相关的配置的地方。

然后您按“i”键进入Vi编辑器的插入模式,把光标移动到“24”的位置,把这里的 24 改为 16,然后按 ESC 键返回命令模式,按冒号“:”,输入 wq,回车,保存、退出。键入 reboot 命令,回车,重新启动,图形界面就出来了!

以下是一个正确的 xorg.conf 文件的内容:

# XFree86 4 configuration created by pyxf86config

Section "ServerLayout"

Identifier     "Default Layout"

Screen      0  "Screen0" 0 0

InputDevice    "Mouse0" "CorePointer"

InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

Section "Files"

# RgbPath is the location of the RGB database.  Note, this is the name of the

# file minus the extension (like ".txt" or ".db").  There is normally

# no need to change the default.

# Multiple FontPath entries are allowed (they are concatenated together)

# By default, Red Hat 6.0 and later now use a font server independent of

# the X server to render fonts.

RgbPath      "/usr/X11R6/lib/X11/rgb"

FontPath     "unix/:7100"

EndSection

Section "Module"

Load  "dbe"

Load  "extmod"

Load  "fbdevhw"

Load  "glx"

Load  "record"

Load  "freetype"

Load  "type1"

Load  "dri"

EndSection

Section "InputDevice"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))

# Option "Xleds"  "1 2 3"

# To disable the XKEYBOARD extension, uncomment XkbDisable.

# Option "XkbDisable"

# To customise the XKB settings to suit your keyboard, modify the

# lines below (which are the defaults).  For example, for a non-U.S.

# keyboard, you will probably want to use:

# Option "XkbModel" "pc102"

# If you have a US Microsoft Natural keyboard, you can use:

# Option "XkbModel" "microsoft"

#

# Then to change the language, change the Layout setting.

# For example, a german layout can be obtained with:

# Option "XkbLayout" "de"

# or:

# Option "XkbLayout" "de"

# Option "XkbVariant" "nodeadkeys"

#

# If you'd like to switch the positions of your capslock and

# control keys, use:

# Option "XkbOptions" "ctrl:swapcaps"

# Or if you just want both to be control, use:

# Option "XkbOptions" "ctrl:nocaps"

#

Identifier  "Keyboard0"

Driver      "kbd"

Option     "XkbModel" "pc105"

Option     "XkbLayout" "us"

EndSection

Section "InputDevice"

Identifier  "Mouse0"

Driver      "mouse"

Option     "Protocol" "IMPS/2"

Option     "Device" "/dev/input/mice"

Option     "ZAxisMapping" "4 5"

Option     "Emulate3Buttons" "yes"

EndSection

Section "Monitor"

Identifier   "Monitor0"

VendorName   "Monitor Vendor"

ModelName    "Unknown monitor"

HorizSync    31.5 - 37.9

VertRefresh  50.0 - 70.0

Option     "dpms"

EndSection

Section "Device"

Identifier  "Videocard0"

Driver      "s3"

VendorName  "Videocard vendor"

BoardName   "S3 Trio64 (generic)"

EndSection

Section "Screen"

Identifier "Screen0"

Device     "Videocard0"

Monitor    "Monitor0"

DefaultDepth    16

SubSection "Display"

Viewport   0 0

Depth     16

Modes    "800x600" "640x480"

EndSubSection

SubSection "Display"

Viewport   0 0

Depth    16

Modes    "800x600" "640x480"

EndSubSection

EndSection

Section "DRI"

Group        0

Mode         0666

EndSection

注意以上的 Section "Screen"……EndSection 部分,正是我们需要关心的地方。在实际中笔者发现,DefaultDepth  16 莫名其妙的变为了 DefaultDepth  16161616161616161616。SubSection "Display" 部分的两个 16 都变为了 24,需要全部变回来。这里表明是有 2 个显示器的情况。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值