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:
- Make yourself root:
sudo su
vi /etc/default/grub
- In Vi, press
i
orInsert
-key on your keyboard to enter the edit mode. - Add
vga=792
inside the "-quotes forGRUB_CMDLINE_LINUX
, f.ex.GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet vga=792"
- Press
Esc
and type:wq
and hitEnter
to save and exit Vi. grub2-mkconfig -o /boot/grub2/grub.cfg
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)
-
Edit
GRUB_CMDLINE_LINUX
value in/etc/default/grub
fileBefore :
GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet"
After :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=ask"
-
Grub Update
grub2-mkconfig -o /boot/grub2/grub.cfg ( CentOS, Tested )
grub2-mkconfig -o /boot/grub2/grub.conf ( Fedora, Not Tested ) Reboot
-
A message is displayed like below, press
<ENTER>
Press
<ENTER>
to see video modes available.<SPACE>
to continue. or wait 30 sec -
Choose one of the out values and note it Display example
example row ) z 342 1152x864x32 VESA
Type
z
and press<ENTER>
for testBoot continues. after boot, confirm the resolution is changed.
-
Edit
GRUB_CMDLINE_LINUX
value in/etc/default/grub
file again change vga value from ask to0x0342
what you memoized value previous step.
※ Display mode number must behexadecimal
. or not, it would beundefined video mode number 342
printedBefore :
GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=ask"
After :GRUB_CMDLINE_LINUX="crashkernel=auto ... rhgb quiet vga=0x0342"
-
Grub Update again
grub2-mkconfig -o /boot/grub2/grub.cfg ( CentOS )
grub2-mkconfig -o /boot/grub2/grub.conf ( Fedora ) Reboot and confirm it.