4.1. Oracle VM VirtualBox

4.1.1. About Oracle VM VirtualBox
4.1.2. System Requirements for Oracle VM VirtualBox
4.1.3. Installing Oracle VM VirtualBox
4.1.4. Updating Oracle VM VirtualBox
4.1.5. Configuring the VRDP Port Range
4.1.6. Configuring the VirtualBox Host Memory Overhead

4.1.1. About Oracle VM VirtualBox

Oracle VDI bundles and supports a specific Oracle VM VirtualBox release. See Section 4.1.2, “System Requirements for Oracle VM VirtualBox”.

VirtualBox provides the following features:

  • Shared Memory: Shared Memory (also known as memory ballooning) is a feature that enables more desktops to run on VirtualBox hosts. By specifying an amount of memory to be shared between desktops, the VirtualBox host's memory can be automatically redistributed between desktops as required. The Shared Memory feature can be activated on a per-pool basis on the Pool category, Settings tab by specifying a value greater than 0% (up to 75%).

    The memory sharing percentage is the amount of memory that can be used for other desktops if a desktop does not require the full amount of memory for itself. For instance, if the desktop memory size is 1 GB and memory sharing is set to 40%, the desktop will initially have around 600 MB of real memory. The other 400 MB will be made available to the desktop on demand.

    Oracle VDI constantly monitors desktops with memory sharing enabled to ensure they do not run out of memory. If a desktop's free memory drops below 64 MB more usable memory will be provided. If a desktop has excessive amounts of free memory, some memory will be gradually taken away until the memory sharing percentage is reached. The changes to desktop memory will not be apparent to the guest OS.

  • Memory Paging: The Memory Paging feature can be activated on a per-pool basis on the Pool category, Settings tab.

    Memory Paging (also known as de-duplication of memory) is a feature that enables more desktops to run on VirtualBox hosts. If several desktops have identical content in memory, pages will be used to consume real memory on the hypervisor only once. The desktops will reference the page and do not need physical memory for identical pages any more.

4.1.2. System Requirements for Oracle VM VirtualBox

4.1.2.1. Supported VirtualBox Platforms

Oracle VDI includes release 4.2.10 of Oracle VM VirtualBox. For reasons of backward compatibility, you can continue to use some releases of VirtualBox that were included in previous releases of Oracle VDI. In this release, the following are the only supported releases of VirtualBox:

  • 4.2.10 (bundled with Oracle VDI release 3.5)

  • 4.1.18 (bundled with Oracle VDI release 3.4.1)

  • 4.1.14 (bundled with Oracle VDI release 3.4)

To obtain the best performance and new features, use the bundled VirtualBox 4.2.10 release.

The following are the supported installation platforms for the bundled VirtualBox 4.2.10 release:

Operating System

Supported Releases

Oracle Linux (64-bit) on x86 platforms

5.8 and 6.3

Oracle Solaris (64-bit) on x86 platforms

Oracle Solaris 10 release 8/11 (update 10) or later

Oracle Solaris 11.1 or later

Oracle products certified on Oracle Linux are also certified and supported on Red Hat Enterprise Linux due to implicit compatibility between both distributions. Oracle does not run any additional testing on Red Hat Enterprise Linux products. However, due to Bug ID 13974640, you must use Oracle's Unbreakable Enterprise Kernel if you use Oracle Linux as the platform for your VirtualBox hosts. The Red Hat kernel is not supported.

Oracle VM VirtualBox requires storage for the virtual disks used by Oracle VDI. The installation platform you select affects the choices you have for storage, see Section 4.6.1, “Introduction to Storage” for details.

Due to the differences in the availability of the storage types and the way they are used, the virtualization hosts for an Oracle VM VirtualBox desktop provider must use the same operating system, either Oracle Linux or Oracle Solaris. You can use a mixture of Oracle Linux 5 and Oracle Linux 6 hosts, or Oracle Solaris 10 and Oracle Solaris 11 hosts, in a desktop provider.

If you use iSCSI or ZFS storage, all VirtualBox hosts on Oracle Linux platforms must run the same kernel and kernel version. This is a requirement of the Oracle Cluster File System version 2 (OCFS2) file system used for these storage types.

