VirtualBox

Version 5 (modified by Michael Thayer, 8 years ago) ( diff )

Information about the Windows Additions

Please feel free to send documentation patches to the vbox-dev mailing list.

Mechanics of host-guest dynamic resizing

In normal use, with the standard graphical user interface and with Guest Additions installed, VirtualBox resizes guest desktops to match whenever the host window is resized. This document describes the way the mechanism is supposed to - and usually does - work. It also points out the tricky parts which might potentially fail.

The guest video device

VirtualBox virtual machines contain an emulated graphics card which can currently support up to 64 monitor outputs (the actual number is set by the user before starting the machine). Each output can be set to any resolution which the configured video RAM size will support (potentially using overlapping video RAM areas). Normally it will be controlled by the Guest Additions video driver, but it can also be controlled by a VGA driver or using the VESA BIOS, which can only set a limit set of the resolutions that the card can handle, and only on the first screen. When the guest sets a new resolution on a given monitor output the user interface resizes the matching window to fit. This only happens once for each resolution change. If it appears to be repeating, the guest has probably got stuck setting and resetting resolutions.

Resize requests from the host

The VirtualBox graphics card has a mechanism to transmit resize requests from the host to the guest operating system. Generally the Guest Additions graphics driver tells the guest that a monitor of the given size has been plugged into the matching monitor output. If automatic resizing is enabled, then when the user directly or indirectly resizes a virtual machine screen window on the host system (an example of indirect resizing would be a window manager adjusting the size) the graphical interface sends one of these "size hints" to the guest. The expected result is that the guest operating system will almost immediately resize that output to the size requested. The user interface will see that the new output size matches the window's size and will not attempt to change it.

In theory the guest could decide to set a slightly different size, perhaps just by one or two pixels, and the host could try to insist on the original one, but in practice this has not been observed. What is more common is that the guest ignores the request for some reason - for example if the user has accidentally told GNOME Shell in a guest that they only want a certain resolution. Another known problem is that on older Linux guests without kernel graphics drivers we send an ACPI monitor change notification, which a few older guests interpret as a request to cycle to the next available resolution after the resize has already taken place. No modern Linux system is known to be affected, and as of X.Org Server 1.19 in the guest we require use of the kernel driver.

Guest Additions components

Windows guests

  • VBoxVideo: the main graphics driver loaded into the kernel. It can tell how many screens (that is, screen connectors) the guest currently supports, and can enable and disable them as well as setting resolutions to them. It reports this information to Windows on the guest. It can not receive information from the host about screen changes (mode hints, monitor unplug or hotplug) itself, but provides an interface for a user-space tool which can to provide that information. It remembers information received in the Windows registry and simply assumes when it loads that the configuration has not changed since it was last used.
  • VBoxTray: a user-space daemon which is loaded when a user logs into Windows on the guest and runs as part of that session. It can receive screen change information from the host and forward it to VBoxVideo.
Note: See TracWiki for help on using the wiki.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette