With Centos 7 as a Virtualbox guest on a Mac Host, how can I change the screen resolution of the console / command line?

Solution 1:

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.

@garethTheRed's answer might work in some versions of some Linux distros, but the trick is to find the correct parameters for your environment. At least with some Red Hat distros you need to fall back to old, deprecated habits.

Solution 2:

Above all, I followed in @John Mayor's steps and made up a specific way. hope it helps to someone.


[Tested Environment]

CentOS 7.4.1708 on VMWARE Workstation 12 Player (kernel 3.10.0-693.21.1.el7.x86_64)


  1. Edit GRUB_CMDLINE_LINUX value in /etc/default/grub file

    Before :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet"
    After    :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=ask"

  2. Grub Update

    grub2-mkconfig -o /boot/grub2/grub.cfg   ( CentOS, Tested )
    grub2-mkconfig -o /boot/grub2/grub.conf ( Fedora, Not Tested )

  3. Reboot

  4. A message is displayed like below, press <ENTER>

    Press <ENTER> to see video modes available. <SPACE> to continue. or wait 30 sec

  5. Choose one of the out values and note it Display example

    example row ) z 342 1152x864x32 VESA

  6. Type z and press <ENTER> for test

  7. Boot continues. after boot, confirm the resolution is changed.

  8. Edit GRUB_CMDLINE_LINUX value in /etc/default/grub file again change vga value from ask to 0x0342 what you memoized value previous step.
    ※ Display mode number must be hexadecimal. or not, it would be undefined video mode number 342 printed

    Before :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=ask"
    After    :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=0x0342"

  9. Grub Update again

    grub2-mkconfig -o /boot/grub2/grub.cfg ( CentOS )
    grub2-mkconfig -o /boot/grub2/grub.conf ( Fedora )

  10. Reboot and confirm it.