All VirtualBox hosts must have the virtualization extensions from AMD (AMD-V) and Intel (VT-x) enabled. Some basic hardware sizing guidelines can be found at Chapter 7, Performance and Tuning. For more detailed assistance with sizing, contact an Oracle Sales or Support representative.

If the firewall is enabled on VirtualBox hosts, see Section 2.5.3, “Firewalls Between Desktop Providers and Oracle VDI Centers” for details of the ports that might need to be opened.

4.1.2.2. System Requirements for VirtualBox Hosts on Oracle Linux Platforms

VirtualBox requires specific packages to be installed. The VirtualBox installation script checks for these packages before installing the software. If any required packages are missing, the installation script uses the yum command to check whether the packages are available. If the missing required packages are available, you are prompted to continue and the packages are downloaded and installed. If the required packages are not available, the installation fails and a list of required packages that must be installed is displayed.

Automatic software update tools can be configured to update a host to a new release of Oracle Linux when it becomes available. Updates performed in this way can result in the host being updated to a release of Oracle Linux that is not supported. You must ensure that your VirtualBox hosts are configured to receive updates only for the supported releases of Oracle Linux.

Before you install VirtualBox on a host:

  1. Ensure that yum is configured correctly.

    On Oracle Linux 6 platforms, VirtualBox is included in the available ULN channels or yum repositories. This can result in VirtualBox being automatically updated to a release that is not supported. To disable automatic updates to VirtualBox, add the following exclude statement to the [main] section of the /etc/yum.conf file on the host:

    exclude=VirtualBox*

    The required channel or repository configuration is the same as for Oracle VDI hosts, apart from the Oracle Linux 6 GDM Multiseat ([ol6_gdm_multiseat]) requirement.

    To resolve package dependencies and to receive updates only for the supported releases of Oracle Linux, see the following:

  2. Update the host with the latest package versions by using the yum update command.

If the host does not have Internet access, you can configure yum to resolve package dependencies using a local source, see Section 2.2.3.3, “Resolving Package Dependencies Without Internet Access”.

If the VirtualBox host is also used as an Oracle VDI host, you might experience poor performance with desktops in pools that use the VRDP protocol if the maximum transmission unit (MTU) of the loopback network interface is set too high. You can check the MTU, and decrease it if needed, as follows:

  1. Use the ifconfig command to check the current MTU of the loopback interface.

    For example:

    # /sbin/ifconfig lo
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16346  Metric:1
              RX packets:134095573 errors:0 dropped:0 overruns:0 frame:0
              TX packets:134095573 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:82894163173 (77.2 GiB)  TX bytes:82894163173 (77.2 GiB)
    
  2. If the MTU is 8192 bytes or more, change the MTU of the loopback interface to 8154 bytes.

    The MTU must be less than 8192 bytes. A value of 8154 bytes has been tested and is known to resolve the performance issue.

    Use the ifconfig command to change the MTU, for example:

    # /sbin/ifconfig lo mtu 8154

    To make the change persist after a reboot, edit the /etc/sysconfig/network-scripts/ifcfg-lo file and add the following line:

    MTU=8154

    Use the ifconfig command to verify that the MTU of the loopback interface has been changed.

4.1.2.3. System Requirements for VirtualBox Hosts on Oracle Solaris 11 Platforms

The default Oracle Solaris 11 packages, which are provided through the solaris package publisher, are required and must be installed on the host.

The latest Oracle Solaris 11 Support Repository Update must be installed on the host.

VirtualBox requires specific packages to be installed. The VirtualBox installation script checks for these packages before installing the software. If any required packages are missing, the installation script uses the pkg command to check whether the packages are available. If the missing required packages are available, you are prompted to continue and the packages are downloaded and installed. If the required packages are not available, the installation fails and a list of required packages that must be installed is displayed. You must resolve these dependencies before you can install VirtualBox.

