4

Is anyone willing to assist me in changing the screen resolution of my Ubuntu Server.

I'm running virtualbox (ubuntu server guest) on a Windows 10 host.

I've checked every link I could possibly find and no luck.

I've also installed the guest additions for it.

4 Answers4

8

1. Get supported video mode info (to achieve this, I had to install hwinfo)

>sudo apt-get install hwinfo

Then check supported modes (I was interested in setting the resolution to 1280x1024 and set the highest color depth available, so I'm going to check this.)

    sudo hwinfo --framebuffer |grep 1280x1024

The best available mode was shown like this

    > Mode 0x031b: 1280x1024 (+3840), 24 bits
    > Mode 0x0345: 1280x1024 (+5120), 24 bits

Strange as it is, 0x0345 worked from the above two modes only.

2. Edit /etc/default/grub

    sudo nano /etc/default/grub

Uncomment #GRUB_GFXMODE="some value", and change it to your resolution, also add GRUB_GFXPAYLOAD_LINUX line, like in the example below. Also modify GRUB_CMDLINE_LINUX_DEFAULT to reflect the video mode chosen.

    GRUB_CMDLINE_LINUX_DEFAULT="video=0x0345"
    GRUB_GFXMODE=1280x1024x24
    GRUB_GFXPAYLOAD_LINUX=1280x1024x24

Save the changes you have done.

3. Update grub

    sudo update-grub

4. Reboot:

    sudo reboot

If all went smooth, Ubuntu will boot in the resolution you set, for me 1280x1024x24 was fine.

Finally I managed to refine this solution, it's not partial any more.

If connecting with putty, cygwin, you will not experience this issue and the settings above will not change your terminal experience.

elbedoit
  • 121
0

I realize I'm a little late to the party, but...

This is a more native method, but the upside is that you get to skip the Guest Additions stuff. I never got that to work despite the 150 different "guides". The downsides are that you have to do this every time you've ran sudo update-grub and the window doesn't auto-resize.

sudo nano /boot/grub/grub.cfg

Find this entry: menuentry 'Ubuntu' --class ubuntu --class gnu etc.

Below that line, find the indented line that looks something like this: linux /vmlinuz-4.2.0-16-generic root=/dev/mapper/dev--vg-root ro

At the end of that line, append the following: vga=somevaluehere

VGA values here: http://www.pendrivelinux.com/vga-boot-modes-to-set-screen-resolution/

I'm using linux /vmlinuz-4.2.0-16-generic root=/dev/mapper/dev--vg-root ro vga=792 which is large enough for a 24 inch. Any larger than that and it gives you scroll bars in the VM window.

Vegard
  • 101
-1

Quick answer:

Go to the control on the top right of the screen -> (click) System Settings -> Displays -> [Click on the Resolution Drop-down option and select your preference].

Another way (which doesn't always work):

Click the View option to have the resolution automatically set by the windows size. This might not work unless you have compatible drivers for your installed system.

Please note: Some of the details will depend on the desktop GUI that you install. None is installed during the initial install.

L. D. James
  • 25,444
-1

There is no need to run commands nor install guest additions. I just hit shift+ctrl+c so it takes the guest host to scale mode, and then you can adjust the scale factor from settings display and adjust it for larger.