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

centosgrublinuxvirtualbox

I am using the minimum install of CentOS 7 with command line access only (no graphic support installed).

After spending hours reading online about editing grub files, installing guest additions, and setting VB options, absolutely nothing is working for me.

First, guest additions is installed. Secondly, the only grub file I have is /boot/grub2/grub.cfg, and it says not to edit it as it's dynamically generated. Finally, editing the Display under VB's > Machine > settings to automatic, none, or hint with the resolution I want does not make a difference.

Step by step, what exactly do I have to do in order to get my screen resolution to be larger than 640 x 400 as well as provide for a buffer (currently there is no buffer)?

Best Answer

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.