Before you install VirtualBox on a host:

  1. Ensure that the Oracle Solaris Image Packaging System (IPS) is configured to receive updates from the Oracle Solaris 11 Support Repository.

    For more details, see the Oracle Technology Network article How to Update Oracle Solaris 11 Systems From Oracle Support Repositories.

  2. Install the latest Oracle Solaris 11 Support Repository Update (SRU), using the pkg update command.

    For more details, see the Oracle Technology Network article More Tips for Updating Your Oracle Solaris 11 System from the Oracle Support Repository.

If the VirtualBox host is also used as an Oracle VDI host, you must ensure that the host has at least 8 gigabytes (GB) swap space. For information about configuring swap space on Oracle Solaris 11 platforms, see http://docs.oracle.com/cd/E26502_01/html/E29006/fsswap-14677.html.

4.1.2.4. System Requirements for VirtualBox Hosts on Oracle Solaris 10 Platforms

On Oracle Solaris 10 platforms, the Entire Distribution software cluster is required and must be installed on the host.

The latest Recommended Patchset must be installed before you install VirtualBox. You can download the patchset from My Oracle Support.

If the VirtualBox host is also used as an Oracle VDI host, you must ensure that the host has at least 8 gigabytes (GB) swap space. For information about configuring swap space on Oracle Solaris 10 platforms, see http://docs.oracle.com/cd/E26505_01/html/E37385/fsswap-14677.html.

4.1.2.5. ZFS ARC Cache Requirements for VirtualBox Hosts on Oracle Solaris Platforms

The VirtualBox installation script warns you if the ZFS ARC cache is not limited. If the zfs_arc_min parameter is not set, the ZFS ARC cache does not shrink below approximately 12% of the available memory. You should also set the zfs_arc_max parameter to be the same value as zfs_arc_min. The recommended setting for a dedicated VirtualBox host is 512 megabytes (MB).

If you intend to use local storage (see Section 4.6.2, “Local Storage”) on the VirtualBox host and the local storage is a ZFS file system, you might need to increase the zfs_arc_min setting because the recommended 512 MB setting maximizes the available memory for running virtual machines but reduces ZFS performance by limiting the ARC cache.

To set the zfs_arc_min and zfs_arc_max values, log in as root and edit the /etc/system file. You set the parameter values in bytes. For example, to set the values to 512 MB, add the following:

set zfs:zfs_arc_min = 536870912
set zfs:zfs_arc_max = 536870912 

4.1.2.6. User Requirements

When you install VirtualBox, you provide the user name and password of the user that runs VirtualBox on the host. Oracle VDI uses the credentials to access the VirtualBox host using SSH and to access the VirtualBox web service.

On Oracle Linux and Oracle Solaris platforms where root is a user, the root user is used by default. It is best to use the root user, as this ensures that the VirtualBox functionality for suspending and resuming virtual machines works in all situations. On Oracle Linux platforms, you must use the root user if you want to use iSCSI storage or Sun ZFS storage.

On Oracle Solaris platforms where root is a role, you must provide the user name of a different user.

The VirtualBox user must have a home directory and the home directory must not be shared between several hosts that run VirtualBox.

4.1.3. Installing Oracle VM VirtualBox

This section describes how to install the release of Oracle VM VirtualBox that is bundled with Oracle VDI.

Before you begin, check that the host meets the installation requirements, see Section 4.1.2, “System Requirements for Oracle VM VirtualBox”.

If you are updating VirtualBox, see Section 4.1.4, “Updating Oracle VM VirtualBox”.

About the VirtualBox Installation Script

Oracle VM VirtualBox is installed and uninstalled with the vb-install script. VirtualBox is delivered as two packages, an open source package (the Base Pack) and an Oracle proprietary package (the Extension Pack).

The Oracle VDI software archive only includes the Extension Pack. When you run the vb-install script, the script automatically downloads the Base Pack using the wget program. If this fails, for example due to network connectivity problems, the script exits and you must manually download the Base Pack. You can download the Base Pack and the Extension Pack from the VirtualBox download page.

The following table lists the options that can be used with vb-install script to automate the installation on several servers with a script.

Table 4.1. vb-install Script Options

Option

Description

-f

Forces existing virtual machines to be deleted.

-n user

Specifies the user name of the VirtualBox user. The default is root.

-o port

