10

I have a windows 7 host and a debian 8 guest. I already installed

virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

as described in https://askubuntu.com/questions/3205/higher-screen-resolution-in-virtualbox. Before installing these packages I was able to select a maximum of 1024*768. After installation 1600*1200 was possible. But I simply want to use 1920*1080 fullscreen on my display.

Pressing Host-G is not possible. I seams this combination is deactivated. How do I increase VirtualBox resolution past 800x600 in Linux?

Is there a way to do this?

6 Answers 6

9

I found a solution for that in the meanwhile.

There are two descriptions that show how this works:

1st: How to adjust the screen resolution in Debian?

2nd: http://forums.debian.net/viewtopic.php?f=16&t=78330#p429581

In short:

$ cvt 1920 1080 60
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$ xrandr --addmode VBOX0 "1920x1080_60.00"
$ xrandr --output VBOX0 --mode 1920x1080_60.00

After execution these commands automatically the new resolution appears. Additionally these commands must be executed after each start of the operating system.

In the meantime I wrote a blog post about that topic: http://www.robert-franz.com/2015/06/28/adding-new-resolution-to-the-x-window-server/

2
  • This works to me, with same config but changing VBOX0 by VGA-0. Thanks !!
    – gonzalezea
    Apr 26, 2016 at 13:48
  • This worked for me but I had to check settings --> display to find the screen name which was Virtual1 instead of VBOX0 in my case
    – Butanium
    Jan 13, 2022 at 23:08
8

A straightforward way of achieving that would be to change the specific configuration in the grub2 bootloader directly:

  1. Find out the resolutions supported by your debian guest

    • Reboot debian and keep pressing c until you see the grub console.
    • Press vbeinfo and hit enter. It will give you a list of supported resolutions.
  2. Edit /etc/grub.d/00_header

    • Replace autoin the line if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi with the new resolution. e.g.: if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=1920x1080 ; fi
    • Right underneath, make a copy of the line edited and replace MODE with PAYLOAD. e.g.: if [ "x${GRUB_GFXPAYLOAD}" = "x" ] ; then GRUB_GFXPAYLOAD=1920x1080 ; fi
    • Further below, you'll find the following line: set gfxmode=${GRUB_GFXMODE}. Add the following line below it: set gfxpayload=${GRUB_GFXPAYLOAD}
  3. Reload grub2 configurations by running the command update-grub2 and rebooting afterwards reboot

[Note]
I've seen many examples in which the default line #GRUB_GFXMODE=640x480 in the file /etc/defaul/grub in uncommented. It was proven to be unnecessary for me but in case you need it, remember to update-grub2 after you've uncommented it.

1
  • Worked great, even with steps 2.2 and 2.3 omitted :) Thanks a lot! Jan 16, 2018 at 12:08
1

I know this question realtes to different versions but it might be usefull for someone that has installed the latest version of VirtualBox (5.2)

My setup:

  • VirtualBox 5.2.0 r118431
  • Host OS: Windows 10
  • Guest OS: Linux Debian 9.2.1 with XFCE
  • Guest Additions ISO: VBoxGuestAdditions_5.2.1-118447 (please note that this is not the ISO you get with the default installer, there is a note on virtualbox site to download a newer version)

The following commands must be run in super user mode on guest OS rebooted:

mkdir -p /lib/modules/$(uname -r)/build/include/drm

touch /lib/modules/$(uname -r)/build/include/drm/drm_rect.h

The VBoxLinuxAdditions.run must be executed again, and then guest OS need a reboot

There is also a newer Guest Additions ISO in the development downloads which should fix this problem Virtualbox Test builds

Credits:

1

Check the screen size in Windows:

Control panel -> Sound & Hardware -> Screen

Y the left of the windows select Adjust resolution, and you can see what is the actual resolution of the host screen, use that in your Ubuntu/Debian. In Debian go to Settings -> Displays, choose the display and adjust the resolutions, that's all.

1

I'm using a Debian 10 image in VirtualBox under Windows 10, and installed Debian with the default GUI.

I found that within the GUI, I was able to select a resolution directly (eg. 1920x1440 in my case, my host machine's max res), avoiding having to wrangle with the CLI.

Settings (app) -> Devices -> Displays -> Resolution

Choosing a resolution caused the VM to assume the selected screen size and the VirtualBox window resized appropriately.

3
  • I did try the top-voted solution (including using XWAYLAND0 as the display name, as reported by xrandr on my machine) and failed, so I was pleasantly surprised to find the GUI approach worked seamlessly. Dec 30, 2020 at 16:25
  • Please edit your answer to add some explanation or code instead of using comments as you did. Dec 30, 2020 at 17:24
  • @help-info.de I've adjusted the answer slightly, emphasizing the GUI path to achieve this. I specifically added this answer to ensure searchers who assume that the CLI is required (eg. me, some comfort with Linux servers, but not desktop) also realize that a straight-forward GUI solution is also available. Dec 30, 2020 at 19:55
0

My issue was that although the 1920x1080 resolution was available and enabled in the VB menu, selecting it didn't change it.

I've tried the sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms, and the suggestion to correct the Grub-file above, but what seemed to do the trick, was to upgrade Virtualbox to 5.1.20 and install the corresponding version of the guestadditions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .