我正在使用 VirtualBox 4.3(在 Ubuntu 上)截取各种 Ubuntu 安装程序引导加载程序屏幕(例如 GRUB2、syslinux)的屏幕截图,并且我想减少引导加载程序呈现的行数和列数。
由于此时操作系统尚未加载,因此我既无法安装也无法使用 VirtualBox 客户机附加组件。此时有没有办法更改虚拟机显示的分辨率?
如果有什么区别的话,我只关心(虚拟) EFI 启动。
答案1
需要配置vga
内核启动参数:
例如,在启动时,您可能会使用:vga=795
。这会将您的系统设置为使用 Live 标签启动,屏幕分辨率为 24 位 1280X1024。以下是一些常见 vga 启动值的示例:
Depth | 800×600 | 1024×768 | 1152×864 | 1280×1024 | 1600×1200
8 bit | vga=771 | vga=773 | vga=353 | vga=775 | vga=796
16 bit | vga=788 | vga=791 | vga=355 | vga=794 | vga=798
24 bit | vga=789 | vga=792 | NA | vga=795 | vga=799
有关更多详细信息,请参阅 Ubuntu 论坛中的此帖子: http://ubuntuforums.org/showthread.php?t=258484
编辑:
如果使用 GRUB2 及其图形界面,则需要编辑
/etc/default/grub
找到线
#GRUB_GFXMODE=640x480
删除#并将 640x480 更改为您记下的首选模式。
e.g. GRUB_GFXMODE=1200x800
保存,然后输入
sudo update-grub
注意:首选模式必须是 列出的模式之一vbeinfo
。请参阅帖子https://askubuntu.com/questions/54067/how-do-i-safely-change-grub2-screen-resolution更多详细信息
答案2
为了重新索引:
# Set the EFI text mode to be used for textual displays. This option
# takes a single digit that refers to a mode number. Mode 0 is normally
# 80x25, 1 is sometimes 80x50, and higher numbers are system-specific
# modes. Mode 1024 is a special code that tells rEFInd to not set the
# text mode; it uses whatever was in use when the program was launched.
# If you specify an invalid mode, rEFInd pauses during boot to inform
# you of valid modes.
# CAUTION: On VirtualBox, and perhaps on some real computers, specifying
# a text mode and uncommenting the "textonly" option while NOT specifying
# a resolution can result in an unusable display in the booted OS.
# Default is 1024 (no change)
#
#textmode 2
# Set the screen's video resolution. Pass this option either:
# * two values, corresponding to the X and Y resolutions
# * one value, corresponding to a GOP (UEFI) video mode
# Note that not all resolutions are supported. On UEFI systems, passing
# an incorrect value results in a message being shown on the screen to
# that effect, along with a list of supported modes. On EFI 1.x systems
# (e.g., Macintoshes), setting an incorrect mode silently fails. On both
# types of systems, setting an incorrect resolution results in the default
# resolution being used. A resolution of 1024x768 usually works, but higher
# values often don't.
# Default is "0 0" (use the system default resolution, usually 800x600).
#
#resolution 1024 768
#resolution 1440 900
#resolution 3
resolution 1920 1080