4.5. Hardware-Accelerated Graphics

4.5.1. Hardware 3D Acceleration (OpenGL and Direct3D 8/9)

The Oracle VM VirtualBox Guest Additions contain experimental hardware 3D support for Windows, Linux, and Oracle Solaris guests.

With this feature, if an application inside your virtual machine uses 3D features through the OpenGL or Direct3D 8/9 programming interfaces, instead of emulating them in software, which would be slow, Oracle VM VirtualBox will attempt to use your host's 3D hardware. This works for all supported host platforms, provided that your host operating system can make use of your accelerated 3D hardware in the first place.

The 3D acceleration feature currently has the following preconditions:

  • It is only available for certain Windows, Linux, and Oracle Solaris guests. In particular:

    • 3D acceleration with Windows guests requires Windows 2000, Windows XP, Vista, or Windows 7. Apart from on Windows 2000 guests, both OpenGL and Direct3D 8/9 are supported on an experimental basis.

    • OpenGL on Linux requires kernel 2.6.27 or later, as well as X.org server version 1.5 or later. Ubuntu 10.10 and Fedora 14 have been tested and confirmed as working.

    • OpenGL on Oracle Solaris guests requires X.org server version 1.5 or later.

  • The Guest Additions must be installed.

    Note

    For the basic Direct3D acceleration to work in a Windows Guest, Oracle VM VirtualBox needs to replace Windows system files in the virtual machine. As a result, the Guest Additions installation program offers Direct3D acceleration as an option that must be explicitly enabled. Also, you must install the Guest Additions in Safe Mode. This does not apply to the WDDM Direct3D video driver available for Windows Vista and later. See Known Limitations for details.

  • Because 3D support is still experimental at this time, it is disabled by default and must be manually enabled in the VM settings. See Section 3.6, “Display Settings”.

    Note

    Untrusted guest systems should not be allowed to use the 3D acceleration features of Oracle VM VirtualBox, just as untrusted host software should not be allowed to use 3D acceleration. Drivers for 3D hardware are generally too complex to be made properly secure and any software which is allowed to access them may be able to compromise the operating system running them. In addition, enabling 3D acceleration gives the guest direct access to a large body of additional program code in the Oracle VM VirtualBox host process which it might conceivably be able to use to crash the virtual machine.

To enable Aero theme support, the Oracle VM VirtualBox WDDM video driver must be installed, which is available with the Guest Additions installation. The WDDM driver is not installed by default for Vista and Windows 7 guest and must be manually selected in the Guest Additions installer by clicking No in the Would You Like to Install Basic Direct3D Support dialog displayed when the Direct3D feature is selected.

The Aero theme is not enabled by default. To enable it, do the following:

  • Windows Vista guests: Right-click on the desktop and select Personalize, then select Windows Color and Appearance in the Personalization window. In the Appearance Settings dialog, select Windows Aero and click OK.

  • Windows 7 guests: Right-click on the desktop and select Personalize. Select any Aero theme in the Personalization window.

Technically, Oracle VM VirtualBox implements this by installing an additional hardware 3D driver inside your guest when the Guest Additions are installed. This driver acts as a hardware 3D driver and reports to the guest operating system that the virtual hardware is capable of 3D hardware acceleration. When an application in the guest then requests hardware acceleration through the OpenGL or Direct3D programming interfaces, these are sent to the host through a special communication tunnel implemented by Oracle VM VirtualBox, and then the host performs the requested 3D operation using the host's programming interfaces.

4.5.2. Hardware 2D Video Acceleration for Windows Guests

The Oracle VM VirtualBox Guest Additions contain experimental hardware 2D video acceleration support for Windows guests.

With this feature, if an application such as a video player inside your Windows VM uses 2D video overlays to play a movie clip, then Oracle VM VirtualBox will attempt to use your host's video acceleration hardware instead of performing overlay stretching and color conversion in software, which would be slow. This currently works for Windows, Linux and Mac OS X host platforms, provided that your host operating system can make use of 2D video acceleration in the first place.

Hardware 2D video acceleration currently has the following preconditions:

  • Only available for Windows guests, running Windows XP or later.

  • Guest Additions must be installed.

  • Because 2D support is still experimental at this time, it is disabled by default and must be manually enabled in the VM settings. See Section 3.6, “Display Settings”.

Technically, Oracle VM VirtualBox implements this by exposing video overlay DirectDraw capabilities in the Guest Additions video driver. The driver sends all overlay commands to the host through a special communication tunnel implemented by Oracle VM VirtualBox. On the host side, OpenGL is then used to implement color space transformation and scaling