How to change the video mode of CentOS 7 (minimal install) as a Virtualbox guest on a Windows Host.

After doing a minimal installation of CentOS 7 (using iso image CentOS-7-x86_64-Minimal-1810.iso) for a "lab" using VirtualBox 6.0.4 I found that working with the default console was not adequate (without graphic support).

I needed a better resolution to work with it, connecting via SSH is an alternative but doesn't work as expected when you're connected using a VPN too.

So, after doing some research I found some links with excellent info about how to change the resolution of the console (using VirtualBox) and I'm creating this entry as notes for myself and others in case those links dissapear.

Do not install the VirtualBox Guest Additions, you don't need them for this.


CentOS 7 still uses the deprecated vga parameter. You wanted step-by-step, you get it:
  1. Make yourself root: sudo su
  2. vi /etc/default/grub
  3. In Vi, press i or Insert-key on your keyboard to enter the edit mode.
  4. Add vga=792 inside the "-quotes for GRUB_CMDLINE_LINUX, f.ex. GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet vga=792"
  5. Press Esc and type :wq and hit Enter to save and exit Vi.
  6. grub2-mkconfig -o /boot/grub2/grub.cfg
  7. reboot
This procedure applies not just Mac, but all host operating systems running Virtualbox: Windows, Linux.

Source: https://superuser.com/questions/816528/with-centos-7-as-a-virtualbox-guest-on-a-mac-host-how-can-i-change-the-screen-r

Other GRUB VGA Modes: http://pierre.baudu.in/other/grub.vga.modes.html

As complement for that info, I found the following too:

2.6.X kernels

You can increase the resolution at the console like so via your /etc/grub.conf file. Find the kernel ... line pertaining to your system booting up:
kernel /vmlinuz-2.6.32-358.11.1.el6.x86_64 ro 
        root=/dev/mapper/vg_mungr-lv_root rd_LVM_LV=vg_mungr/lv_root 
        rd_LVM_LV=vg_mungr/lv_swap rd_NO_LUKS rd_NO_MD 
        rd_NO_DM LANG=en_US.UTF-8 
        SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us 
        console=ttyS0,115200 crashkernel=auto vga=791
Where some of the values you can use for vga=:
  • 791 - 1024x768, 16 bit
  • 792 - 1024x768, 24 bit
  • 794 - 1280x1024, 16 bit
  • 795 - 1280x1024, 24 bit

Newer kernels (3.x)

As you move forward to newer versions of the Linux kernel that make use of KMS you'll need to change from using vga=, so you'll need to pay particular attention to what version of the kernel you're using. You can read more about it in this U&L Q&A titled: How to set the resolution in text consoles (troubleshoot when any vga=… fails).

Don't bother trying to open the link shared as "References" , is broken.

NOTE: the kernel installed with this ISO image is: 3.10.0-957.5.1

Source: https://unix.stackexchange.com/questions/123221/increasing-command-line-resolution-centos-6-4-virtualbox#123292

One "To Do" item is to check what's going to happen when yum upgrades GRUB or the installation of a new kernel (that's why I'm keeping this entry as a note of the info/examples found) or upgrading the kernel will affect this modification or no.

For now, I have a better resolution to work with,  by the way..   When I was testing the resolutions, the system was unable to use it, instead it provided me a list of possible "video modes" to be used (I'm using video mode 34B):



Comentarios