4

Running an Ubuntu Server 15.10 as a guest VirtualBox VM, on a Windows 10 host.

Default terminal resolution is too small and messy, and I want to maximize the terminal or at least get it to a bigger resolution.

I've tried to edit /etc/default/grub and /etc/grub.d/00_header according to the following:

  1. Proper way to change terminal resolution in Ubuntu Server 13.04?
  2. How do I increase console-mode resolution?
  3. Maximum terminal resolution in ubuntu server virtual box guest
  4. Change Ubuntu Server 14.04 Screen Resolution
  5. adjust resolution on Ubuntu Server 10.04?

grub resolution does respond and changes accordingly, but I don't really care for that - I want to change the terminal resolution.

I tried editing the GRUB_GFXMODE line according to the vbeinfo's available resolutions. After running update-grub and update-grub2 I got the following output: output from running update-grub command

Ideas?

  • are you referring to terminal or shell? note that they are 2 different things – ostendali Dec 23 '15 at 15:47
  • Do you mean the resolution of VirtualBox console of the VM? – Tung Tran Dec 23 '15 at 16:02
  • Well @ostendali: terminal and shell both refer to software... I guess the best way I can explain it is by saying I want more space for the lines that appear on the terminal, in shell. More "black screen" in the back - so a big amount of lines will display "good" and won't have to be "lowered" to the next line. All of the above refer to when I'm using the Ubuntu Server console - not the grub. TungTran: I guess that yes. That. – somethingorange Dec 23 '15 at 16:49
  • referring to software doesn't mean they are the same thing, again, pls be more specific next time. However, if you follow the steps on this forum here: forums.virtualbox.org/viewtopic.php?f=3&t=33214 you can set the resolution of your preference. – ostendali Dec 23 '15 at 17:01
  • Yes @ostendali, they are not the same. I just wasn't sure which specifies my intentions best. Anyways - I followed the link you posted, which essentially utilizes the same methods I've tried before - and the only "new idea" I found was setting the color to 8 instead of 32 or 24, but that didn't work for me either. Thanks for the link, though. – somethingorange Dec 23 '15 at 17:19
4

Full-screen resolution can be achieved on the VirtualBox server console terminal, but setting only the GRUB_GFXMODE in the /etc/default/grub is not enough. (It may be enough for the desktop version though...)

I downloaded and installed Ubuntu 15.10 x64 server installer to test this solution and it worked!

Install hwinfo

sudo apt-get install hwinfo -fy

Got the supported mode using hwinfo

sudo hwinfo --framebuffer | grep <desired resolution>

For me it was

sudo hwinfo --framebuffer | grep 1280x1024

and the output looked like follows.

  Mode 0x0306: 1280x1024 (+160), 4 bits
  Mode 0x0307: 1280x1024 (+1280), 8 bits
  Mode 0x0319: 1280x1024 (+2560), 15 bits
  Mode 0x031a: 1280x1024 (+2560), 16 bits
  Mode 0x031b: 1280x1024 (+3840), 24 bits
  Mode 0x0345: 1280x1024 (+5120), 24 bits

Please note that it gave two mode values for 24 bit colour, but only one of them was a valid value, the other one just didn't work. In this case do as I did, try an other value from the list.

Edit /etc/default/grub

sudo nano /etc/default/grub

Uncomment the line starting with #GRUB_GFXMODE, add below it a new line for GRUB_GFXPAYLOAD_LINUX. Finally locate the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add the chosen video mode from the previous hwinfo query.

Here is a sample fragment of my /etc/default/grub file.

GRUB_CMDLINE_LINUX_DEFAULT="video=0x0345"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1280x1024
GRUB_GFXPAYLOAD_LINUX=1280x1024

Save the file using CTRL+O, then exit pressing CTRL+X.

Now we can upgrade grub and reboot.

sudo update-grub && sudo reboot

After reboot you will have a terminal with your chosen/full screen resolution :)

Also tried it on Ubuntu 14.04 and 16.04 with success.

  • Well I don't that setup anymore, so I can't say I tried your suggestion... but I recall playing around with those parameters before and they didn't work for me. Thanks for the answer, though. I hope others can vote this up if it helps them :) – somethingorange Jan 31 '17 at 12:45
  • +1 Ever since Ubuntu Server 15.x, I've been having trouble changing my console resolution when running under VirtualBox and this now seems to be the only solution that works. Thanks a lot! – LightBulb Apr 15 '17 at 13:29
  • @LightBulb Thanks for noting, :) vbeinfo worked for 12.04, but I found rebooting inconvenient, the process itself cumbersome to do and also to document. Installing hwinfo and getting framebuffer information is easier and more elegant, an evolution of Linux that i find appealing. – elbedoit Jun 18 '17 at 8:00
  • 1
    IIRC, in Ubuntu 14.04 and earlier, it was enough to simply set desired resolution by changing GRUB_GFXMODE in /etc/default/grub. I don't know why but someone decided to change this and make it more complicated. – LightBulb Jun 20 '17 at 15:58
0
  1. Boot the Ubuntu VirtualBox and press Shift to get Grub2 menu.
  2. Press c to bring Grub console
  3. Run vbeinfo to get supported modes

    grub2 vbeinfo - supported vesa BIOS modes

  4. Choose one and modify /etc/default/grub, example (Uncomment the line)

    GRUB_GFXMODE=1024x768x32
    
  5. Update boot list

    sudo update-grub
    
  • 1
    Thanks for the answer @Sneetsher. Though this concept is already found in askubuntu.com/questions/456527/… which I posted, I tried it again. Running update-grub had no effect but running update-grub2 did change the resolution, but only when the grub menu shows up - when the machine's running, the resolution remains the same. I'll update the question and add the output I got from running update-grub and update-grub2, maybe it'll give some information regarding the problem – somethingorange Jan 31 '16 at 8:59
  • @dsblind , I will try to setup same test env, and let you know my results I'm using VirtualBox 5.0.10 r104061 GuestAdditions 5.0.2. Could you edit question and add VBox & its guest additions versions. also output of vbeinfo – user.dz Jan 31 '16 at 9:18
  • This no longer works with Ubuntu Server 15.x and newer. Answer provided by @elbedoit seems to be the only one that really works. – LightBulb Apr 15 '17 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.