Linux – How to resize Alpine Linux terminal in VirtualBox

alpine-linuxvirtualbox

Please help me with info, how to resize terminal window of Alpine Linux inside the VirtualBox so that it would fill all the host virtualbox window.

Alpine version: virt-3.7.0
VirtualBox version: 5.2.12 (macOS host)

I've also installed virtualbox-guest-additions and virtualbox-guest-modules-virthardened with apk like this:

apk add virtualbox-guest-additions virtualbox-guest-modules-virthardened

But it still does not work.

Best Answer

I'm assuming you're talking about the standard linux console, not a graphical terminal inside Xorg or Wayland. That being the case:

With extlinux bootloader

Alpine defaults to using extlinux when installed on a machine that's booted in BIOS mode.

You can set the terminal size by editing /boot/extlinux.conf:

  1. Remove nomodeset from the line starting APPEND.
  2. Add a video=... line at the end of the APPEND line, with the resolution you want. For example, video=1440x900.
  3. Reboot.

With grub bootloader

Alpine defaults to grub when installed on a machine booted in EFI mode.

Edit /etc/default/grub:

  1. Find the GRUB_CMDLINE_LINUX_DEFAULT line, and remove nomodeset.
  2. Add these two lines:

    GRUB_GFXMODE=1440x900
    GRUB_GFXPAYLOAD=1440x900
    
  3. Run grub-mkconfig -o /boot/grub/grub.cfg as root (or use sudo if you have it set up).
  4. Reboot

The virtualbox guest additions packages only provide support for Xorg video, and a few other things like shared folders.

Related Question