8月 052021
 

通过查看dmesg信息获取当前文本终端的默认显示分辨率

[ 4.426948] [drm] DMA map mode: Caching DMA mappings.
[ 4.427281] [drm] Capabilities:
[ 4.427282] [drm] Rect copy.
[ 4.427282] [drm] Cursor.
[ 4.427283] [drm] Cursor bypass.
[ 4.427283] [drm] Cursor bypass 2.
[ 4.427283] [drm] 8bit emulation.
[ 4.427284] [drm] Alpha cursor.
[ 4.427284] [drm] 3D.
[ 4.427284] [drm] Extended Fifo.
[ 4.427284] [drm] Multimon.
[ 4.427285] [drm] Pitchlock.
[ 4.427285] [drm] Irq mask.
[ 4.427285] [drm] Display Topology.
[ 4.427286] [drm] GMR.
[ 4.427286] [drm] Traces.
[ 4.427286] [drm] GMR2.
[ 4.427286] [drm] Screen Object 2.
[ 4.427287] [drm] Command Buffers.
[ 4.427287] [drm] Command Buffers 2.
[ 4.427287] [drm] Guest Backed Resources.
[ 4.427288] [drm] DX Features.
[ 4.427288] [drm] HP Command Queue.
[ 4.427288] [drm] Capabilities2:
[ 4.427289] [drm] Grow oTable.
[ 4.427289] [drm] IntraSurface copy.
[ 4.427289] [drm] DX3.
[ 4.427290] [drm] Max GMR ids is 64
[ 4.427291] [drm] Max number of GMR pages is 65536
[ 4.427292] [drm] Max dedicated hypervisor surface memory is 0 kiB
[ 4.427292] [drm] Maximum display memory size is 262144 kiB
[ 4.427293] [drm] VRAM at 0xe8000000 size is 131072 kiB
[ 4.427294] [drm] MMIO at 0xfe000000 size is 256 kiB
[ 4.437927] [TTM] Zone kernel: Available graphics memory: 996108 KiB
[ 4.464121] [drm] Screen Target Display device initialized
[ 4.464193] [drm] width 1280
[ 4.464211] [drm] height 768
[ 4.464229] [drm] bpp 32
[ 4.493584] [drm] Fifo max 0x00040000 min 0x00001000 cap 0x0000077f
[ 4.591064] [drm] Using command buffers with DMA pool.
[ 4.594738] [drm] Atomic: yes.
[ 4.594741] [drm] SM5 support available.

通过hwinfo命令查看当前可用的分辨率模式

[root@fedora ~]# hwinfo --framebuffer
02: None 00.0: 11001 VESA Framebuffer 
[Created at bios.459]
Unique ID: rdCR.O3PgoQaqFo1
Hardware Class: framebuffer
Model: "VMware virtual machine"
Vendor: "VMware, Inc"
Device: "VMware virtual machine"
SubVendor: "V M ware, Inc. VBE support 2.0"
SubDevice: 
Revision: "2.0"
Memory Size: 0 MB
Memory Range: 0xe8000000-??? (rw)
Mode 0x0300: 640x400 (+640), 8 bits
Mode 0x0301: 640x480 (+640), 8 bits
Mode 0x0303: 800x600 (+800), 8 bits
Mode 0x0305: 1024x768 (+1024), 8 bits
Mode 0x0307: 1280x1024 (+1280), 8 bits
Mode 0x030e: 320x200 (+640), 16 bits
Mode 0x0311: 640x480 (+1280), 16 bits
Mode 0x0314: 800x600 (+1600), 16 bits
Mode 0x0317: 1024x768 (+2048), 16 bits
Mode 0x031a: 1280x1024 (+2560), 16 bits
Mode 0x0320: 320x200 (+320), 8 bits
Mode 0x0321: 320x400 (+320), 8 bits
Mode 0x0322: 640x400 (+640), 8 bits
Mode 0x0323: 640x480 (+640), 8 bits
Mode 0x0324: 800x600 (+800), 8 bits
Mode 0x0325: 1024x768 (+1024), 8 bits
Mode 0x0326: 1152x864 (+1152), 8 bits
Mode 0x0327: 1280x960 (+1280), 8 bits
Mode 0x0328: 1280x1024 (+1280), 8 bits
Mode 0x0329: 1400x1050 (+1408), 8 bits
Mode 0x032a: 1600x1200 (+1600), 8 bits
Mode 0x032b: 1792x1344 (+1792), 8 bits
Mode 0x032c: 1856x1392 (+1856), 8 bits
Mode 0x032d: 1920x1440 (+1920), 8 bits
Mode 0x032e: 320x200 (+640), 16 bits
Mode 0x032f: 320x400 (+640), 16 bits
Mode 0x0330: 640x400 (+1280), 16 bits
Mode 0x0331: 640x480 (+1280), 16 bits
Mode 0x0332: 800x600 (+1600), 16 bits
Mode 0x0333: 1024x768 (+2048), 16 bits
Mode 0x0334: 1152x864 (+2304), 16 bits
Mode 0x0335: 1280x960 (+2560), 16 bits
Mode 0x0336: 1280x1024 (+2560), 16 bits
Mode 0x0337: 1400x1050 (+2816), 16 bits
Mode 0x0338: 1600x1200 (+3200), 16 bits
Mode 0x0339: 1792x1344 (+3584), 16 bits
Mode 0x033a: 1856x1392 (+3712), 16 bits
Mode 0x033b: 1920x1440 (+3840), 16 bits
Mode 0x033c: 320x200 (+1280), 24 bits
Mode 0x033d: 320x400 (+1280), 24 bits
Mode 0x033e: 640x400 (+2560), 24 bits
Mode 0x033f: 640x480 (+2560), 24 bits
Mode 0x0340: 800x600 (+3200), 24 bits
Mode 0x0341: 1024x768 (+4096), 24 bits
Mode 0x0342: 1152x864 (+4608), 24 bits
Mode 0x0343: 1280x960 (+5120), 24 bits
Mode 0x0344: 1280x1024 (+5120), 24 bits
Mode 0x0345: 1400x1050 (+5600), 24 bits
Mode 0x0346: 1600x1200 (+6400), 24 bits
Mode 0x0347: 1792x1344 (+7168), 24 bits
Mode 0x0348: 1856x1392 (+7424), 24 bits
Mode 0x0349: 1920x1440 (+7680), 24 bits
Mode 0x034a: 1366x768 (+1376), 8 bits
Mode 0x034b: 1366x768 (+2752), 16 bits
Mode 0x034c: 1366x768 (+5472), 24 bits
Mode 0x034d: 1680x1050 (+1696), 8 bits
Mode 0x034e: 1680x1050 (+3360), 16 bits
Mode 0x034f: 1680x1050 (+6720), 24 bits
Mode 0x0350: 1920x1200 (+1920), 8 bits
Mode 0x0351: 1920x1200 (+3840), 16 bits
Mode 0x0352: 1920x1200 (+7680), 24 bits
Mode 0x0353: 2048x1536 (+2048), 8 bits
Mode 0x0354: 2048x1536 (+4096), 16 bits
Mode 0x0355: 2048x1536 (+8192), 24 bits
Mode 0x0356: 320x240 (+320), 8 bits
Mode 0x0357: 320x240 (+640), 16 bits
Mode 0x0358: 320x240 (+1280), 24 bits
Mode 0x0359: 400x300 (+416), 8 bits
Mode 0x035a: 400x300 (+800), 16 bits
Mode 0x035b: 400x300 (+1600), 24 bits
Mode 0x035c: 512x384 (+512), 8 bits
Mode 0x035d: 512x384 (+1024), 16 bits
Mode 0x035e: 512x384 (+2048), 24 bits
Mode 0x035f: 854x480 (+864), 8 bits
Mode 0x0360: 854x480 (+1728), 16 bits
Mode 0x0361: 854x480 (+3424), 24 bits
Mode 0x0362: 1280x720 (+1280), 8 bits
Mode 0x0363: 1280x720 (+2560), 16 bits
Mode 0x0364: 1280x720 (+5120), 24 bits
Mode 0x0365: 1920x1080 (+1920), 8 bits
Mode 0x0366: 1920x1080 (+3840), 16 bits
Mode 0x0367: 1920x1080 (+7680), 24 bits
Mode 0x0368: 1280x800 (+1280), 8 bits
Mode 0x0369: 1280x800 (+2560), 16 bits
Mode 0x036a: 1280x800 (+5120), 24 bits
Mode 0x036b: 1440x900 (+1440), 8 bits
Mode 0x036c: 1440x900 (+2880), 16 bits
Mode 0x036d: 1440x900 (+5760), 24 bits
Mode 0x036e: 720x480 (+736), 8 bits
Mode 0x036f: 720x480 (+1440), 16 bits
Mode 0x0370: 720x480 (+2880), 24 bits
Mode 0x0371: 720x576 (+736), 8 bits
Mode 0x0372: 720x576 (+1440), 16 bits
Mode 0x0373: 720x576 (+2880), 24 bits
Mode 0x0374: 800x480 (+800), 8 bits
Mode 0x0375: 800x480 (+1600), 16 bits
Mode 0x0376: 800x480 (+3200), 24 bits
Mode 0x0377: 1280x768 (+1280), 8 bits
Mode 0x0378: 1280x768 (+2560), 16 bits
Mode 0x0379: 1280x768 (+5120), 24 bits
Config Status: cfg=new, avail=yes, need=no, active=unknown
[root@fedora ~]#

修改文本终端分辨率模式的三种方法

1)在Linux启动阶段输出可用分辨率模式并由用户选择

vga=ask

2)在Linux启动阶段手动添加分辨率模式参数

vga=0x0364

3)修改GRUB2引导菜单配置,永久新增分辨率模式参数

[root@fedora ~]# grubby --default-kernel
/boot/vmlinuz-5.11.12-300.fc34.x86_64
[root@fedora ~]# grubby --args="vga=0x0364" --update-kernel /boot/vmlinuz-5.11.12-300.fc34.x86_64
[root@fedora ~]#

修改GRUB2引导菜单配置并重启后查看GRUB2引导菜单的变化

查看分辨率为1280*720的虚拟机文本终端窗口

https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Making_Persistent_Changes_to_a_GRUB_2_Menu_Using_the_grubby_Tool