Specifies the SSL port to use to connect to VirtualBox. The default is port 443 if the user is root, otherwise port 18083.

-p

Requires input from standard input (stdin) to enter the password in a secure way.

-u

Uninstalls the currently installed release of VirtualBox.


Steps

  1. Download the Oracle VDI software archive.

  2. Become superuser (root) on the host.

  3. Unzip the Oracle VDI software archive and change working directory to the extracted directory.

    • On Oracle Linux hosts:

      # unzip vda_3.5_linux.zip
      # cd vda_3.5_linux
    • On Oracle Solaris 11 hosts:

      # unzip vda_3.5_solaris_11plus_amd64.zip
      # cd vda_3.5_solaris_11plus_amd64
    • On Oracle Solaris 10 hosts:

      # unzip vda_3.5_solaris_10_amd64.zip
      # cd vda_3.5_solaris_10_amd64
  4. Unzip the VirtualBox archive and change working directory to the extracted directory.

    # unzip vbox_4.2.zip
    # cd vbox_4.2
  5. Install VirtualBox.

    # ./vb-install

    The installation script downloads the VirtualBox Base Pack, and then installs both the Base Pack and the Extension Pack. You complete the installation by providing a user name, a password, and a port number to use for SSL connections.

    If the Base Pack download fails, you must manually download it from the VirtualBox download page. Make sure you download the release that is bundled and supported with this release of Oracle VDI. Copy the Base Pack to the same folder as the vb-install script, and then run the script again.

4.1.4. Updating Oracle VM VirtualBox

You update Oracle VM VirtualBox by installing the new release bundled with an Oracle VDI release.

When you update, the existing version of VirtualBox must first be uninstalled. When you install the new release, the installation script prompts you to uninstall existing release. Alternatively, you can uninstall the existing release manually with the vb-install -u command.

When you uninstall VirtualBox, you are prompted to shut down any virtual machines that are running. You must shut down all running virtual machines before uninstalling. You are also prompted to unregister and delete the virtual machines. If you choose to unregister and delete, you cannot register the virtual machines again after the update.

After you update VirtualBox, remember to update the guest additions in all templates and desktops.

You might need to upgrade the operating system on your hosts in order to meet the VirtualBox installation requirements for this release. If you need to upgrade the operating system, consider the following:

  • You cannot upgrade the operating system from Oracle Linux 5 to Oracle Linux 6, or from Oracle Solaris 10 to Oracle Solaris 11. You must perform a fresh installation of Oracle Linux 6 or Oracle Solaris 11. This might have an impact if you are using local storage or network file system storage.

  • If you use iSCSI or ZFS storage, all VirtualBox hosts on Oracle Linux platforms must run the same kernel and kernel version. This is a requirement of the Oracle Cluster File System version 2 (OCFS2) file system used for these storage types. If you use these storage types, you must upgrade all the hosts for a desktop provider in parallel.

  • Do not change the host name or IP address of a VirtualBox host as part of the operating system upgrade.

    If you need to change these details, remove the host from the desktop provider and then perform a fresh installation of VirtualBox.

The following is the recommended procedure for updating an Oracle VM VirtualBox Desktop Provider:

