qemu:设置或强制高于 640x480 的屏幕分辨率

qemu:设置或强制高于 640x480 的屏幕分辨率

我使用 qemu-system-arm(ARM 仿真)设置了一个运行 Debian squeeze 的虚拟机。现在我遇到的问题是,在“监视器”首选项中,我只能选择 640x480 作为分辨率。

尝试了所有不同的-vga 选项(cirrus、std、vmware)都没有成功。有什么技巧吗,也许可以使用 xorg 配置(如何操作,最近的 Debian 版本不再有 xorg.conf)?

对于开始时来说,任何高于 800x600 的尺寸都是可以的。

答案1

我没有使用过 qemu arm,但我认为这应该可行:

为了兼容性,将图形设置为-vga std

启动后,在 X 服务器中打开一个终端并尝试运行,例如:
cvt 1024 768 60

这应该输出类似这样的内容:

# 1024x768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync

复制第二行(以“modeline”开头的行)的所有内容,除了单词“modeline”本身。因此,您需要复制

"1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798

然后,输入xrandr --newmode并粘贴。因此它看起来像:

xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798

如果失败了,我需要知道它是如何失败的,但它表示我不知道存在一些问题。它应该适用于任何标准(VESA)分辨率 - 不,1366x768 不是 VESA 标准,可能会失败。1024x768 是一个不错的选择,1280x1024、1900x1200、1920x1080 和许多其他分辨率也值得一试。1360x768 也符合标准。

如果成功,现在输入xrandr不带任何参数的命令,您将获得可用显示器的列表。它可能会列出多个显示器 - 您需要选择一个显示的内容connected <resolution>,例如

VGA1 connected 1600x900+1280+0 (normal left inverted right x axis y axis) 443mm x 249mm

您的标签可能有所不同,可能显示的是 640x480。

取出第一个单词(我的情况是VGA1)并复制它。现在输入xrandr --addmode <output name> <the part in quotes from the modeline you calculated earlier, with quotes removed>,例如:

xrandr --addmode VGA1 1024x768_60.00

如果成功,您可以从 UI 中设置显示模式(可能),或者如果失败,请输入

xrandr --output VGA1 --mode 1024x768_60.00

(当然,替换你的价值观)

为了使这些在重启后仍然存在,您可以在启动时运行 xrandr (如果您将它放入例如显示管理器设置脚本中,请确保它返回零,否则启动之间发生的变化可能会导致您的 DM 挂起或不断重启!),或者您可以在 xorg.conf 或 xorg.conf.d 中放入一些内容:

Section "Device"
    Identifier    "Configured Video Device"
    Driver        "vesa"
EndSection

Section "Monitor"
    Identifier    "Configured Monitor"
    HorizSync 42.0 - 52.0 
    VertRefresh 55.0 - 65.0 
    Modeline "1024x768" 60.80  1024 1056 1128 1272   768  768  770  796
    Modeline "800x600" 38.21 800 832 976 1008 600 612 618 631
    Modeline "640x480" 24.11 640 672 760 792 480 490 495 50
    EndSection

Section "Screen"
    Identifier    "Default Screen"
    Monitor        "Configured Monitor"
    Device        "Configured Video Device"
    DefaultDepth    24
    Subsection "Display"
        Depth       24
        Modes       "1024x768" "800x600" "640x480"
       EndSubsection
EndSection

如果这些有帮助的话请告诉我:)

答案2

  • 启动到 shell 模式。如果您使用单独的内核文件,并且还使用-append,则可以init=/bin/bash在 后添加rw。(例如-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash
  • 运行sudo nano /etc/X11/xorg.conf。这将是一个新文件。
  • 添加到文件:
Section “Screen”
    Identifier “Default Screen”
    SubSection “Display”
        Depth 16
        Modes “800x600” “640x480”
    EndSubSection
EndSection

笔记:

  • 无法高于 800x600,导致黑屏时间过长,然后恢复为 800x600
  • 在“800x600”之后添加“640x480”,这样 QEMU 在失败时可以恢复到以前的状态。

相关内容