user_AdvancedTopics.xml revision 9c0076729ec8138e89ce8a6af9a772b68f1f8dc7
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For each system user, VirtualBox stores configuration data in the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync user's home directory, as per the conventions of the host operating
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync system:<itemizedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>On Windows, this is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>%HOMEDRIVE%%HOMEPATH%\.VirtualBox</computeroutput>;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync typically something like <computeroutput>C:\Documents and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Settings\Username\.VirtualBox</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>On Mac OS X, this is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>$HOME/Library/VirtualBox</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>On Unix-like systems (Linux, Solaris), this is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>$HOME/.VirtualBox</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox creates this configuration directory automatically, if
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync necessary. Optionally, you can supply an alternate configuration directory
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync by setting the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput><literal>VBOX_USER_HOME</literal></computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync environment variable. You can globally change some of the locations where
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox keeps extra configuration and data by selecting "Global
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync settings" from the "File" menu in the VirtualBox main window. Then, in the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync window that pops up, click on the "General" tab.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox stores all its global and machine-specific configuration
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync data in XML documents. We intentionally do not document the specifications
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync of these files, as we must reserve the right to modify them in the future.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync We therefore strongly suggest that you do not edit these files manually.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox provides complete access to its configuration data through its
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the <computeroutput>VBoxManage</computeroutput> command line tool (see
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <xref linkend="vboxmanage" />) and its API (see <xref
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The XML files are versioned. When a new settings file is created
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (e.g. because a new virtual machine is created), VirtualBox automatically
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync uses the settings format of the current VirtualBox version. These files
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync may not be readable if you downgrade to an earlier version of VirtualBox.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync However, when VirtualBox encounters a settings file from an earlier
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync version (e.g. after upgrading VirtualBox), it attempts to preserve the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync settings format as much as possible. It will only silently upgrade the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync settings format if the current settings cannot be expressed in the old
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync format, for example because you enabled a feature that was not present in
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync an earlier version of VirtualBox.<footnote>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>As an example, before VirtualBox 3.1, it was only possible to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync enable or disable a single DVD drive in a virtual machine. If it was
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync enabled, then it would always be visible as the secondary master of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the IDE controller. With VirtualBox 3.1, DVD drives can be attached to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync arbitrary slots of arbitrary controllers, so they could be the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync secondary slave of an IDE controller or in a SATA slot. If you have a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync machine settings file from an earlier version and upgrade VirtualBox
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to 3.1 and then move the DVD drive from its default position, this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync cannot be expressed in the old settings format; the XML machine file
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync would get written in the new format, and a backup file of the old
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync format would be kept.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </footnote> In such cases, VirtualBox backs up the old settings file in
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the virtual machine's configuration directory. If you need to go back to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the earlier version of VirtualBox, then you will need to manually copy
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync these backup files back.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In detail, the following settings files are in use:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In the configuration directory,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VirtualBox.xml</computeroutput> is the main
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync configuration file. This includes global configuration options and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the media and virtual machine registry. The media registry links to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync all CD/DVD, floppy and disk images that have been added to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Virtual Media Manager. For each registered VM, there is one entry
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync which points to the VM configuration file, also in XML
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync format.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Virtual machine settings and files are, by default, saved as
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync XML files in a subdirectory of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>Machines</computeroutput> directory, which
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox creates under the main configuration directory (see
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync above). You can change the location of this main "Machines" folder
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync in the "Global settings" dialog.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>By default, for each virtual machine, VirtualBox uses another
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync subdirectory of the "Machines" directory that carries the same name
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync as the virtual machine. As a result, your virtual machine names must
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync conform to the conventions of your operating system for valid file
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync names. For example, a machine called "Fedora 6" would, by default,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync have its settings saved in
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>.VirtualBox/Machines/Fedora 6/Fedora
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 6.xml</computeroutput> (on a Linux or Solaris host).</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>If you would like more control over the file names used, you
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync can create the machine using <computeroutput>VBoxManage
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync createvm</computeroutput> with the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>--settingsfile</computeroutput> option; see <xref
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The virtual machine directory will be renamed if you change
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the machine name. If you do not wish this to happen, you can create
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the machine using <computeroutput>VBoxManage
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync createvm</computeroutput> with the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>--basefolder</computeroutput> option. In this case,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the folder name will never change.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox keeps snapshots and saved states in another special
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync folder for each virtual machine. By default, this is a subfolder of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the virtual machine folder called
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>Snapshots</computeroutput> -- in our example,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 6/Snapshots</computeroutput>. You can change this setting for each
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync machine using <computeroutput>VBoxManage</computeroutput> as
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync well.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VDI container files are, by default, created in the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>HardDisks</computeroutput> directory under the main
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync configuration directory (see above). In particular, this directory
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is used when the "Create new virtual disk" wizard is started to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync create a new VDI file. Changing this default is probably most useful
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if the disk containing your home directory does not have enough room
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to hold your VDI files, which can grow very large.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>VBoxSDL, the simplified VM displayer</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VBoxSDL is a simple graphical user interface (GUI) that lacks the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync nice point-and-click support which VirtualBox, our main GUI, provides.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VBoxSDL is currently primarily used internally for debugging VirtualBox
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync and therefore not officially supported. Still, you may find it useful
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for environments where the virtual machines are not necessarily
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync controlled by the same person that uses the virtual machine.<note>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VBoxSDL is not available on the Mac OS X host platform.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>As you can see in the following screenshot, VBoxSDL does indeed
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync only provide a simple window that contains only the "pure" virtual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync machine, without menus or other controls to click upon and no additional
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync indicators of virtual machine activity:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <imageobject>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <imagedata align="center" fileref="images/vbox-sdl.png"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync width="10cm" />
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </imageobject>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To start a virtual machine with VBoxSDL instead of the VirtualBox
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync GUI, enter the following on a command line:<screen>VBoxSDL --startvm <vm></screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>where <computeroutput><vm></computeroutput> is, as usual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with VirtualBox command line parameters, the name or UUID of an existing
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync virtual machine.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>When running guest operating systems in fullscreen mode, the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync operating system usually has control over the whole screen. This could
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync present a security risk as the guest operating system might fool the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync user into thinking that it is either a different system (which might
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync have a higher security level) or it might present messages on the screen
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync that appear to stem from the host operating system.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In order to protect the user against the above mentioned security
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync risks, the secure labeling feature has been developed. Secure labeling
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is currently available only for VBoxSDL. When enabled, a portion of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync display area is reserved for a label in which a user defined message is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync displayed. The label height in set to 20 pixels in VBoxSDL. The label
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync font color and background color can be optionally set as hexadecimal RGB
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync color values. The following syntax is used to enable secure
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync labeling:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>VBoxSDL --startvm "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync --seclabelsiz 14 --seclabelfgcol 00FF00 --seclabelbgcol 00FFFF</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In addition to enabling secure labeling, a TrueType font has to be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync supplied. To use another font size than 12 point use the parameter
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>--seclabelsiz</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The label text can be set with <screen>VBoxManage setextradata "VM name" "VBoxSDL/SecureLabel" "The Label"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Changing this label will take effect immediately.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Typically, full screen resolutions are limited to certain
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "standard" geometries such as 1024 x 768. Increasing this by twenty
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync lines is not usually feasible, so in most cases, VBoxSDL will chose the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync next higher resolution, e.g. 1280 x 1024 and the guest's screen will not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync cover the whole display surface. If VBoxSDL is unable to choose a higher
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync resolution, the secure label will be painted on top of the guest's
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync screen surface. In order to address the problem of the bottom part of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the guest screen being hidden, VBoxSDL can provide custom video modes to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the guest that are reduced by the height of the label. For Windows
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guests and recent Solaris and Linux guests, the VirtualBox Guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Additions automatically provide the reduced video modes. Additionally,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the VESA BIOS has been adjusted to duplicate its standard mode table
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with adjusted resolutions. The adjusted mode IDs can be calculated using
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the following formula:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For example, in order to start Linux with 1024 x 748 x 16, the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync standard mode 0x117 (1024 x 768 x 16) is used as a base. The Linux video
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync mode kernel parameter can then be calculated using:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>vga = 0x200 | 0x117 + 0x30
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvga = 839</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The reason for duplicating the standard modes instead of only
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync supplying the adjusted modes is that most guest operating systems
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync require the standard VESA modes to be fixed and refuse to start with
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync different modes.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>When using the X.org VESA driver, custom modelines have to be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync calculated and added to the configuration (usually in
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <literal>/etc/X11/xorg.conf</literal>. A handy tool to determine
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync url="http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html">http://www.tkk.fi/Misc/Electronics/faq/vga2rgb/calc.html</ulink></literal>.)</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Releasing modifiers with VBoxSDL on Linux</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>When switching from a X virtual terminal (VT) to another VT using
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Ctrl-Alt-Fx while the VBoxSDL window has the input focus, the guest will
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync receive Ctrl and Alt keypress events without receiving the corresponding
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync key release events. This is an architectural limitation of Linux. In
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync order to reset the modifier keys, it is possible to send
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>SIGUSR1</computeroutput> to the VBoxSDL main thread
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (first entry in the <computeroutput>ps</computeroutput> list). For
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync example, when switching away to another VT and saving the virtual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync machine from this terminal, the following sequence can be used to make
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync sure the VM is not saved with stuck modifiers:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncVBoxManage controlvm "Windows 2000" savestate</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title id="autologon">Automated guest logons</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox provides Guest Addition modules for Windows, Linux and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Solaris to enable automated logons on the guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>When a guest operating system is running in a virtual machine, it
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync might be desirable to perform coordinated and automated logons using
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync credentials from a master logon system. (With "credentials", we are
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync referring to logon information consisting of user name, password and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync domain name, where each value might be empty.)</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Since Windows NT, Windows has provided a modular system logon
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync subsystem ("Winlogon") which can be customized and extended by means of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync so-called GINA modules (Graphical Identification and Authentication).
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync With Windows Vista and Windows 7, the GINA modules were replaced with a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync new mechanism called "credential providers". The VirtualBox Guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Additions for Windows come with both, a GINA and a credential provider
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync module, and therefore enable any Windows guest to perform automated
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync logons.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To activate the VirtualBox GINA or credential provider module,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync install the Guest Additions with using the command line switch
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/with_autologon</computeroutput>. All the following
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync manual steps required for installing these modules will be then done by
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the installer.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To manually install the VirtualBox GINA module, extract the Guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Additions (see <xref linkend="windows-guest-file-extraction" />) and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync copy the file <computeroutput>VBoxGINA.dll</computeroutput> to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Windows <computeroutput>SYSTEM32</computeroutput> directory. Then, in
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync the registry, create the following key: <screen>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GinaDLL</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with a value of <computeroutput>VBoxGINA.dll</computeroutput>.</para>
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync The VirtualBox GINA is implemented as a wrapper around the standard Windows
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync GINA (<computeroutput>MSGINA.DLL</computeroutput>),
fbac0da11344b078c8df6e338e0493dccc279198vboxsync therefore it will most likely not work correctly with 3rd party GINA modules.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To manually install the VirtualBox credential module, extract the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Guest Additions (see <xref linkend="windows-guest-file-extraction" />)
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync and copy the file <computeroutput>VBoxCredProv.dll</computeroutput> to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the Windows <computeroutput>SYSTEM32</computeroutput> directory. Then,
dbabcd810984fc0731edff08eb281f0907dc867avboxsync in the registry, create the following keys:<screen>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Authentication\Credential Providers\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsyncHKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsyncHKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>with all default values (the key named
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>(Default)</computeroutput> in each key) set to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VBoxCredProv</computeroutput>. After that a new string
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync named <screen>HKEY_CLASSES_ROOT\CLSID\{275D3BCC-22BB-4948-A7F6-3A3054EBA92B}\InprocServer32\ThreadingModel</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with a value of <computeroutput>Apartment</computeroutput> has to be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync created.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To set credentials, use the following command on a
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage controlvm "Windows XP" setcredentials "John Doe" "secretpassword" "DOMTEST"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>While the VM is running, the credentials can be queried by the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox logon modules (GINA or credential provider) using the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox Guest Additions device driver. When Windows is in "logged
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync out" mode, the logon modules will constantly poll for credentials and if
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync they are present, a logon will be attempted. After retrieving the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync credentials, the logon modules will erase them so that the above command
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync will have to be repeated for subsequent logons.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For security reasons, credentials are not stored in any persistent
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync manner and will be lost when the VM is reset. Also, the credentials are
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "write-only", i.e. there is no way to retrieve the credentials from the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync host side. Credentials can be reset from the host side by setting empty
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync values.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Depending on the particular variant of the Windows guest, the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync following restrictions apply: <orderedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For <emphasis role="bold">Windows XP guests,</emphasis> the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync logon subsystem needs to be configured to use the classic logon
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync dialog as the VirtualBox GINA module does not support the XP-style
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync welcome dialog.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For <emphasis role="bold">Windows Vista and Windows 7
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guests,</emphasis> the logon subsystem does not support the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync so-called Secure Attention Sequence
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (<computeroutput>CTRL+ALT+DEL</computeroutput>). As a result, the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest's group policy settings need to be changed to not use the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Secure Attention Sequence. Also, the user name given is only
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync compared to the true user name, not the user friendly name. This
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync means that when you rename a user, you still have to supply the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync original user name (internally, Windows never renames user
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync accounts).</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The following command forces VirtualBox to keep the credentials
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync after they were read by the guest and on VM reset: <screen>VBoxManage setextradata "Windows XP" VBoxInternal/Devices/VMMDev/0/Config/KeepCredentials 1</screen>Note
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync that this is a potential security risk as a malicious application
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync running on the guest could request this information using the proper
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Starting with version 3.2, VirtualBox provides a custom PAM module
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (Pluggable Authentication Module) which can be used to perform automated
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest logons on platforms which support this framework. Virtually all
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync modern Linux/Unix distributions rely on PAM.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The <computeroutput>pam_vbox.so</computeroutput> module itself
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <emphasis role="bold">does not</emphasis> do an actual verification of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the credentials passed to the guest OS; instead it relies on other
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync modules such as <computeroutput>pam_unix.so</computeroutput> or
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_unix2.so</computeroutput> down in the PAM stack to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync do the actual validation using the credentials retrieved by
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_vbox.so</computeroutput>. Therefore
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_vbox.so</computeroutput> has to be on top of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync authentication PAM service list.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The <computeroutput>pam_vbox.so</computeroutput> only supports
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the <computeroutput>auth</computeroutput> primitive. Other primitives
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>password</computeroutput> are not supported.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The <computeroutput>pam_vbox.so</computeroutput> module is shipped
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync as part of the Guest Additions but it is not installed and/or activated
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync on the guest OS by default. In order to install it, it has to be copied
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/opt/VBoxGuestAdditions-<version>/lib/VBoxGuestAdditions/</computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to the security modules directory, usually
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/lib/security/</computeroutput>. Please refer to your
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest OS documentation for the correct PAM module directory.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For example, to use <computeroutput>pam_vbox.so</computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with a Ubuntu Linux guest OS and GDM (the GNOME Desktop Manager) to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync logon users automatically with the credentials passed by the host, the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest OS has to be configured like the following:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <orderedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The <computeroutput>pam_vbox.so</computeroutput> module has to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync be copied to the security modules directory, in this case it is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/lib/security</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Edit the PAM configuration file for GDM found at
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/etc/pam.d/gdm</computeroutput>, adding the line
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>auth requisite pam_vbox.so</computeroutput> at the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync top. Additionaly, in most Linux distributions there is a file called
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/etc/pam.d/common-auth</computeroutput>. This file
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is included in many other services (like the GDM file mentioned
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync above). There you also have to add add the line <computeroutput>auth
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>If authentication against the shadow database using
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_unix2.so</computeroutput> is desired, the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync argument <computeroutput>try_first_pass</computeroutput> is needed
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync in order to pass the credentials from the VirtualBox module to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync shadow database authentication module. For Ubuntu, this needs to be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync added to <computeroutput>/etc/pam.d/common-auth</computeroutput>, to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the end of the line referencing
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_unix.so</computeroutput>. This argument tells
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the PAM module to use credentials already present in the stack, i.e.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the ones provided by the VirtualBox PAM module.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </orderedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>An incorrectly configured PAM stack can effectively prevent
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync you from logging into your guest system!</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To make deployment easier, you can pass the argument
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>debug</computeroutput> right after the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>pam_vbox.so</computeroutput> statement. Debug log output
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync will then be recorded using syslog.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>At present, the GDM display manager only retrieves credentials
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync at startup so unless the credentials have been supplied to the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync before GDM starts, automatic logon will not work. This limitation
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync needs to be addressed by the GDM developers or another display
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync manager must be used.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Advanced configuration for Windows guests</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Automated Windows system preparation</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Beginning with Windows NT 4.0, Microsoft offers a "system
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync preparation" tool (in short: Sysprep) to prepare a Windows system for
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync deployment or redistribution. Whereas Windows 2000 and XP ship with
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Sysprep on the installation medium, the tool also is available for
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync download on the Microsoft web site. In a standard installation of
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Windows Vista and 7, Sysprep is already included. Sysprep mainly
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync consists of an executable called
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <computeroutput>sysprep.exe</computeroutput> which is invoked by the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync user to put the Windows installation into preparation mode.</para>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>Starting with VirtualBox 3.2.2, the Guest Additions offer a way to
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync launch a system preparation on the guest operating system in an
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync automated way, controlled from the host system. To achieve that, see
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <xref linkend="guestadd-guestcontrol" /> for using the feature with the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync special identifier <computeroutput>sysprep</computeroutput> as the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync program to execute, along with the user name
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <computeroutput>sysprep</computeroutput> and password
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <computeroutput>sysprep</computeroutput> for the credentials. Sysprep
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync then gets launched with the required system rights.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Specifying the location of "sysprep.exe" is <emphasis
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync role="bold">not possible</emphasis> -- instead the following paths are
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync used (based on the operating system): <itemizedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><computeroutput>C:\sysprep\sysprep.exe</computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for Windows NT 4.0, 2000 and XP</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><computeroutput>%WINDIR%\System32\Sysprep\sysprep.exe</computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for Windows Vista, 2008 Server and 7</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync </itemizedlist> The Guest Additions will automatically use the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync appropriate path to execute the system preparation tool.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>With virtual machines running modern server operating systems,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox supports CPU hot-plugging.<footnote>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Support for CPU hot-plugging was introduced with VirtualBox
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 3.2.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </footnote> Whereas on a physical computer this would mean that a CPU
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync can be added or removed while the machine is running, VirtualBox supports
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync adding and removing virtual CPUs while a virtual machine is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync running.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>CPU hot-plugging works only with guest operating systems that
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync support it. So far this applies only to Linux and Windows Server 2008 x64
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Data Center Edition. Windows supports only hot-add while Linux supports
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync hot-add and hot-remove but to use this feature with more than 8 CPUs a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 64bit Linux guest is required.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>At this time, CPU hot-plugging requires using the VBoxManage
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync command-line interface. First, hot-plugging needs to be enabled for a
dbabcd810984fc0731edff08eb281f0907dc867avboxsync virtual machine:<screen>VBoxManage modifyvm "VM name" --cpuhotplug on</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>After that, the --cpus option specifies the maximum number of CPUs
dbabcd810984fc0731edff08eb281f0907dc867avboxsync that the virtual machine can have:<screen>VBoxManage modifyvm "VM name" --cpus 8</screen>When
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the VM is off, you can then add and remove virtual CPUs with the modifyvm
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync --plugcpu and --unplugcpu subcommands, which take the number of the
dbabcd810984fc0731edff08eb281f0907dc867avboxsync virtual CPU as a parameter, like this:<screen>VBoxManage modifyvm "VM name" --plugcpu 3
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsyncVBoxManage modifyvm "VM name" --unplugcpu 3</screen>Note that CPU 0 can never
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync be removed.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>While the VM is running, CPUs can be added with the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>controlvm plugcpu/unplugcpu</computeroutput> commands
dbabcd810984fc0731edff08eb281f0907dc867avboxsync instead:<screen>VBoxManage controlvm "VM name" plugcpu 3
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage controlvm "VM name" unplugcpu 3</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>See <xref linkend="vboxmanage-modifyvm" /> and <xref
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync linkend="vboxmanage-controlvm" /> for details.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>With Linux guests, the following applies: To prevent ejection while
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the CPU is still used it has to be ejected from within the guest before.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync The Linux Guest Additions contain a service which receives hot-remove
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync events and ejects the CPU. Also, after a CPU is added to the VM it is not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync automatically used by Linux. The Linux Guest Additions service will take
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync care of that if installed. If not a CPU can be started with the following
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync command:<screen>echo 1 > /sys/devices/system/cpu/cpu<id>/online</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Apart from the standard VESA resolutions, the VirtualBox VESA BIOS
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync allows you to add up to 16 custom video modes which will be reported to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the guest operating system. When using Windows guests with the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox Guest Additions, a custom graphics driver will be used
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync instead of the fallback VESA solution so this information does not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync apply.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Additional video modes can be configured for each VM using the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync extra data facility. The extra data key is called
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <literal>CustomVideoMode<x></literal> with <literal>x</literal>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync being a number from 1 to 16. Please note that modes will be read from 1
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync until either the following number is not defined or 16 is reached. The
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync following example adds a video mode that corresponds to the native
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync display resolution of many notebook computers:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The VESA mode IDs for custom video modes start at
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <literal>0x160</literal>. In order to use the above defined custom video
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync mode, the following command line has be supplied to Linux:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>vga = 0x200 | 0x160
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncvga = 864</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For guest operating systems with VirtualBox Guest Additions, a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync custom video mode can be set using the video mode hint feature.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the maximum resolution of guests when using the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync graphical frontend</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>When guest systems with the Guest Additions installed are started
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync using the graphical frontend (the normal VirtualBox application), they
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync will not be allowed to use screen resolutions greater than the host's
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync screen size unless the user manually resizes them by dragging the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync window, switching to fullscreen or seamless mode or sending a video mode
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync hint using VBoxManage. This behavior is what most users will want, but
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync if you have different needs, it is possible to change it by issuing one
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync of the following commands from the command line:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>VBoxManage setextradata global GUI/MaxGuestResolution any</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>will remove all limits on guest resolutions.</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata global GUI/MaxGuestResolution >width,height<</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>manually specifies a maximum resolution.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>VBoxManage setextradata global GUI/MaxGuestResolution auto</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>restores the default settings. Note that these settings apply
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync globally to all guest systems, not just to a single machine.</para>
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync <title>Custom external authentication modules</title>
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync <para>As described in <xref linkend="vbox-auth" />, VirtualBox supports
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync arbitrary external modules to perform authentication. When the
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync authentication method is set to "external" for a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync particular VM, VirtualBox calls the library that was specified with
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VBoxManage setproperty vrdpauthlibrary</computeroutput>.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync This library will be loaded by the VM process on demand, i.e. when the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync first RDP connection is made by an external client.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>External authentication is the most flexible as the external
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync handler can both choose to grant access to everyone (like the "null"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync authentication method would) and delegate the request to the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync authentication component. When delegating the request to the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync component, it will still be called afterwards with the option to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync override the result.</para>
9c0076729ec8138e89ce8a6af9a772b68f1f8dc7vboxsync <para>An authentication library is required to implement exactly one
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync entry point:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * Authentication library entry point. Decides whether to allow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * a client connection.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * Parameters:
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * pUuid Pointer to the UUID of the virtual machine
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * which the client connected to.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * guestJudgement Result of the guest authentication.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * szUser User name passed in by the client (UTF8).
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * szPassword Password passed in by the client (UTF8).
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * szDomain Domain passed in by the client (UTF8).
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * fLogon Boolean flag. Indicates whether the entry point is called
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * for a client logon or the client disconnect.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * clientId Server side unique identifier of the client.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * Return code:
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * VRDPAuthAccessDenied Client access has been denied.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * VRDPAuthAccessGranted Client has the right to use the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * virtual machine.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * VRDPAuthDelegateToGuest Guest operating system must
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * authenticate the client and the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * library must be called again with
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * the result of the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync * authentication.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncVRDPAuthResult VRDPAUTHCALL VRDPAuth2(
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync PVRDPAUTHUUID pUuid,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VRDPAuthGuestJudgement guestJudgement,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync const char *szUser,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync const char *szPassword
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync const char *szDomain
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync int fLogon,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync unsigned clientId)
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync /* process request against your authentication source of choice */
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync return VRDPAuthAccessGranted;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>A note regarding the UUID implementation of the first argument:
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox uses a consistent binary representation of UUIDs on all
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync platforms. For this reason the integer fields comprising the UUID are
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync stored as little endian values. If you want to pass such UUIDs to code
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync which assumes that the integer fields are big endian (often also called
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync network byte order), you need to adjust the contents of the UUID to e.g.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync achieve the same string representation. The required changes
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync are:<itemizedlist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>reverse the order of byte 0, 1, 2 and 3</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </listitem>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </itemizedlist>Using this conversion you will get identical results
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync when converting the binary UUID to the string representation.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The second arguments contains information about the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync authentication status. For the first call, it is always set to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VRDPAuthGuestNotAsked</computeroutput>. In case the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync function returns
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VRDPAuthDelegateToGuest</computeroutput>, a guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync authentication will be attempted and another call to the method is made
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with its result. This can be either granted / denied or no judgement
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (the guest component chose for whatever reason to not make a decision).
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync In case there is a problem with the guest authentication module (e.g.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the Additions are not installed or not running or the guest did not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync respond within a timeout), the "not reacted" status will be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync returned.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Using a raw host hard disk from a guest</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Starting with version 1.4, as an alternative to using virtual disk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync images (as described in detail in <xref linkend="storage" />),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox can also present either entire physical hard disks or
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync selected partitions thereof as virtual disks to virtual machines.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>With VirtualBox, this type of access is called "raw hard disk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync access"; it allows a guest operating system to access its virtual hard
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disk without going through the host OS file system. The actual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync performance difference for image files vs. raw disk varies greatly
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync depending on the overhead of the host file system, whether dynamically
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync growing images are used and on host OS caching strategies. The caching
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync indirectly also affects other aspects such as failure behavior, i.e.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync whether the virtual disk contains all data written before a host OS
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync crash. Consult your host OS documentation for details on this.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Raw hard disk access is for expert users only. Incorrect use
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync or use of an outdated configuration can lead to <emphasis
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync role="bold">total loss of data </emphasis>on the physical disk. Most
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync importantly, <emphasis>do not</emphasis> attempt to boot the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync partition with the currently running host operating system in a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest. This will lead to severe data corruption.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Raw hard disk access -- both for entire disks and individual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync partitions -- is implemented as part of the VMDK image format support.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync As a result, you will need to create a special VMDK image file which
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync defines where the data will be stored. After creating such a special
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VMDK image, you can use it like a regular virtual disk image. For
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync example, you can use the Virtual Media Manager (<xref linkend="vdis" />)
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync or <computeroutput>VBoxManage</computeroutput> to assign the image to a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync virtual machine.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>While this variant is the simplest to set up, you must be aware
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync that this will give a guest operating system direct and full access to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync an <emphasis>entire physical disk</emphasis>. If your
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <emphasis>host</emphasis> operating system is also booted from this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disk, please take special care to not access the partition from the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest at all. On the positive side, the physical disk can be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync repartitioned in arbitrary ways without having to recreate the image
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync file that gives access to the raw disk.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To create an image that represents an entire physical hard disk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (which will not contain any actual data, as this will all be stored on
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the physical disk), on a Linux host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <code>/path/to/file.vmdk</code> (must be absolute), and all data will
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync be read and written from <code>/dev/sda</code>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>On a Windows host, instead of the above device specification,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync of the above device specification use e.g. <code>/dev/disk1</code>.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Note that on OS X you can only get access to an entire disk if no
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync volume is mounted from it.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Creating the image requires read/write access for the given
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync device. Read/write access is also later needed when using the image
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync from a virtual machine.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Just like with regular disk images, this does not automatically
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync register the newly created image in the internal registry of hard
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disks. If you want this done automatically, add
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <code>-register</code>: <screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync -rawdisk /dev/sda -register</screen>After registering, you can assign
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the newly created image to a virtual machine with e.g. <screen>VBoxManage storageattach WindowsXP --storagectl "IDE Controller"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync --port 0 --device 0 --type hdd --medium /path/to/file.vmdk</screen>When
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync this is done the selected virtual machine will boot from the specified
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync physical disk.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Access to individual physical hard disk partitions</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>This "raw partition support" is quite similar to the "full hard
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disk" access described above. However, in this case, any partitioning
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync information will be stored inside the VMDK image, so you can e.g.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync install a different boot loader in the virtual hard disk without
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync affecting the host's partitioning information. While the guest will be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync able to <emphasis>see</emphasis> all partitions that exist on the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync physical disk, access will be filtered in that reading from partitions
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for which no access is allowed the partitions will only yield zeroes,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync and all writes to them are ignored.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To create a special image for raw partition support (which will
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync contain a small amount of data, as already mentioned), on a Linux
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync host, use the command<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>As you can see, the command is identical to the one for "full
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync hard disk" access, except for the additional
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>-partitions</computeroutput> parameter. This example
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync would create the image <code>/path/to/file.vmdk</code> (which, again,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync must be absolute), and partitions 1 and 5 of <code>/dev/sda</code>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync would be made accessible to the guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox uses the same partition numbering as your Linux host.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync As a result, the numbers given in the above example would refer to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync first primary partition and the first logical drive in the extended
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync partition, respectively.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>On a Windows host, instead of the above device specification,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync use e.g. <code>\\.\PhysicalDrive0</code>. On a Mac OS X host, instead
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync of the above device specification use e.g. <code>/dev/disk1</code>.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Note that on OS X you can only use partitions which are not mounted
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync (eject the respective volume first). Partition numbers are the same on
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Linux, Windows and Mac OS X hosts.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The numbers for the list of partitions can be taken from the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync output of<screen>VBoxManage internalcommands listpartitions -rawdisk /dev/sda</screen>The
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync output lists the partition types and sizes to give the user enough
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync information to identify the partitions necessary for the guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Images which give access to individual partitions are specific
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to a particular host disk setup. You cannot transfer these images to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync another host; also, whenever the host partitioning changes, the image
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Creating the image requires read/write access for the given
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync device. Read/write access is also later needed when using the image
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync from a virtual machine. If this is not feasible, there is a special
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync variant for raw partition access (currently only available on Linux
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync hosts) that avoids having to give the current user access to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync entire disk. To set up such an image, use<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync -rawdisk /dev/sda -partitions 1,5 -relative</screen>When used from a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync virtual machine, the image will then refer not to the entire disk, but
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync only to the individual partitions (in the example
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <code>/dev/sda1</code> and <code>/dev/sda5</code>). As a consequence,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync read/write access is only required for the affected partitions, not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync for the entire disk. During creation however, read-only access to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync entire disk is required to obtain the partitioning information.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In some configurations it may be necessary to change the MBR
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync code of the created image, e.g. to replace the Linux boot loader that
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is used on the host by another boot loader. This allows e.g. the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to boot directly to Windows, while the host boots Linux from the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "same" disk. For this purpose the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>-mbr</computeroutput> parameter is provided. It
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync specifies a file name from which to take the MBR code. The partition
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync table is not modified at all, so a MBR file from a system with totally
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync different partitioning can be used. An example of this is<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync -rawdisk /dev/sda -partitions 1,5 -mbr winxp.mbr</screen>The modified
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync MBR will be stored inside the image, not on the host disk.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For each of the above variants, you can register the resulting
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync image for immediate use in VirtualBox by adding
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>-register</computeroutput> to the respective command
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync line. The image will then immediately appear in the list of registered
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disk images. An example is<screen>VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync -rawdisk /dev/sda -partitions 1,5 -relative -register</screen> which
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync creates an image referring to individual partitions, and registers it
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync when the image is successfully created.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the hard disk vendor product data (VPD)</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>VirtualBox reports vendor product data for its virtual hard disks
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync which consist of hard disk serial number, firmware revision and model
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync number. These can be changed using the following commands:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/SerialNumber" "serial"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/FirmwareRevision" "firmware"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/ModelNumber" "model"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The serial number is a 20 byte alphanumeric string, the firmware
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync revision an 8 byte alphanumeric string and the model number a 40 byte
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync alphanumeric string. Instead of "Port0" (referring to the first port),
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync specify the desired SATA hard disk port.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Additional three parameters are needed for CD/DVD drives to report
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the vendor product data:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIVendorId" "vendor"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIProductId" "product"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/ahci/0/Config/Port0/ATAPIRevision" "revision"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The vendor id is an 8 byte alphanumeric string, the product id an
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 16 byte alphanumeric string and the revision a 4 byte alphanumeric
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync string. Instead of "Port0" (referring to the first port), specify the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync desired SATA hard disk port.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Launching more than 120 VMs on Solaris hosts</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Solaris hosts have a fixed number of IPC semaphores IDs per process
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync preventing users from starting more than 120 VMs. While trying to launch
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync more VMs you would be shown a "Cannot create IPC semaphore" error.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In order to run more VMs, you will need to bump the semaphore ID
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync limit of the VBoxSVC process. Execute as root the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>prctl</computeroutput> command as shown below. The process
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ID of VBoxSVC can be obtained using the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>ps</computeroutput> list command.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><screen>prctl -r -n project.max-sem-ids -v 2048 <pid-of-VBoxSVC></screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Legacy commands for using serial ports</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Starting with version 1.4, VirtualBox provided support for virtual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync serial ports, which, at the time, was rather complicated to set up with a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync sequence of <computeroutput>VBoxManage setextradata</computeroutput>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync statements. Since version 1.5, that way of setting up serial ports is no
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync longer necessary and <emphasis>deprecated.</emphasis> To set up virtual
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync serial ports, use the methods now described in <xref
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For backwards compatibility, the old
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>setextradata</computeroutput> statements, whose
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync description is retained below from the old version of the manual, take
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <emphasis>precedence</emphasis> over the new way of configuring serial
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ports. As a result, if configuring serial ports the new way doesn't
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync work, make sure the VM in question does not have old configuration
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync data such as below still active.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The old sequence of configuring a serial port used the following 6
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync commands:</para><screen>VBoxManage setextradata "VM name"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/serial/0/Config/IOBase" 0x3f8
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Driver" NamedPipe
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/Location" "\\.\pipe\vboxCOM1"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync "VBoxInternal/Devices/serial/0/LUN#0/AttachedDriver/Config/IsServer" 1</screen>
304f31a2a37f5d690086bff2fb4a59228b4dbd40vboxsync <para>This sets up a serial port in the guest with the default
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync settings for COM1 (IRQ 4, I/O address 0x3f8) and the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>Location</computeroutput> setting assumes that this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync configuration is used on a Windows host, because the Windows named pipe
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync syntax is used. Keep in mind that on Windows hosts a named pipe must
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync always start with <computeroutput>\\.\pipe\</computeroutput>. On Linux the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync same config settings apply, except that the path name for the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>Location</computeroutput> can be chosen more freely. Local
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync domain sockets can be placed anywhere, provided the user running
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox has the permission to create a new file in the directory. The
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync final command above defines that VirtualBox acts as a server, i.e. it
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync creates the named pipe itself instead of connecting to an already existing
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync one.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Fine-tuning the VirtualBox NAT engine</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the address of a NAT network interface</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>In NAT mode, the guest network interface is assigned to the IPv4
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync range <computeroutput>10.0.x.0/24</computeroutput> by default where
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>x</computeroutput> corresponds to the instance of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync NAT interface +2. So <computeroutput>x</computeroutput> is 2 when there
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is only one NAT instance active. In that case the guest is assigned to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the address <computeroutput>10.0.2.15</computeroutput>, the gateway is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync set to <computeroutput>10.0.2.2</computeroutput> and the name server can
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync be found at <computeroutput>10.0.2.3</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>If, for any reason, the NAT network needs to be changed, this can
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync be achieved with the following command:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage modifyvm "VM name" --natnet1 "192.168/16"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>This command would reserve the network addresses from
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>192.168.254.254</computeroutput> for the first NAT
dbabcd810984fc0731edff08eb281f0907dc867avboxsync network instance of "VM name". The guest IP would be assigned to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>192.168.0.15</computeroutput> and the default gateway
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync could be found at <computeroutput>192.168.0.2</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the boot server (next server) of a NAT network
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For network booting in NAT mode, by default VirtualBox uses a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync built-in TFTP server at the IP address 10.0.2.3. This default behavior
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync should work fine for typical remote-booting scenarios. However, it is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync possible to change the boot server IP and the location of the boot image
dbabcd810984fc0731edff08eb281f0907dc867avboxsync with the following commands: <screen>VBoxManage modifyvm "VM name" --nattftpserver1 10.0.2.2
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage modifyvm "VM name" --nattftpfile1 /srv/tftp/boot/MyPXEBoot.pxe</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The VirtualBox NAT stack performance is often determined by its
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interaction with the host's TCP/IP stack and the size of several buffers
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>SO_SNDBUF</computeroutput>). For certain setups users
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync might want to adjust the buffer size for a better performance. This can
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync by achieved using the following commands (values are in kilobytes and
dbabcd810984fc0731edff08eb281f0907dc867avboxsync can range from 8 to 1024): <screen>VBoxManage modifyvm "VM name" --natsettings1 16000,128,128,0,0</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync This example illustrates tuning the NAT settings. The first parameter is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the MTU, then the size of the socket's send buffer and the size of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync socket's receive buffer, the initial size of the TCP send window, and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync lastly the initial size of the TCP receive window. Note that specifying
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync zero means fallback to the default value.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Each of these buffers has a default size of 64KB and default MTU
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is 1500.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Binding NAT sockets to a specific interface</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>By default, VirtualBox's NAT engine will route TCP/IP packets
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync through the default interface assigned by the host's TCP/IP stack. (The
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync technical reason for this is that the NAT engine uses sockets for
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync communication.) If, for some reason, you want to change this behavior,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync you can tell the NAT engine to bind to a particular IP address instead.
dbabcd810984fc0731edff08eb281f0907dc867avboxsync Use the following command: <screen>VBoxManage modifyvm "VM name" --natbindip1 "10.45.0.2"</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>After this, all outgoing traffic will be sent through the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface with the IP address 10.45.0.2. Please make sure that this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface is up and running prior to this assignment.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The NAT engine by default offers the same DNS servers to the guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync that are configured on the host. In some scenarios, it can be desirable
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to hide the DNS server IPs from the guest, for example when this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync information can change on the host due to expiring DHCP leases. In this
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync case, you can tell the NAT engine to act as DNS proxy using the
dbabcd810984fc0731edff08eb281f0907dc867avboxsync following command: <screen>VBoxManage modifyvm "VM name" --natdnsproxy1 on</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Using the host's resolver as a DNS proxy in NAT mode</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For resolving network names, the DHCP server of the NAT engine
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync offers a list of registered DNS servers of the host. If for some reason
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync you need to hide this DNS server list and use the host's resolver
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync settings, thereby forcing the VirtualBox NAT engine to intercept DNS
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync requests and forward them to host's resolver, use the following command:
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage modifyvm "VM name" --natdnshostresolver1 on</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Note that this setting is similar to the DNS proxy mode, however whereas
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the proxy mode just forwards DNS requests to the appropriate servers,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the resolver mode will interpret the DNS requests and use the host's DNS
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync API to query the information and return it to the guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring aliasing of the NAT engine</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>By default, the NAT core uses aliasing and uses random ports when
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync generating an alias for a connection. This works well for the most
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync protocols like SSH, FTP and so on. Though some protocols might need a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync more transparent behavior or may depend on the real port number the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync packet was sent from. It is possible to change the NAT mode via the
dbabcd810984fc0731edff08eb281f0907dc867avboxsync VBoxManage frontend with the following commands: <screen>VBoxManage modifyvm "VM name" --nataliasmode proxyonly</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync and <screen>VBoxManage modifyvm "Linux Guest" --nataliasmode sameports</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync The first example disables aliasing and switches NAT into transparent
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync mode, the second example enforces preserving of port values. These modes
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync can be combined if necessary.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the BIOS DMI information</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The DMI data VirtualBox provides to guests can be changed for a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync specific VM. Use the following commands to configure the DMI BIOS
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync information:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "BIOS Vendor"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "BIOS Version"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseDate" "BIOS Release Date"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMajor" 1
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSReleaseMinor" 2
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMajor" 3
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSFirmwareMinor" 4
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "System Vendor"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "System Product"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "System Version"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "System Serial"
434521f20688750b48498b6cabbc7d109d053942vboxsyncVBoxManage setextradata "VM name"
434521f20688750b48498b6cabbc7d109d053942vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSKU" "System SKU"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemFamily" "System Family"
dbabcd810984fc0731edff08eb281f0907dc867avboxsyncVBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "9852bf98-b83c-49db-a8de-182c42c7226b"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>If a DMI string is not set, the default value of VirtualBox is used.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync To set an empty string use
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>"<EMPTY>"</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Note that in the above list, all quoted parameters (DmiBIOSVendor,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync DmiBIOSVersion but not DmiBIOSReleaseMajor) are expected to be strings. If
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync such a string is a valid number, the parameter is treated as number and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the VM will most probably refuse to start with an
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>VERR_CFGM_NOT_STRING</computeroutput> error. In that case,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync use <computeroutput>"string:<value>"</computeroutput>, for instance
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name"
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "string:1234"</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Changing this information can be necessary to provide the DMI
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync information of the host to the guest to prevent Windows from asking for a
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync new product key. On Linux hosts the DMI BIOS information can be obtained
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with <screen>dmidecode -t0</screen>and the DMI system information can be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync obtained with <screen>dmidecode -t1</screen></para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Fine-tuning timers and time synchronization</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring the guest time stamp counter (TSC) to reflect guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync execution</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>By default, VirtualBox keeps all sources of time visible to the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest synchronized to a single time source, the monotonic host time.
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync This reflects the assumptions of many guest operating systems, which
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync expect all time sources to reflect "wall clock" time. In special
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync circumstances it may be useful however to make the TSC (time stamp
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync counter) in the guest reflect the time actually spent executing the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>This special TSC handling mode can be enabled on a per-VM basis,
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync and for best results must be used only in combination with hardware
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync virtualization. To enable this mode use the following command:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution" 1</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To revert to the default TSC handling mode use:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/TSCTiedToExecution"</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Note that if you use the special TSC handling mode with a guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync operating system which is very strict about the consistency of time
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync sources you may get a warning or error message about the timing
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync inconsistency. It may also cause clocks to become unreliable with some
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest operating systems depending on they use the TSC.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Accelerate or slow down the guest clock</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>For certain purposes it can be useful to accelerate or to slow
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync down the (virtual) guest clock. This can be achieved as follows:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 200</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The above example will double the speed of the guest clock
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync while</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <screen>VBoxManage setextradata "VM name" "VBoxInternal/TM/WarpDrivePercentage" 50</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>will halve the speed of the guest clock. Note that changing the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync rate of the virtual clock can confuse the guest and can even lead to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync abnormal guest behavior. For instance, a higher clock rate means shorter
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync timeouts for virtual devices with the result that a slightly increased
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync response time of a virtual device due to an increased host load can
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync cause guest failures. Note further that any time synchronization
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync mechanism will frequently try to resynchronize the guest clock with the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync reference clock (which is the host clock if the VirtualBox Guest
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync Additions are active). Therefore any time synchronization should be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync disabled if the rate of the guest clock is changed as described above
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Tuning the Guest Additions time synchronization
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync parameters</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The VirtualBox Guest Additions ensure that the guest's system time
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync is synchronized with the host time. There are several parameters which
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync can be tuned. The parameters can be set for a specific VM using the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync following command:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <screen>VBoxManage guestproperty set VM_NAME "/VirtualBox/GuestAdd/VBoxService/PARAMETER" VALUE</screen>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>where <computeroutput>PARAMETER</computeroutput> is one of the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync following:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-interval</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Specifies the interval at which to synchronize the time
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync with the host. The default is 10000 ms (10 seconds).</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-min-adjust</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The minimum absolute drift value measured in milliseconds
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to make adjustments for. The default is 1000 ms on OS/2 and 100
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync ms elsewhere.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-latency-factor</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The factor to multiply the time query latency with to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync calculate the dynamic minimum adjust time. The default is 8
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync times, that means in detail: Measure the time it takes to
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync determine the host time (the guest has to contact the VM host
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync service which may take some time), multiply this value by 8 and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync do an adjustment only if the time difference between host and
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync guest is bigger than this value. Don't do any time adjustment
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync otherwise.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-max-latency</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The max host timer query latency to accept. The default is
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 250 ms.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-set-threshold</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The absolute drift threshold, given as milliseconds where
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to start setting the time instead of trying to smoothly adjust
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync it. The default is 20 minutes.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>--timesync-set-start</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Set the time when starting the time sync service.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync </glossentry>
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync <glossentry>
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync <glossterm><computeroutput>--timesync-set-on-restore 0|1</computeroutput></glossterm>
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync <para>Set the time after the VM was restored from a saved state
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync when passing 1 as parameter (default). Disable by passing 0.
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync In the latter case, the time will be adjusted smoothly which
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync can take a long time.</para>
82ec021964a07a8f01bb7d741ce1d8150171bc8avboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>All these parameters can be specified as command line parameters
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync to VBoxService as well.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <title>Configuring multiple host-only network interfaces on Solaris
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync hosts</title>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>By default VirtualBox provides you with one host-only network
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface. Adding more host-only network interfaces on Solaris hosts
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync requires manual configuration. Here's how to add two more host-only
f18058e02cae9f7c273861c00bfb3793659ffafevboxsync network interfaces.</para>
f18058e02cae9f7c273861c00bfb3793659ffafevboxsync <para>You first need to stop all running VMs and unplumb all existing
f18058e02cae9f7c273861c00bfb3793659ffafevboxsync "vboxnet" interfaces. Execute the following commands as root:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Once you make sure all vboxnet interfaces are unplumbed, remove the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync driver using:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><screen>rem_drv vboxnet</screen>then edit the file
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/platform/i86pc/kernel/drv/vboxnet.conf</computeroutput>
f18058e02cae9f7c273861c00bfb3793659ffafevboxsync and add a line for the new interfaces:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><screen>name="vboxnet" parent="pseudo" instance=1;
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsyncname="vboxnet" parent="pseudo" instance=2;</screen>Add as many of these lines
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync as required and make sure "instance" number is uniquely incremented. Next
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync reload the vboxnet driver using:</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para><screen>add_drv vboxnet</screen>Now plumb all the interfaces using
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>ifconfig vboxnetX plumb</computeroutput> (where X can be
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync 0, 1 or 2 in this case) and once plumbed you can then configure the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync interface like any other network interface.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>To make your newly added interfaces' settings persistent across
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync reboots you will need to edit the files
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/etc/netmasks</computeroutput>, and if you are using NWAM
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <computeroutput>/etc/nwam/llp</computeroutput> and add the appropriate
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync entries to set the netmask and static IP for each of those interfaces. The
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync VirtualBox installer only updates these configuration files for the one
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync "vboxnet0" interface it creates by default.</para>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <title>Configuring VirtualBox CoreDumper on Solaris hosts</title>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <para>VirtualBox is capable of producing its own core files when things go
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync wrong and for more extensive debugging. Currently this is only available
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync on Solaris hosts.</para>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <para>The VirtualBox CoreDumper can be enabled using the following
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync command:</para>
fbac0da11344b078c8df6e338e0493dccc279198vboxsync <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpEnabled 1</screen></para>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <para>You can specify which directory to use for core dumps with this
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync command:</para>
fbac0da11344b078c8df6e338e0493dccc279198vboxsync <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpDir <path-to-directory></screen>Make
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync sure the directory you specify is on a volume with sufficient free space
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync and that the VirtualBox process has sufficient permissions to write files
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync to this directory. If you skip this command and don't specify any core
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync dump directory, the current directory of the VirtualBox executable will be
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync used (which would most likely fail when writing cores as they are
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync protected with root permissions). It is recommended you explicity set a
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync core dump directory.</para>
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync <para>You must specify when the VirtualBox CoreDumper should be triggered.
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync This is done using the following commands:</para>
fbac0da11344b078c8df6e338e0493dccc279198vboxsync <para><screen>VBoxManage setextradata "VM name" VBoxInternal2/CoreDumpReplaceSystemDump 1
fbac0da11344b078c8df6e338e0493dccc279198vboxsyncVBoxManage setextradata "VM name" VBoxInternal2/CoreDumpLive 1</screen>At
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync least one of the above two commands will have to be provided if you have
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync enabled the VirtualBox CoreDumper.</para>
fbac0da11344b078c8df6e338e0493dccc279198vboxsync <para>Setting <computeroutput>CoreDumpReplaceSystemDump</computeroutput>
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync sets up the VM to override the host's core dumping mechanism and in the
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync event of any crash only the VirtualBox CoreDumper would produce the core
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync file.</para>
fbac0da11344b078c8df6e338e0493dccc279198vboxsync <para>Setting <computeroutput>CoreDumpLive</computeroutput> sets up the VM
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync to produce cores whenever the VM receives a
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <computeroutput>SIGUSR2</computeroutput> signal. After producing the core
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync file, the VM will not be terminated and will continue to run. You can then
a2e827cf7080bb70bfa39f5fdf85b04145b53204vboxsync take cores of the VM process using:</para>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <para><screen>kill -s SIGUSR2 <VM-process-id></screen></para>
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <para>Core files produced by the VirtualBox CoreDumper are of the form
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync <computeroutput>core.vb.<ProcessName>.<ProcessID></computeroutput>,
9864317785d3ad19e5f4fd6d328858d71c9d474cvboxsync e.g.<computeroutput>core.vb.VBoxHeadless.11321</computeroutput>.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>There are several advanced customization settings for locking down
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync the GUI, that is, removing some features that the user should not
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync see.<screen>VBoxManage setextradata global GUI/Customizations OPTION[,OPTION...]</screen></para>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>where <computeroutput>OPTION</computeroutput> is one of the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync following keywords:<glosslist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>noSelector</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Don't allow to start the VM selector GUI. Trying to do so
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync will show a window containing a proper error message.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>noMenuBar</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The VM windows will not contain a menu bar.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>noStatusBar</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>The VM windows will not contain a status bar.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>To disable any GUI customization do <screen>VBoxManage setextradata global GUI/Customizations</screen></para>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>To disable all host key combinations, open the global settings and
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync change the host key to <emphasis>None</emphasis>. This might be useful
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync when using VirtualBox in a kiosk mode.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Furthermore, you can disallow certain actions when terminating a VM
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync from the GUI. To disallow specific actions, type:</para>
dbabcd810984fc0731edff08eb281f0907dc867avboxsync <para><screen>VBoxManage setextradata "VM name" GUI/RestrictedCloseActions OPTION[,OPTION...]</screen></para>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>where <computeroutput>OPTION</computeroutput> is one of the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync following keywords:<glosslist>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>SaveState</computeroutput></glossterm>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>Don't allow the user to save the VM state plus terminate the
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>Shutdown</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Don't allow the user to shutdown the VM by sending the ACPI
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync power off event to the guest.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>PowerOff</computeroutput></glossterm>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Don't allow the user to power off the VM.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <glossterm><computeroutput>Restore</computeroutput></glossterm>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>Don't allow the user to return to the last snapshot when
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync powering off the VM.</para>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossdef>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync </glossentry>
febf3f1de573e25fb134b8453a22b0732b4c52e2vboxsync <para>Combinations of all of these options are allowed. If all options are
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync specified, the VM cannot be shut down from the GUI.</para>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <title>Starting <computeroutput>vboxwebsrv</computeroutput>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync automatically</title>
9f867ca76156f061619e4cffb76451a40c8ad2a3vboxsync <para><computeroutput>vboxwebsrv</computeroutput> is used for controlling
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync VirtualBox remotely. As the client base using this interface is growing,
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync we added start scripts for the various operation systems we support. The
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync following describes how to use them. <itemizedlist>
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <para>On Mac OS X, launchd is used. An example configuration file
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync can be found in
9f867ca76156f061619e4cffb76451a40c8ad2a3vboxsync <computeroutput>$HOME/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</computeroutput>.
9f867ca76156f061619e4cffb76451a40c8ad2a3vboxsync It has to be enabled by changing the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync <computeroutput>false</computeroutput>. To manually start the
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync service use the following command: <screen>launchctl load ~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist</screen>
9f867ca76156f061619e4cffb76451a40c8ad2a3vboxsync For additional information on how launchd services could be
051203e46846205a982bcf5ab198a8b5f6f8e6e0vboxsync url="http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html">http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html</ulink></literal>.</para>
9f867ca76156f061619e4cffb76451a40c8ad2a3vboxsync </listitem>