Updating an Oracle VM VirtualBox Desktop Provider

  1. Ensure that all desktops hosted by the desktop provider are shut down.

  2. Back up the storage.

    This is a precautionary step to ensure you can recover in the event of failure.

    The action required depends on the storage type and the operating system of the VirtualBox hosts, as shown in the following table.

    Storage Type

    Platform

    Action

    Local Storage

    Oracle Solaris and Linux

    Back up the directory used for local storage to a separate host.

    Network File System

    Oracle Solaris and Linux

    If the file system is a share on another host, unmount it.

    If the file system is shared by the host, back it up to a separate host.

    iSCSI

    Linux

    Ensure you have a backup of the iSCSI LUN.

    Sun ZFS

    Linux

    Ensure you have a backup of the ZFS pool.

    Sun ZFS

    Oracle Solaris

    If the storage is a local ZFS pool on the host, back it up to a separate host.

    For all other ZFS storage, no action is needed.

  3. In Oracle VDI, enable maintenance mode for the VirtualBox hosts.

    See Section 8.9.1, “Oracle VM VirtualBox and Microsoft Hyper-V Host Maintenance” for details.

  4. Upgrade the operating system, or install the new operating system, on the VirtualBox hosts.

    When you upgrade the operating system, do not change the host name or IP address of the hosts.

    Ensure that the hosts meet the operating system requirements for installing Oracle VDI:

  5. Rebuild the VirtualBox kernel module on the VirtualBox hosts.

    If you performed a fresh installation of Oracle Linux 6 or Oracle Solaris 11, you do not need to do this because you perform a fresh installation of VirtualBox in the next step.

    Run the following command as root:

    # /etc/init.d/vboxdrv setup
  6. Install VirtualBox on the hosts.

    See Section 4.1.3, “Installing Oracle VM VirtualBox” for details.

  7. Restore the storage.

    The action required depends on the storage type and the operating system of the VirtualBox hosts, as shown in the following table.

    Storage Type

    Platform

    Action

    Local Storage

    Oracle Solaris and Linux

    If the directory used for local storage was destroyed by the operating system upgrade, recreate it and restore the content from the backup.

    If the directory was not destroyed, verify that the contents of the directory have not changed. If they have changed, restore from the backup.

    Network File System

    Oracle Solaris and Linux

    If the file system is a share on another host, mount it again.

    If the file system is shared by the host and it was destroyed by the operating system upgrade, recreate the share and restore the content from the backup.

    Ensure the mount point is in the same location as before the upgrade.

    iSCSI

    Linux

    No action is needed.

    Sun ZFS

    Linux

    No action is needed.

    Sun ZFS

    Oracle Solaris

    If the storage is a local ZFS pool on the host and it was destroyed by the operating system upgrade, recreate it and restore the content from the backup.

    If the storage is a local ZFS pool on the host and it was not destroyed by the operating system upgrade, verify that the contents of the directory have not changed. If they have changed, restore from the backup.

    For all other ZFS storage, no further action.

  8. Reconfigure the VirtualBox hosts for a desktop provider.

    This is needed to ensure that the credentials of the VirtualBox user, or that the SSL or SSH certificates, are up-to-date. See Section 8.8.1, “Reconfiguring an Oracle VM VirtualBox Host” for details.

  9. In Oracle VDI, enable the VirtualBox hosts to bring them out of maintenance mode.

  10. Reload the iSCSI or Sun ZFS storage configuration for the desktop provider.

    Required only for Oracle Linux desktop providers that use iSCSI or Sun ZFS storage. See Section 8.8.2, “Reloading iSCSI or Sun ZFS Storage Configuration on Oracle VM VirtualBox Hosts” for details.

4.1.5. Configuring the VRDP Port Range

When VirtualBox RDP (VRDP) protocol is selected as the desktop protocol, Oracle VDI makes connections to Oracle VM VirtualBox hosts on a range of ports between 49152 to 65534.

  • Use the vda settings-setprops command to configure the VRDP port range, as follows:

    #  /opt/SUNWvda/sbin/vda settings-setprops -p vbox.rdp.port.range="StartPort-EndPort"
    

    For example:

    #  /opt/SUNWvda/sbin/vda settings-setprops -p vbox.rdp.port.range="50000-60000"

4.1.6. Configuring the VirtualBox Host Memory Overhead

Oracle VDI balances the load between the VirtualBox hosts for a desktop provider based on the memory and CPU usage of the hosts. As part of the memory calculation, Oracle VDI reserves a percentage of the total memory for the host itself and this is known as the host memory overhead. By default, the host memory overhead is 5% of the total memory.

The host memory overhead is configurable. If you change the default setting, this affects all VirtualBox hosts. If you have hosts with differing amounts of memory, you should ensure that the host memory overhead you configure is sufficient for all hosts.

  • Use the vda settings-setprops command to configure the host memory overhead, as follows:

    #  /opt/SUNWvda/sbin/vda settings-setprops -p host.mem.overhead=percentage
    

    For example, to increase the host memory overhead to 10%:

    #  /opt/SUNWvda/sbin/vda settings-setprops -p host.mem.overhead=10