// currenty, nsISupportsImpl.h lacks the below-like macros #ifndef NS_IMPL_THREADSAFE_ISUPPORTS1_CI #define NS_IMPL_THREADSAFE_ISUPPORTS1_CI(_class, _interface) \ NS_IMPL_THREADSAFE_ADDREF(_class) \ NS_IMPL_THREADSAFE_RELEASE(_class) \ NS_IMPL_QUERY_INTERFACE1_CI(_class, _interface) \ NS_IMPL_CI_INTERFACE_GETTER1(_class, _interface) #endif #ifndef NS_IMPL_THREADSAFE_ISUPPORTS2_CI #define NS_IMPL_THREADSAFE_ISUPPORTS2_CI(_class, _i1, _i2) \ NS_IMPL_THREADSAFE_ADDREF(_class) \ NS_IMPL_THREADSAFE_RELEASE(_class) \ NS_IMPL_QUERY_INTERFACE2_CI(_class, _i1, _i2) \ NS_IMPL_CI_INTERFACE_GETTER2(_class, _i1, _i2) #endif This represents a boolean variable having a third state, default. Virtual machine execution state. This enumeration represents possible values of the attribute. The machine is not running. The machine is not currently running, but the execution state of the machine has been saved to an external file when it was running. No any machine settings can be altered when the machine is in this state. A process that run the machine has abnormally terminated. Other than that, this value is equivalent to #PoweredOff. The machine is currently being executed. This value can be used in comparison expressions: all state values below it describe a virtual machine that is not currently being executed (i.e., it is completely out of action). The execution of the machine has been paused. This value can be used in comparison expressions: all state values above it represent unstable states of the virtual machine. No any settings can be altered when the VM is in one of the unstable sates. The machine is being started after powering it on from a zero execution state. The machine is being normally stopped (after explicitly powering it off, or after the guest OS has initiated a shutdown sequence). The machine is saving its execution state to a file as a result of calling or an online snapshot of the machine is being taken using . The execution state of the machine is being restored from a file after powering it on from a saved execution state. A snapshot of the machine is being discarded after calling or its current state is being discarded after . Session state. This enumeration represents possible values of and attributes. Idividual value descriptions contain the appropriate meaning for every case. The machine has no open sessions (); the session is closed () The machine has an open direct session (); the session is open () A new (direct) session is being opened for the machine as a result of call (); the session is currently being opened as a result of call () The direct session is being closed (); the session is being closed () Session type. This enumeration represents possible values of the attribute. Direct session (opened by ) Remote session (opened by ) Existing session (opened by ) Device type. No Device. This value is not used by Floppy device. CD/DVD-ROM device. Hard disk device. Network device. Usage type constants for and . Scopes the VMs that use the resource permanently (the information about this usage is stored in the VM settings file). Scopes the VMs that are temporarily using the resource (the information about the usage is not yet saved in the VM settings file). Temporary usage can take place only in the context of an open session. Combines PermanentUsage and TemporaryUsage. The IVirtualBoxErrorInfo interface represents extended error information that can be set by components after unsuccessful method invocation and returned to the client in addition to the result code. In MS COM, this interface extends the IErrorInfo interface, in XPCOM, it extends the nsIException interface. In both cases, it provides a set of common attributes to retrieve error information. Result code of the error. Usually, it will be the same as the result code returned by the method that provided this error information, but not always. For example, on Win32, CoCreateInstance() will most likely return E_NOINTERFACE upon unsuccessful component instantiation attempt, but not the value the component factory returned. In MS COM, there is no equivalent. In XPCOM, it is the same as to nsIException::result. UUID of the interface that defined the error. In MS COM, it is the same as to IErrorInfo::GetGUID. In XPCOM, there is no equivalent. Name of the component that generated the error. In MS COM, it is the same as to IErrorInfo::GetSource. In XPCOM, there is no eqiuvalent. Text description of the error. In MS COM, it is the same as IErrorInfo::GetDescription. In XPCOM, it is the same as to nsIException::message. The execution state of the given machine has changed. IMachine::state ID of the machine this event relates to. New execution state. Any of the settings of the given machine has changed. ID of the machine this event relates to. Notification when someone tries to change extra data for either the given machine or (if null) global extra data. This gives the chance to veto against changes. ID of the machine this event relates to. Nul for global extra data change requests. Extra data key for the attempted write. Extra data value for the given key. Flag to indicate whether the callee agrees (true) or vetoes against the change (false). Notification when machine specific or global extra data has changed. ID of the machine this event relates to. Null for global extra data changes. Extra data key that has changed. Extra data value for the given key. The given machine was registered within this VirtualBox installation or unregistered, as described by the boolean argument. ID of the machine this event relates to. If true, the machine was registered, otherwise it was deregistered. The state of the session for the given machine was changed. IMachine::sessionState ID of the machine this event relates to. New session state. A new snapshot of the machine has been taken. ISnapshot ID of the machine this event relates to. ID of the new snapshot. Snapshot of the given machine has been discarded. This notification is delivered after the snapshot object has been uninitialized on the server (so that any attempt to call its methods will return an error). ISnapshot ID of the machine this event relates to. ID of the discarded snapshot. null means the current machine state has been discarded (restored from the current snapshot). Snapshot properties (name and/or description) have been changed. ISnapshot ID of the machine this event relates to. ID of the changed snapshot. The main interface exposed by the product that provides virtual machine management. A string representing the version number of the product. The format is 3 integer numbers divided by dots (e.g. 1.0.1). The last number represents the build number and will frequently change. Full path to the directory where the global settings file, VirtualBox.xml, is stored. In this version of VirtualBox, the value of this property is always <user_dir>/.VirtualBox (where <user_dir> is the path to the user directory, as determined by the host OS), and cannot be changed. This path is also used as the base to resolve relative paths in places where relative paths are allowed (unless otherwise expressly indicated). Associated host object. Associated system information object. A collection of hard disk objects registered within this VirtualBox instance. This collection contains only "top-level" (basic or independent) hard disk images, but not differencing ones. All differencing images of the given top-level image (i.e. all its children) can be enumerated using . Collection of globally shared folders. These folders are shared automatically upon VirtualBox server startup and available only to every virtual machine. New folders to share are added to the collection using . An existing shared folder can be removed using . Creates a new virtual machine. Every machine has a settings file that is used to store the machine configuration. This file is stored in the directory called machine settings subfolder. Both the subfolder and the settings file have the same name that corresponds to the name of the virtual machine. You can specify where to create the machine settings subfolder using the @a baseFolder argument. The base folder can be absolute (full path) or relative to the VirtualBox home directory. If a null or empty string is given as the base folder (which is recommended), the default machine settings folder will be used as the base folder to create the machine settings subfolder and file. In any case, the full path to the settings file will look like:
    <base_folder>/<machine_name>/<machine_name>.xml
Note that the configuration of the newly created machine is not saved to disk (and therefore no settings subfolder and file are created) until is called. You should also specify a valid name for the machine. See the property description for more details about the machine name. The created machine remains unregistered until you call . There is no way to change the name of the settings file or subfolder of the created machine directly.
Name of the folder where to create the machine settings subfolder containing the settings file. Machine name. Created machine object.
Creates a new virtual machine in "legacy" mode, using the specified settings file to store machine settings. As opposed to machines created by , the settings file of the machine created in "legacy" mode is not authomatically renamed when the machine name is changed -- it will always remain the same as specified in this method call. The specified settings file name can be absolute (full path) or relative to the VirtualBox home directory. If the file name doesn't contain an extension, the default extension (.xml) will be appended. Note that the configuration of the newly created machine is not saved to disk (and therefore no settings file is created) until is called. If the specified settings file already exists, will return an error. You should also specify a valid name for the machine. See the property description for more details about the machine name. The created machine remains unregistered until you call . @deprecated This method may be removed later. It is better to use . There is no way to change the name of the settings file of the created machine. Name of the file where to store machine settings. Machine name. Created machine object. Opens a virtual machine from the existing settings file. The opened machine remains unregistered until you call . The specified settings file name can be absolute (full path) or relative to the VirtualBox home directory. This file must exist and must be a valid machine settings file whose contents will be used to construct the machine object. @deprecated Will be removed soon. Name of the machine settings file. Opened machine object. will return false for the created machine, until any of machine settigs are changed. Registers the machine previously created using or opened using within this VirtualBox installation. After successful method invocation, the signal is sent to all registered callbacks. This method implicitly calls to save all current machine settings before registering it. Unregisters the machine previously registered using . After successful method invocation, the signal is sent to all registered callbacks. The specified machine must not be in the Saved state, have an open (or a spawning) direct session associated with it, have snapshots or have hard disks attached. This method implicitly calls to save all current machine settings before unregistering it. If the given machine is inaccessible (see ), it will be unregistered and fully uninitialized right afterwards. As a result, the returned machine object will be unusable and an attempt to call any method will return the "Object not ready" error. UUID of the machine to unregister. Unregistered machine object. Creates a new unregistered hard disk that will use the given storage type. Most properties of the created hard disk object are uninitialized. Valid values must be assigned to them (and probalby some actions performed) to make the actual usage of this hard disk (register, attach to a virtual machine, etc.). See the description of and descriptions of storage type specific interfaces for more information. For hard disks using the VirtualDiskImage storage type, an image file is not actually created until you call or . Storage type of the hard disk image to create. Created hard disk object of the given storage type. Opens a hard disk from an existing Virtual Disk Image file. The opened hard disk remains unregistered until is called. Opening differencing images is not supported. The specified file path can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. Name of the file that contains a valid Virtual Disk Image. Opened hard disk object. Registers the given hard disk within this VirtualBox installation. The hard disk must not be registered, must be and must not be a differencing hard disk, otherwise the registration will fail. Hard disk object to register. Returns the registered hard disk with the given UUID. UUID of the hard disk to look for. Found hard disk object. Returns a registered hard disk that uses the given image file. The specified file path can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. On host systems with case sensitive filesystems, a case sensitive comparison is performed, otherwise the case of symbols in the file path is ignored. Virtual Disk Image file path to look for. Found hard disk object. Unregisters a hard disk previously registered using . The specified hard disk must not be attached to any of the existing virtual machines and must not have children (differencing) hard disks. UUID of the hard disk to unregister. Unregistered hard disk object. Opens the CD/DVD image contained in the specified file of the supported format and assigns it the given UUID. The opened image remains unregistered until is called. Full name of the file that contains a valid CD/DVD image. Currently, only ISO images are supported. The specified file name can be absolute or relative to the VirtualBox home directory. UUID to assign to the given image file within this VirtualBox installation. If an empty (null) UUID is specified, the system will randomly generate an UUID. Opened CD/DVD image object. Registers a CD/DVD image within this VirtualBox installation. The image must not be registered and must not be associated with the same image file as any of the already registered images, otherwise the registration will fail. CD/DVD image object to register. Returns a registered CD/DVD image with the given UUID. UUID of the image to look for. Found CD/DVD image object. Returns a registered CD/DVD image with the given image file. On host systems with case sensitive filesystems, a case sensitive comparison is performed, otherwise the case of symbols in the file path is ignored. CD/DVD image file path to look for. Found CD/DVD image object. Returns the list of of UUIDs of all virtual machines that use the given CD/DVD image. UUID of the image to get the usage information for. Type of the usage (permanent, temporary or all). List of UUIDs of all machines that use the given image in the way specified by the usage parameter. The list is returned as a string containing UUIDs separated by spaces. A null string means that the image is not used. When the usage type is and the image is used by the VM both permanently and temporarily, the VM's UUID will be present only once in the list. Unregisters the CD/DVD image previously registered using . The specified image must not be mounted to any of the existing virtual machines. UUID of the CD/DVD image to unregister. Unregistered image object. Opens a floppy image contained in the specified file of the supported format and assigns it the given UUID. The opened image remains unregistered until is called. Full name of the file that contains a valid floppy image. The specified file name can be absolute or relative to the VirtualBox home directory. UUID to assign to the given image file within this VirtualBox installation. If an empty (null) UUID is specified, the system will randomly generate an UUID. Opened CD/DVD image object. Registers a floppy image within this VirtualBox installation. The image must not be registered and must not be associated with the same image file as any of the already registered images, otherwise the registration will fail. Floppy image object to register. Returns a registered floppy image with the given UUID. UUID of the image to look for. Found floppy image object. Returns a registered floppy image with the given image file. On host systems with case sensitive filesystems, a case sensitive comparison is performed, otherwise the case of symbols in the file path is ignored. Floppy image file path to look for. Found floppy image object. Returns the list of of UUIDs of all virtual machines that use the given floppy image. UUID of the image to get the usage information for. Type of the usage (permanent, temporary or all). List of UUIDs of all machines that use the given image in the way specified by the usage parameter. The list is returned as a string containing UUIDs separated by spaces. A null string means that the image is not used. When the usage type is and the image is used by the VM both permanently and temporarily, the VM's UUID will be present only once in the list. Unregisters the floppy image previously registered using . The specified image must not be mounted to any of the existing virtual machines. UUID of the floppy image to unregister. Unregistered image object. Creates a new shared folder by associating the given logical name with the given host path, adds it to the collection of shared folders and starts sharing it. Refer to the description of to read about logical name unicity. Unique logical name of the shared folder. Full path to the shared folder in the host file system. Removes a shared folder with the given name previously created by from the collection of shared folders and stops sharing it. Logical name of the shared folder to remove. Returns the extra data key name following the supplied key. An error is returned if the supplied key does not exist. NULL is returned if the supplied key is the last key. When supplying NULL for the key, the first item is returned. NextValue is an optional parameter and if supplied, the next key's value is returned as well. Returns associated extra data. Sets associated extra data.

Opens a new direct session with the given virtual machine. Within the direct session context, it is possible to change all VM settings, as well as to execute the VM in the process space of the session object. There can be only one direct session open at a time for every virtual machine.

Upon successful return, the session object can be used to get access to the machine and to the VM console.

Session object that will represent the opened session after successful method invocation. This object must not represent the already open session. This session will be automatically closed if the VirtualBox server is terminated for some reason. ID of the virtual machine to open a session with.

Opens a new remote session with the given virtual machine. Opening the remote session causes the server to start a new process that opens a direct session with the given VM. The remote session provides some level of control over the VM execution (using the IConsole interface) to the caller. Within the remote session context, it is not possible to change any static VM settings (such as name, HDD configuration, etc.).

This operation can take some time, so the progress object is returned to let the caller be informed when the session is actually open. Until then, the remote session object remains in the closed state and accessing the machine or its console through it is invalid.

It is impossible to open a remote session with the machine that already has an open direct session or waits until the previous request to open the remote session is completed (see ). openExistingSession
Session object that will represent the opened remote session after successful method invocation. This object must not represent an already open session. This session will be automatically closed when the peer (direct) session dies or gets closed. ID of the virtual machine to open a session with. Type of the remote session (case sensitive). Currently supported values are:
  • gui: Qt-based VM session
  • rdp: VRDP server session
Progress object to track the operation completion.

Opens a new remote session with the virtual machine for which a direct session is already open. The remote session provides some level of control over the VM execution (using the IConsole interface) to the caller. Within the remote session context, it is not possible to change any static VM settings (such as name, HDD configuration, etc.).

As opposed to , the number of remote sessions opened this way is not limited by the API.

It is impossible to open a remote session with the machine that doesn't have an open direct session. openRemoteSession
Session object that will represent the open remote session after successful method invocation. This object must not represent an already open session. This session will be automatically closed when the peer (direct) session dies or gets closed. ID of the virtual machine to open a session with.
Updates the VM state. This operation will also update the settings file with the correct information about the saved state file and delete this file from disk when appropriate. Returns the full name of the directory where to store log files created during this machine's executoin. Asks the server to run USB devices filters of the associated machine against the given USB device and tell if there is a match. Intended to be used only for remote USB devices. Local ones don't require to call this method (this is done implicitly by the Host and USBProxyService). Requests a capture of the given host USB device, and returns the captured device (as IUSBDevice) to the caller. The server must mark the device as USBDeviceCaptured during this call. This method must return extended error info in case of any eroror () relies on this. Releases the given USB device. The server must run its own filters and filters of all VMs but this one on the given device as if it were just attached to the host computer. Queries the list of available devices that must be auto-captured according to this VM's filters. Devices returned as IUSBDevice instances. The server must mark all returned devices as USBDeviceCaptured during this call. Releases all USB devices that are captured by this VM because the VM has been terminated. The server must run its own filters and filters of all VMs but this one on all released devices as if they were just attached to the host computer. Triggered by the given session object when the session is about to close normally. Session that is being closed Used to wait until the corresponding machine is actually deassociated from the given session on the server. Returned only when this session is a direct one. Called by the VM process to inform the server it wants to save the current state and stop the VM execution. Progress object created by the VM process to wait until the state is saved. File path the VM process must save the execution state to. Called by the VM process to inform the server that saving the state previously requested by #beginSavingState is either successfully finished or there was a failure. true to indicate success and false otherwise Called by the VM process to inform the server it wants to take a snapshot. The console object that initiated this call. Snapshot name Snapshot description Progress object created by the VM process to wait until the state is saved (only for online snapshots). File path the VM process must save the execution state to. Progress object created by the server process to wait until the snapshot is taken (VDI diff creation, etc.). Called by the VM process to inform the server that the snapshot previously requested by #beginTakingSnapshot is either successfully taken or there was a failure. true to indicate success and false otherwise Gets called by IConsole::discardSnapshot. The console object that initiated this call. UUID of the snapshot to discard. New machine state after this operation is started. Progress object to track the operation completion. Gets called by IConsole::discardCurrentState. The console object that initiated this call. New machine state after this operation is started. Progress object to track the operation completion. Gets called by IConsole::discardCurrentSnapshotAndState. The console object that initiated this call. New machine state after this operation is started. Progress object to track the operation completion. This represents the BIOS boot menu state. Fade in flag for BIOS logo animation. Fade out flag for BIOS logo animation. BIOS logo display time in milliseconds (0 = default). Local file system path for external BIOS image. Mode of the BIOS boot device menu. ACPI support flag. IO APIC support flag. If set, VirtualBox will provide an IO APIC and support IRQs above 15. Associated parent obect. Whether this virtual machine is currently accessible or not. The machine is considered to be inaccessible when:
  • It is a registered virtual machine, and
  • Its settings file is inaccessible (for example, it is located on a network share that is not accessible during VirtualBox startup, or becomes inaccessible later, or if the settings file can be read but is invalid).
Otherwise, the value of this property is always true. Every time this property is read, the accessibility state of this machine is re-evaluated. If the returned value is |false|, the property may be used to get the detailed error information describing the reason of inaccessibility. When the machine is inaccessible, only the following properties can be used on it:
An attempt to access any other property or method will return an error. The only possible action you can perform on an inaccessible machine is to unregister it using the call (or, to check for the accessibility state once more by querying this property). In the current implementation, once this property returns true, the machine will never become inaccessible later, even if its settings file cannot be successfully read/written any more (at least, until the VirtualBox server is restarted). This limitation may be removed in future releases.
Error information describing the reason of machine inaccessibility. Reading this property is only valid after the last call to returned false (i.e. the machine is currently unaccessible). Otherwise, a null IVirtualBoxErrorInfo object will be returned. Name of the virtual machine. Besides being used for human-readable identification purposes everywhere in VirtualBox, the virtual machine name is also used as a name of the machine's settings file and as a name of the subdirectory this settings file resides in. Thus, every time you change the value of this property, the settings file will be renamed once you call to confirm the change. The containing subdirectory will be also renamed, but only if it has exactly the same name as the settings file itself prior to changing this property (for backward compatibility with previous API releases). The above implies the following limitations:
  • The machine name cannot be empty.
  • The machine name can contain only characters that are valid file name characters according to the rules of the file system used to store VirtualBox configuration.
  • You cannot have two or more machines with the same name if they use the same subdirectory for storing the machine settings files.
  • You cannot change the name of the machine if it is running, or if any file in the directory containing the settings file is being used by another running machine or by any other process in the host operating system at a time when is called.
If any of the above limitations are hit, will return an appropriate error message explaining the exact reason and the changes you made to this machine will not be saved. For "legacy" machines created using the call, the above naming limitations do not apply because the machine name does not affect the settings file name. The settings file name remains the same as it was specified during machine creation and never changes.
UUID of the virtual machine. Guest OS type configured by the user. This value may differ from the value returned by if Guest Additions are installed to the guest OS. Sytem memory size in megabytes. Video memory size in megabytes. Object containing all BIOS settings. This setting determines whether VirtualBox will try to make use of the host CPU's hardware virtualization extensions such as Intel VT-x and AMD SVM. Note that in case such extensions are not available, they will not be used. Full path to the directory used to store snapshot data (difrerencing hard disks and saved state files) of this machine. The initial value of this property is < path_to_settings_file>/< machine_uuid >. Currently, it is an error to try to change this property on a machine that has snapshots (because this would require to move possibly large files to a different location). A separate method will be available for this purpose later. Setting this property to null will restore the initial value. When setting this property, the specified path can be absolute (full path) or relative to the directory where the machine settings file is located. When reading this property, a full path is always returned. The specified path may not exist, it will be created when necessary. VRDP server object. Collection of hard disks attached to the machine. Associated DVD drive object. Associated floppy drive object. Associated USB controller object. Associated audio adapter, always present. Full name of the file containing machine settings data. Whether the settings of this machine have been modified (but neither yet saved nor discarded). Reading this property is only valid on instances returned by and on new machines created by or opened by but not yet registered, or on unregistered machines after calling . For all other cases, the settigs can never be modified. For newly created unregistered machines, the value of this property is always TRUE until is called (no matter if any machine settings have been changed after the creation or not). For opened machines the value is set to FALSE (and then follows to normal rules). Current session state for this machine. Current execution state of this machine. Time stamp of the last execution state change, in milliseconds since 1970-01-01 UTC. Full path to the file that stores the execution state of the machine when it is in the state. When the machine is not in the Saved state, this attribute null. Current snapshot of this machine. A null object is returned if the machine doesn't have snapshots. Number of snapshots taken on this machine. Zero means the machine doesn't have any snapshots. Returns true if the current state of the machine is not identical to the state stored in the current snapshot. The current state is identical to the current snapshot right after one of the following calls are made:
  • or
  • (issued on a powered off or saved machine, for which returns false)
The current state remains identical until one of the following happens:
  • settings of the machine are changed
  • the saved state is discarded
  • the current snapshot is discarded
  • an attempt to execute the machine is made
For machines that don't have snapshots, this property is always false.
Collection of shared folders for this machine. These folders are shared automatically upon machine startup and available only to the guest OS installed within this machine. New folders to share are added to the collection using . An existing shared folder can be removed using . Synchronization mode between the host OS clipboard and the guest OS clipboard. Puts the given device to the specified position in the boot order. @todo [remove?] If the machine can have more than one device of the given type (such as hard disks), then a separate method should be used to specify the boot order for individual devices. Using this method in such cases will put the first device in the group (for example, a hard disk attached as Master on the primary IDE controller) to the given position. To indicate that no any device is associated with the given position, should be used. @todo setHardDiskBootOrder(), setNetworkBootOrder() Position in the boot order (1 to the total number of devices the machine can boot from, as returned by ). The type of the device used to boot at the given position. Returns the device type that occupies the specified position in the boot order. @todo [remove?] If the machine can have more than one device of the returned type (such as hard disks), then a separate method should be used to retrieve the individual device that occupies the given position. If here are no devices at the given position, then is returned. @todo getHardDiskBootOrder(), getNetworkBootOrder() Position in the boot order (1 to the total number of devices the machine can boot from, as returned by ). Device at the given position. Attaches a virtual hard disk identified by the given UUID to the given device slot of the given controller. The specified device must not have another disk attached and the given hard disk must not be already attached to this machine. See for detailed information about attaching hard disks. You cannot attach a hard disk to a running machine. Also, you cannot attach a hard disk to a newly created machine until it is registered. Attaching a hard disk to a machine creates a lazy attachment. In particular, no differeincing images are actually created until is called to commit all changed settings. UUID of the hard disk to attach. Controller to attach the hard disk to. Device slot to attach the hard disk to. Returns the hard disk attached to the given controller under the specified device number. Detaches the hard disk drive attached to the given device slot of the given controller. See for detailed information about attaching hard disks. You cannot detach a hard disk from a running machine. Detaching a hard disk from a machine creates a lazy detachment. In particular, if the detached hard disk is a differencing hard disk, it is not actually deleted until is called to commit all changed settings. Keep in mind, that doing will physically delete all detached differencing hard disks, so be careful. Controller to dettach the hard disk from. Device slot to dettach the hard disk from. Returns the network adapter associated with the given slot. Slots are numbered sequentially, starting with zero. The total number of adapters per every machine is defined by the property, so the maximum slot number is one less than that property's value. Returns the extra data key name following the supplied key. An error is returned if the supplied key does not exist. NULL is returned if the supplied key is the last key. When supplying NULL for the key, the first item is returned. NextValue is an optional parameter and if supplied, the next key's value is returned as well. Returns associated extra data. Sets associated extra data. Saves any changes to machine settings made since the session has been opened or a new machine has been created, or since the last call to or . For registered machines, new settings become visible to all other VirtualBox clients after successful invocation of this method. The method sends notification event after the configuration has been successfully saved (only for registered machines). Calling this method is only valid on instances returned by and on new machines created by but not yet registered, or on unregistered machines after calling . Discards any changes to the machine settings made since the session has been opened or since the last call to or . Calling this method is only valid on instances returned by and on new machines created by or opened by but not yet registered, or on unregistered machines after calling . Deletes the settings file of this machine from disk. The machine must not be registered in order for this operation to succeed. will return TRUE after this method successfully returns. Calling this method is only valid on instances returned by and on new machines created by or opened by but not yet registered, or on unregistered machines after calling . The deleted machine settings file can be restored (saved again) by calling . Returns a snapshot of this machine with the given UUID. A null UUID can be used to obtain the first snapshot taken on this machine. This is useful if you want to traverse the whole tree of snapshots starting from the root. UUID of the snapshot to get Snapshot object with the given UUID. Returns a snapshot of this machine with the given name. Name of the snapshot to find Snapshot object with the given name. Sets the current snapshot of this machine. In the current implementation, this operation is not implemented. UUID of the snapshot to set as the current snapshot. Creates a new shared folder by associating the given logical name with the given host path, adds it to the collection of shared folders and starts sharing it. Refer to the description of to read about logical name unicity. Unique logical name of the shared folder. Full path to the shared folder in the host file system. Removes a shared folder with the given name previously created by from the collection of shared folders and stops sharing it. Logical name of the shared folder to remove.
Notification when the guest mouse pointer shape has changed. The new shape data is given. Flag whether the pointer is visible. Flag whether the pointer has an alpha channel. The pointer hot spot x coordinate. The pointer hot spot y coordinate. Width of the pointer shape in pixels. Height of the pointer shape in pixels. Address of the shape buffer. The buffer contains 1 bpp (bits per pixel) AND mask followed by 32 bpp XOR (color) mask. For pointers without alpha channel the XOR mask pixels are 32 bit values: (lsb)BGR0(msb). For pointers with alpha channel the XOR mask consists of (lsb)BGRA(msb) 32 bit values. AND mask presents for pointers with alpha channel, so if the callback does not support alpha, the pointer could be displayed as a normal color pointer. The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND mask, therefore, is cbAnd = (width + 7) / 8 * height. The padding bits at the end of any scanline are undefined. The XOR mask follows the AND mask on the next 4 bytes aligned offset: uint8_t *pXor = pAnd + (cbAnd + 3) & ~3 Bytes in the gap between the AND and the XOR mask are undefined. XOR mask scanlines have no gap between them and size of XOR mask is: cXor = width * 4 * height. If 'shape' is equal to 0, only pointer visibility is being changed. Notification when the mouse capabilities reported by the guest have changed. The new capabilities are passed. Notification of the host if the guest executed the KBD_CMD_SET_LEDS command to alter the state of the keyboard LEDs. Notification when the execution state of the machine has changed. The new state will be given. Notification when a Guest Additions property changes. Interested callees should query IGuest's properties to find out what has changed. Notification when an error happens during the virtual machine execution. There are three kinds of runtime errors:
  • fatal
  • non-fatal with retry
  • non-fatal warnings
Fatal errors are indicated by the @a fatal parameter set to true. In case of fatal errors, the virtual machine execution is always paused before calling this notification, and the notification handler is supposed either to immediately save the virtual machine state using or power it off using . Resuming the execution can lead to unpredictable results. Non-fatal errors and warnings are indicated by the @a fatal parameter set to false. If the virtual machine is in the Paused state by the time the error notification is received, it means that the user can try to resume the machine execution after attempting to solve the probem that caused the error. In this case, the notification handler is supposed to show an appropriate message to the user (depending on the value of the @a id parameter) that offers several actions such as Retry, Save or Power Off. If the user wants to retry, the notification handler should continue the machine execution using the call. If the machine execution is not Paused during this notification, then it means this notification is a warning (for example, about a fatal condition that can happen very soon); no immediate action is required from the user, the machine continues its normal execution. Note that in either case the notification handler must not perform any action directly on a thread where this notification is called. Everything it is allowed to do is to post a message to another thread that will then talk to the user and take the corresponding action. Currently, the following error identificators are known:
  • "HostMemoryLow"
  • "HostAudioNotResponding"
  • "VDIStorageFull"
This notification is not designed to be implemented by more than one callback at a time. If you have multiple IConsoleCallback instances registered on the given IConsole object, make sure you just return S_OK from all but one of them that does actual user notification and performs necessary actions.
Whether the error is fatal or not Error identificator Optional error message
Whether the remote display connection is active. How many times a client connected. When the last connection was established, in milliseconds since 1970-01-01 UTC. When the last connection was terminated or the current time, if connection is still active, in milliseconds since 1970-01-01 UTC. How many bytes were sent in last or current, if still active, connection. How many bytes were sent in all connections. How many bytes were received in last or current, if still active, connection. How many bytes were received in all connections. Login user name supplied by the client. Login domain name supplied by the client. The client name supplied by the client. The IP address of the client. The client software version number. Public key exchange method used when connection was established. Values: 0 - RDP4 public key exchange scheme. 1 - X509 sertificates were sent to client. Machine object this console is sessioned with. This is a convenience property, it has the same value as of the corresponding session object. Current execution state of the machine. This property always returns the same value as the corresponding property of the IMachine object this console is sessioned with. For the process, that owns (executes) the VM, this is the preferrable way of quierying the VM state, because no IPC calls are made. Guest object. Virtual keyboard object. If the machine is not running, any attempt to use the returned object will result in an error. Virtual mouse object. If the machine is not running, any attempt to use the returned object will result in an error. Virtual display object. If the machine is not running, any attempt to use the returned object will result in an error. Debugging interface. Collection of USB devices currently attached to the virtual USB controller. The collection is empty if the machine is not running. List of USB devices currently attached to the remote VRDP client. Once a new device is physically attached to the remote host computer, it appears in this list and remains there until detached. Collection of shared folders for the current session. This collection is initially empty and is cleared once the session is closed. On other words, this collection represents transient shares (as opposed to that stores permanent shares stored in the settings file). New folders to share are added to the collection using . An existing shared folder can be removed using . Interface that provides information on Remote Display (VRDP) connection. Starts the virtual machine execution using the current machine state (i.e. its current execution state, current settings and current hard disks). If the machine is powered off or aborted, the execution will start from the beginning (as if the real hardware were just powered on). If the machine is in the state, it will continue its execution the point where the state has beem saved. #saveState Progress object to track the operation completion. Stops the virtual machine execution. After this operation completes, the machine will go to the PoweredOff state. Resets the virtual machine. Pauses the virtual machine execution. Resumes the virtual machine execution. Send the ACPI power button event to the guest. Saves the current execution state of a running virtual machine and stops its executiuon. After this operation completes, the machine will go to the Saved state. Next time it is powered up, this state will be restored and the machine will continue its execution from the place where it was saved. This operation differs from taking a snapshot to the effect that it doesn't create new differencing hard disks. Also, once the machine is powered up from the state saved using this method, the saved state is deleted, so it will be impossible to return to this state later. On success, this method implicitly calls to save all current machine settings (including runtime changes to the DVD drive, etc.). Together with the impossibility to change any VM settings when it is in the Saved state, this guarantees the adequate hardware configuration of the machine when it is restored from the saved state file. The machine must be in the Running or Paused state, otherwise the operation will fail. Progress object to track the operation completion. Discards (deletes) the saved state of the virtual machine previously created by . Next time the machine is powered up, a clean boot will occur. This operation is equivalent to resetting or powering off the machine without doing a proper shutdown in the guest OS. Gets the current activity type of a given device or device group. Attaches a host USB device with the given UUID to the USB controller of the virtual machine. The device needs to be in one of the following states: USBDeviceBusy, USBDeviceAvailable or USBDeviceHeld, otherwise an error is immediately returned. When the device state is USBDeviceBusy, an error may also be returned if the host computer refuses to release it for some reason. IUSBController::DeviceFilters, USBDeviceState UUID of the host USB device to attach. Detaches an USB device with the given UUID from the USB controller oif the virtual machine. After this method succeeds, the VirtualBox server reinitiates all USB filters as if the device were just physically attached to the host, but filters of this machine are ignored to avoid a possible automatic reattachment. IUSBController::DeviceFilters, USBDeviceState UUID of the USB device to detach. Detached USB device. Creates a new shared folder by associating the given logical name with the given host path, adds it to the collection of shared folders and starts sharing it. Refer to the description of to read about logical name unicity. Unique logical name of the shared folder. Full path to the shared folder in the host file system. Removes a shared folder with the given name previously created by from the collection of shared folders and stops sharing it. Logical name of the shared folder to remove. Saves the current execution state and all settings of the machine and creates differencing images for all normal (non-independent) hard disks. This method can be called for a PoweredOff, Saved, Running or Paused virtual machine. When the machine is PoweredOff, an offline snapshot is created, in all other cases -- an online snapshot. The taken snapshot is always based on the current snapshot of the associated virtual machine and becomes a new current snapshot. This method implicitly calls to save all current machine settings before taking an offline snapshot. ISnapshot, Short name for the snapshot. Optional description of the snapshot. Progress object to track the operation completion. Starts discarding the specified snapshot. The execution state and settings of the associated machine stored in the snapshot will be deleted. The contents of all differencing hard disks of this snapshot will be merged with the contents of their dependent child hard disks to keep the, disks valid (in other words, all changes represented by hard disks being discarded will be propagated to their child hard disks). After that, this snapshot's differencing hard disks will be deleted. The parent of this snapshot will become a new parent for all its child snapshots. If the discarded snapshot is the current one, its parent snapshot will become a new current snapshot. The current machine state is not directly affected in this case, except that currently attached differencing hard disks based on hard disks of the discarded snapshot will be also merged as described above. If the discarded snapshot is the first one (the root snapshot) and it has exactly one child snapshot, this child snapshot will become the first snapshot after discarding. If there are no children at all (i.e. the first snapshot is the only snapshot of the machine), both the current and the first snapshot of the machine will be set to null. In all other cases, the first snapshot cannot be discarded. You cannot discard the snapshot if it stores normal (non-differencing) hard disks that have differencing hard disks based on them. Snapshots of such kind can be discarded only when every normal hard disk has either no children at all or exactly one child. In the former case, the normal hard disk simply becomes unused (i.e. not attached to any VM). In the latter case, it receives all the changes strored in the child hard disk, and then it replaces the child hard disk in the configuration of the corresponding snapshot or machine. Also, you cannot discard the snapshot if it stores hard disks (of any type) having differencing child hard disks that belong to other machines. Such snapshots can be only discarded after you discard all snapshots of other machines containing "foreign" child disks, or detach these "foreign" child disks from machines they are attached to. One particular example of the snapshot storing normal hard disks is the first snapshot of a virtual machine that had normal hard disks attached when taking the snapshot. Be careful when discarding such snapshots because this implicitly commits changes (made since the snapshot being discarded has been taken) to normal hard disks (as described above), which may be not what you want. The virtual machine is put to the Discarding state until the discard operation is completed. The machine must not be running, otherwise the operation will fail. Child hard disks of all normal hard disks of the discarded snapshot must be accessible for this operation to succeed. In particular, this means that all virtual machines, whose hard disks are directly or indirectly based on the hard disks of discarded snapshot, must be powered off. Merging hard disk contents can be very time and disk space consuming, if these disks are big in size and have many children. However, if the snapshot being discarded is the last (head) snapshot on the branch, the operation will be rather quick. Note that discarding the current snapshot will imlicitly call to make all current machine settings permanent. UUID of the snapshot to discard. Progress object to track the operation completion. This operation is similar to but affects the current machine state. This means that the state stored in the current snapshot will become a new current state, and all current settings of the machine and changes stored in differencing hard disks will be lost. After this operation is successfully completed, new empty differencing hard disks are created for all normal hard disks of the machine. If the current snapshot of the machine is an online snapshot, the machine will go to the saved state, so that the next time it is powered on, the execution state will be restored from the current snapshot. The machine must not be running, otherwise the operation will fail. If the machine state is Saved prior to this operation, the saved state file will be implicitly discarded (as if were called). Progress object to track the operation completion. This method is equivalent to doing discardSnapshot (currentSnapshot.id(), ...) followed by . As a result, the machine will be fully restored from the snapshot preceeding the current snapshot, while both the current snapshot and the current machine state will be discarded. If the current snapshot is the first snapshot of the machine (i.e. it has the only snapshot), the current machine state will be discarded before discarding the snapshot. In other words, the machine will be restored from its last snapshot, before discarding it. This differs from performing a single call (note that no will be possible after it) to the effect that the latter will preserve the current state instead of discarding it. Unless explicitly mentioned otherwise, all remarks and limitations of the above two methods also apply to this method. The machine must not be running, otherwise the operation will fail. If the machine state is Saved prior to this operation, the saved state file will be implicitly discarded (as if were called). This method is more efficient than calling two above methods separately: it requires less IPC calls and provides a single progress object. Progress object to track the operation completion. Registers a new console callback on this instance. The methods of the callback interface will be called by this instance when the appropriate event occurs. Unregisters the console callback previously registered using . Returns the platform device identifier. Searches this collection for a host drive with the given name. The method returns an error if the given name does not correspond to any host drive in the collection. Name of the host drive to search for Found host drive object Returns the platform device identifier. Searches this collection for a host drive with the given name. The method returns an error if the given name does not correspond to any host drive in the collection. Name of the host drive to search for Found host drive object Returns the host network interface name. Returns the interface UUID. Searches this collection for a host network interface with the given name. The method returns an error if the given name does not correspond to any host network interface in the collection. Name of the host network interface to search for. Found host network interface object. Searches this collection for a host network interface with the given GUID. The method returns an error if the given GUID does not correspond to any host network interface in the collection. GUID of the host network interface to search for. Found host network interface object. List of DVD drives available on the host. List of floppy drives available on the host. List of USB devices currently attached to the host. Once a new device is physically attached to the host computer, it appears in this list and remains there until detached. List of USB device filters in action. When a new device is physically attached to the host computer, filters from this list are applied to it (in order they are stored in the list). The first matched filter will determine the action performed on the device. Unless the device is ignored by these filters, filters of all currently running virtual machines () are applied to it. IHostUSBDeviceFilter, USBDeviceState List of host network interfaces currently defined on the host. Number of (logical) CPUs installed in the host system. (Approximate) speed of the host CPU in Megahertz. Description string of the host CPU. Amount of system memory in megabytes installed in the host system. Available system memory in the host system. Name of the host system's operating system. Host operating system's version string. Returns the current host time in milliseconds since 1970-01-01 UTC. Creates a new adapter for Host Interface Networking. Adapter name. Created host interface object. Progress object to track the operation completion. Removes the given host network interface. Adapter GUID. Removed host interface object. Progress object to track the operation completion. Creates a new USB device filter. All attributes except the filter name are set to null (any match), active is false (the filter is not active). The created filter can be added to the list of filters using . #USBDeviceFilters Filter name. See for more info. Created filter object. Inserts the given USB device to the specified position in the list of filters. Positions are numbered starting from 0. If the specified position is equal to or greater than the number of elements in the list, the filter is added to the end of the collection. Duplicates are not allowed, so an attempt to insert a filter that is already in the list, will return an error. #USBDeviceFilters Position to insert the filter to. USB device filter to insert. Removes a USB device filter from the specified position in the list of filters. Positions are numbered starting from 0. Specifying a position equal to or greater than the number of elements in the list will produce an error. #USBDeviceFilters Position to remove the filter from. Removed USB device filter. The ISystemProperties interface represents global properties of the given VirtualBox installation. These properties define limits and default values for various attributes and parameters. Most of the properties are read-only, but some can be changed by a user. Minium guest system memory in Megabytes. Maximum guest system memory in Megabytes. Minimum guest video memory in Megabytes. Maximum guest video memory in Megabytes. Maximum size of a virtual disk image in Megabytes. Number of network adapters associated with every instance. Maximum device position in the boot order. This value corresponds to the total number of devices a machine can boot from, to make it possible to include all possible devices to the boot list. Full path to the default directory used to create new or open existing virtual disk images when an image file name contains no path. The initial value of this property is < VirtualBox_home>/VDI. Setting this property to null will restore the initial value. When settings this property, the specified path can be absolute (full path) or relative to the VirtualBox home directory. When reading this property, a full path is always returned. The specified path may not exist, it will be created when necessary. , Full path to the default directory used to create new or open existing machines when a settings file name contains no path. The initial value of this property is < VirtualBox_home>/Machines. Setting this property to null will restore the initial value. When settings this property, the specified path can be absolute (full path) or relative to the VirtualBox home directory. When reading this property, a full path is always returned. The specified path may not exist, it will be created when necessary. , Path to the library that provides authentication for VRDP clients. The library is used if authentication type is set to "external" in the VM RemoteDisplay configuration. The initial value of this property is VRDPAuth. That is library called VRDPAuth in one of default library directories. A full path can be used as well. The library name does not include the file extension. Setting this property to null will restore the initial value. This specifies the default value for hardware virtualization extensions. If enabled, virtual machines will make use of hardware virtualization extensions such as Intel VT-x and AMD SVM by default. This value can be overridden by each VM using their property. Guest OS identifier string. Human readable description of the guest OS. Recommended RAM size in Megabytes. Recommended video RAM size in Megabytes. Recommended hard disk size in Megabytes. The IGuest interface represents a guest (virtual machine's) operating system. It provides information about the Guest Additions and other guest OS properties. IConsole::guest Guest OS type as reported by the Guest Additions. If Guest Additions are not installed, this value will be the same as . Flag whether the Guest Additions are installed and active in which case their version will be returned by the property. Version of the Guest Additions (3 decimal numbers separated by dots) or empty when the Additions are not installed. The Additions may also report a version but yet not be active as the version might be refused by VirtualBox (incompatible) or other failures occured. Store login credentials that can be queried by guest operating systems with Additions installed. The credentials are transient to the session and the guest may also choose to erase them. Note that the caller cannot determine whether the guest operating system has queried or made use of the credentials. User name string, can be empty Password string, can be empty Domain name (guest logon scheme specific), can be emtpy Flag whether the guest should alternatively allow the user to interactively specify different credentials. This flag might not be supported by all versions of the Additions. The IProgress interface represents a task progress object that allows to wait for the completion of some asynchronous task. The task consists of one or more operations that run sequentially, one after one. There is an individual percent of completion of the current operation and the percent of completion of the task as a whole. Similarly, you can wait for the completion of a particular operation or for the completion of the whole task. Every operation is identified by a number (starting from 0) and has a separate description. ID of the task. Description of the task. Initiator of the task. Whether the task can be interrupted. Current task progress value in percent. This value depends on how many operations are already complete. Whether the task has been completed. Whether the task has been canceled. Result code of the progress task. Valid only if is true. Extended information about the unsuccessful result of the progress operation. May be NULL when no extended information is available. Valid only if is true and indicates a failure. Number of operations this task is divided into. Every task consists of at least one operation. Number of the operation being currently executed. Description of the operation being currently executed. Current operation progress value in percent. Waits until the task is done (including all operations) with a given timeout. Timeout value in milliseconds. Specify -1 for an indefinite wait. Waits until the given operation is done with a given timeout. Number of the operation to wait for. Must be less than . Timeout value in milliseconds. Specify -1 for an indefinite wait. Cancels the task. If is false, then this method will fail. The ISnapshot interface represents a snapshot of the virtual machine. The snapshot stores all the information about a virtual machine necessary to bring it to exactly the same state as it was at the time of taking the snapshot. The snapshot includes:
  • all settings of the virtual machine (i.e. its hardware configuration: RAM size, attached hard disks, etc.)
  • the execution state of the virtual machine (memory contents, CPU state, etc.).
Snapshots can be offline (taken when the VM is powered off) or online (taken when the VM is running). The execution state of the offline snapshot is called a zero execution state (it doesn't actually contain any information about memory contents or the CPU state, assuming that all hardware is just powered off).

Snapshot branches

Snapshots can be chained. Chained snapshots form a branch where every next snapshot is based on the previous one. This chaining is mostly related to hard disk branching (see description). This means that every time a new snapshot is created, a new differencing hard disk is implicitly created for all normal hard disks attached to the given virtual machine. This allows to fully restore hard disk contents when the machine is later reverted to a particular snapshot. In the current implelemtation, multiple snapshot branches within one virtual machine are not allowed. Every machine has a signle branch, and operation adds a new snapshot to the top of that branch. Existings snapshots can be discarded using .

Current snapshot

Every virtual machine has a current snapshot, identified by . This snapshot is used as a base for the current machine state (see below), to the effect that all normal hard disks of the machine and its execution state are based on this snapshot. In the current implementation, the current snapshot is always the last taken snapshot (i.e. the head snapshot on the branch) and it cannot be changed. The current snapshot is null if the machine doesn't have snapshots at all; in this case the current machine state is just current settings of this machine plus its current execution state.

Current machine state

The current machine state is what represened by IMachine instances got directly from IVirtualBox using getMachine(), findMachine(), etc. (as opposed to instances returned by ). This state is always used when the machine is powered on. The current machine state also includes the current execution state. If the machine is being currently executed ( is and above), its execution state is just what's happening now. If it is powered off ( or ), it has a zero execution state. If the machine is saved (), its execution state is what saved in the execution state file (). If the machine is in the saved state, then, next time it is powered on, its execution state will be fully restored from the saved state file and the execution will continue from the point where the state was saved. Similarly to snapshots, the current machine state can be discarded using .

Taking and discarding snapshots

The table below briefly explains the meaning of every snapshot operation:
OperationMeaningRemarks
Save the current state of the virtual machine, including all settings, contents of normal hard disks and the current modifications to immutable hard disks (for online snapshots) The current state is not changed (the machine will continue execution if it is being executed when the snapshot is taken)
Forget the state of the virtual machine stored in the snapshot: dismiss all saved settings and delete the saved execution state (for online snapshots) Other snapshots (including child snapshots, if any) and the current state are not directly affected
Restore the current state of the virtual machine from the state stored in the current snapshot, including all settings and hard disk contents The current state of the machine existed prior to this operation is lost
Completely revert the virtual machine to the state it was in before the current snapshot has been taken The current state, as well as the current snapshot, are lost
UUID of the snapshot. Short name of the snapshot. Optional description of the snapshot. Time stamp of the snapshot, in milliseconds since 1970-01-01 UTC. true if this snapshot is an online snapshot and false otherwise. When this attribute is true, the attribute of the object associated with this snapshot will point to the saved state file. Otherwise, it will be null. Virtual machine this snapshot is taken on. This object stores all settings the machine had when taking this snapshot. The returned machine object is immutable, i.e. no any settings can be changed. Parent snapshot (a snapshot this one is based on). It's not an error to read this attribute on a snapshot that doesn't have a parent -- a null object will be returned to indicate this. Child snapshots (all snapshots having this one as a parent). In the current implementation, there can be only one child snapshot, or no children at all, meaning this is the last (head) snapshot.
Virtual hard disk storage type. IHardDisk Virtual Disk Image, VDI (a regular file in the file system of the host OS, see ) iSCSI Remote Disk (a disk accessed via the Internet SCSI protocol over a TCP/IP network, see ) Virtual hard disk type. IHardDisk Normal hard disk (attached directly or indirectly, preserved when taking snapshots). Immutable hard disk (attached indirectly, changes are wiped out after powering off the virtual machine). Write through hard disk (attached directly, ignored when taking snapshots). Harddisk object this attachment is about. Disk controller ID of this attachment. Device number of the attachment. The IHardDisk interface represents a virtual hard disk drive used by virtual machines. The virtual hard disk drive virtualizes the hard disk hardware and looks like a regular hard disk inside the virtual machine and the guest OS.

Storage Types

The storage type of the virtual hard disk determines where and how it stores its data (sectors). Currently, the following storage types are supported:
  • Virtual Disk Image (VDI), a regular file in the file system of the host OS (represented by the interface). This file has a special format optimized so that unused sectors of data occupy much less space than on a physical hard disk.
  • iSCSI Remote Disk, a disk accessed via the Internet SCSI protocol over a TCP/IP network link (represented by the interface).
The storage type of the particular hard disk object is indicated by the property. Each storage type is represented by its own interface (as shown above), that allows to query and set properties and perform operations specific to that storage type. When an IHardDisk object reports it uses some particular storage type, it also guaranteed to support the corresponding interface which you can query. And vice versa, every object that supports a storage-specific interface, also supports IHardDisk.

Virtual Hard Disk Types

The type of the virtual hard disk determines how it is attached to the virtual machine when you call and what happens to it when a snapshot of the virtual machine is taken. There are three types of virtual hard disks:
  • Normal
  • Immutable
  • Writethrough
The virtual disk type is indicated by the property. Each of the above types is described in detail further down. There is also a forth, "hidden" virtual disk type: Differencing. It is "hidden" because you cannot directly create hard disks of this type -- they are automatically created by VirtualBox when necessary. Differencing Hard Disks Unlike disks of other types (that are similar to real hard disks), the differencing hard disk does not store the full range of data sectors. Instead, it stores only a subset of sectors of some other disk that were changed since the differencing hard disk has been created. Thus, every differencing hard disk has a parent hard disk it is linked to, and represents the difference between the initial and the current hard disk state. A differencing hard disk can be linked to another differencing hard disk -- this way, differencing hard disks can form a branch of changes. More over, a given virtual hard disk can have more than one differencing hard disk linked to it. A disk the differencing hard disk is linked to (or, in other words, based on) is called a parent hard disk and is accessible through the property. Similarly, all existing differencing hard disks for a given parent hard disk are called its child hard disks (and accessible through the property). All differencing hard disks use Virtual Disk Image files to store changed sectors. They have the property set to Normal, but can be easily distinguished from normal hard disks using the property: all differencing hard disks have a parent, while all normal hard disks don't. When the virtual machine makes an attempt to read a sector that is missing in a differencing hard disk, its parent is accessed to resolve the sector in question. This process continues until the sector is found, or until the root hard disk is encountered, which always contains all sectors. As a consequence,
  • The virtual hard disk geometry seen by the guest OS is always defined by the root hard disk.
  • All hard disks on a branch, up to the root, must be for a given differencing hard disk in order to let it function properly when the virtual machine is running.
Differencing hard disks can be implicitly created by VirtualBox in the following cases:
  • When a hard disk is indirectly attached to the virtual machine using . In this case, all disk writes performed by the guest OS will go to the created diffferencing hard disk, as opposed to the direct attachment, where all changes are written to the attached hard disk itself.
  • When a snapshot of the virtual machine is taken. After that, disk writes to hard disks the differencing ones have been created for, will be directed to those differencing hard disks, to preserve the contents of the original disks.
Whether to create a differencing hard disk or not depends on the type of the hard disk attached to the virtual machine. This is explained below. Normal Hard Disks Normal hard disks are the most commonly used virtual hard disk. A normal hard disk is attached to the machine directly if it is not already attached to some other machine. Otherwise, an attempt to make an indirect attachment through a differencing hard disk will be made. This attempt will fail if the hard disk is attached to a virtual machine without snapshots (because it's impossible to create a differencing hard disk based on a hard disk that is subject to change). When an indirect attachment takes place, in the simplest case, where the machine the hard disk is being attached to doesn't have snapshots, the differencing hard disk will be based on the normal hard disk being attached. Otherwise, the first (i.e. the most recent) descendant of the given normal hard disk found in the current snapshot branch (starting from the current snapshot and going up to the root) will be actually used as a base. Note that when you detach an indirectly attached hard disk from the machine, the created differencing hard disk image is simply deleted, so all changes are lost. If you attach the same disk again, a clean differencing disk will be created based on the most recent child, as described above. When taking a snapshot, the contents of all normal hard disks (and all differencing disks whose roots are normal hard disks) currently attached to the virtual machine is preserved by creating differencing hard disks based on them. Immutable Hard Disks Immutable hard disks can be used to provide a sort of read-only access. An immutable hard disk is always attached indirectly. The created differencing hard disk is automatically wiped out (recreated from scratch) every time you power off the virtual machine. Thus, the contents of the immutable disk remains unchanged between runs. Detaching an immutable hard disk deletes the differencing disk created for it, with the same effect as in case with normal hard disks. When taking a snapshot, the differencing part of the immutable hard disk is cloned (i.e. copied to a separate Virtual Disk Image file) without any changes. This is necessary to preserve the exact virtual machine state when you create an online snapshot. Writethrough Hard Disks Hard disks of this type are always attached directly. This means that every given writethrough hard disk can be attached only to one virtual machine at a time. It is impossible to take a snapshot of a virtual machine with the writethrough hard disk attached, because taking a snapshot implies saving the execution state and preserving the contents of all hard disks, but writethrough hard disks cannot be preserved. Preserving hard disk contents is necessary to ensure the guest OS stored in the snapshot will get the same hard disk state when restored, which is especially important when it has open file handles or when there are cached files and directories stored in memory.

Creating, Opening and Registering Hard Disks

Non-differencing hard disks are either created from scratch using or opened from a VDI file using (only for hard disks using the VirtualDiskImage storage type). Once a hard disk is created or opened, it needs to be registered using to make it available for attaching to virtual machines. See the documentation of individual interfaces for various storage types to get more information. Differencing hard disks are never created explicitly and cannot be registered or unregistered; they are automatically registered upon creation and deregistered when deleted.

More about Indirect Hard Disk Attachments

Normally, when you attach a hard disk to the virtual machine, and then query the corresponding attachment using or you will get the same hard disk object, whose UUID you passed earlier to . However, when an indirect attachment takes place, calling will return a differencing hard disk object, that is either based on the attached hard disk or on another differencing hard disk, the attached hard disk is eventually a root for (as described above). In both cases the returned hard disk object is the object the virtual machine actually uses to perform disk writes to. Regardless of whether the attachment is direct or indirect, the property of the attached disk will contain an UUID of the machine object has been called on. Note that both and are lazy operations. In particular, this means that when an indirect attachment is made, differencing hard disks are not created until machine settings are committed using . Similarly, when a differencing hard disk is detached, it is not deleted until is called. Calling cancels all lazy attachments or detachments made since the last commit and effectively restores the previous set of hard disks.

Hard Disk Accessibility

The attribute of the hard disk object defines the accessibility state of the respective hard disk storage (for example, the VDI file for IVirtualDiskImage objects). If the value of this attribute is false then some hard disk attributes may contain invalid or outdated values (for example, the virtual or the actual hard disk size) until a new accessibility check is done that returns true (see the attribute description for more details). Because of the possible slowness of the accessibility check, it is not implicitly performed upon the VirtualBox server startup (to prevent the application freeze). In partcular, this means that if you try to read hard disk properties that depend on the accessibility state without first reading the value of the attribute and ensuring it's value is true, you will get wrong (zero) values.
UUID of the hard disk. For newly created hard disk objects, this value is a randomly generated UUID. Optional description of the hard disk. For a newly created hard disk, this value is null. For some storage types, reading this property is meaningless when is false. Also, you cannot assign it a new value in this case. Storage type of this hard disk. Storage type is defined when you open or create a new hard disk object. Storage location of this hard disk. The returned string serves for informational purposes only. To access detailed information about the storage, query the appropriate storage-specific interface. Type (behavior) of this hard disk. For a newly created or opened hard disk, this value is . In the current implementation, this property can be changed only on an unregistered hard disk object. This may be changed later. Parent of this hard disk (a hard disk this one is directly based on). Only differencing hard disks have parents, so a null object is returned for a hard disk of any other type. Children of this hard disk (all differencing hard disks for those this one is a parent). An empty collection is returned, if this hard disk doesn't have any children. Root hard disk of this hard disk. If this hard disk is a differencing hard disk, its root hard disk is the first disk on the branch. For all other types of hard disks, this property returns the hard disk object itself (i.e. the same object you read this property on). Whether the hard disk storage is currently accessible or not. The storage, for example, can be unaccessible if it doesn't exist or if it is placed on a network resource that is not available by the time this attribute is read. In the current implementation, the value of this property is also false if this hard disk is attached to a running virtual machine. The accessibility check is performed automatically every time this attribute is read. You should keep it in mind that this check may be slow and can block the calling thread for a long time (for example, if the network resourse where the hard disk storage is located is down). The following attributes of the hard disk object are considered to be invalid when this attribute is false:
Individual hard disk storage type interfaces may define additional attributes that depend on the accessibility state.
Whether the whole hard disk branch, starting from this image and going through its ancestors up to the root, is accessible or not. This property makes sense only for differencing hard disks. For all other types of hard disks it returns the same value as . String describing the reason of inaccessibility of this hard disk after the last call to that returned false. A null value of this property means that the last accessibility check returned true. Logical size of this hard disk (in megabytes), as reported to the guest OS running inside the vurtual machine this disk is attached to. The logical size is defined when the hard disk is created. Reading this property on a differencing hard disk will return the size of its root hard disk. Reading this property is meaningless when is false Physical size of the storage used to store hard disk data (in bytes). This size is usually less than the logical size of the hard disk, depending on the storage type and on the size optimization method used for that storage. Reading this property is meaningless when is false UUID of the machine this hard disk is attached to (or a null UUID if it is not attached). Immutable hard disks are never attached directly, so this attribute is always null in this case. UUID of the snapshot this hard disk is associated with (or null UUID if it is not associated with any snapshot). This attribute is always null if is null. Writethrough hard disks are always attached directly and cannot be involved when taking snapshots, so this attribute is meaningless and therefore always null. Starts creating a clone of this hard disk. The cloned hard disk will use the specified Virtual Disk Image file as a storage and will contain exactly the same sector data as the hard disk being cloned, except that a new UUID for the clone will be randomly generated. The specified image file path can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. It is an error to use the object returned in the @a image parameter until the returned @a progress object reports success. In the current implementation, only non-differencing hard disks can be cloned. Path to a file where to store the cloned hard disk. Cloned hard disk object. Progress object to track the operation completion.
The IVirtualDiskImage interface represents virtual hard disks that use virtual disk image files to store hard disk data. Hard disks using virtual disk images can be either opened using or created from scratch using . Objects that support this interface also support the interface. When a new hard disk object is created from scatch, an image file for it is not automatically created. To do it, you need to specify a valid file path, and call or . When it is done, the hard disk object can be registered by calling and then attached to virtual machines. The description of the Virtual Disk Image is stored in the image file. For this reason, changing the value of this property requires the hard disk to be accessible. The description of a registered hard disk can be changed only if a virtual machine using it is not running. Full file name of the virtual disk image of this hard disk. For newly created hard disk objects, this value is null. When assigning a new path, it can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. When reading this propery, a full path is always returned. This property cannot be changed when returns true. In this case, the specified file name can be absolute (full path) or relative to the VirtualBox home directory. If only a file name without any path is given, the default VDI folder will be used as a path to the image file. Whether the virual disk image is created or not. For newly created hard disk objects or after a successful invocation of , this value is false until or is called. Starts creating a dymically expanding hard disk image in the background. The previous image associated with this object, if any, must be deleted using , otherwise the operation will fail. After the returned progress object reports that the operation is complete, this hard disk object can be registered within this VirtualBox installation. Maximum logical size of the hard disk in megabytes. Progress object to track the operation completion. Starts creating a fixed-size hard disk image in the background. The previous image, if any, must be deleted using , otherwise the operation will fail. After the returned progress object reports that the operation is complete, this hard disk object can be registered within this VirtualBox installation. Logical size of the hard disk in megabytes. Progress object to track the operation completion. Deletes the existing hard disk image. The hard disk must not be registered within this VirtualBox installation, otherwise the operation will fail. After this operation succeeds, it will be impossible to register the hard disk until the image file is created again. This operation is valid only for non-differencing hard disks, after they are unregistered using . The IISCSIHardDisk interface represents virtual hard disks that use the Internet SCSI (iSCSI) protocol to store hard disk data on remote machines. iSCSI hard disks can be created using . When a new hard disk object is created, all its properties are uninitialized. After you assign some meaningful values to them, the hard disk object can be registered by calling and then attached to virtual machines. Objects that support this interface also support the interface. The description the iSCSI hard disk is stored in the VirtualBox configuration file, so it can be changed (at appropriate times) even when accessible returns false. However, the hard disk may not be attached to a running virtual machine. In the current imlementation, the type of all iSCSI hard disks is Writethrough and cannot be changed. iSCSI Server name (either a host name or an IP address). For newly created hard disk objects, this value is null. iSCSI Server port. For newly created hard disk objects, this value is 0, which means the default port. iSCSI target name. For newly created hard disk objects, this value is null. Logical unit number for this iSCSI disk. For newly created hard disk objects, this value is 0. User name for accessing this iSCSI disk. For newly created hard disk objects, this value is null. User password for accessing this iSCSI disk. For newly created hard disk objects, this value is null. Searches this collection for a DVD image with the given disk path. The method returns an error if the given name does not correspond to any DVD image in the collection. Name of the DVD image's file system location. Found DVD image object The IDVDImage interface represents a file containing the image of the DVD or CD disk.

Image Accessibility

The attribute of the image object defines the accessibility state of the image file. If the value of this attribute is false then some image attributes may contain invalid or outdated values (for example, the the image file size) until a new accessibility check is done that returns true. Because of the possible slowness of the accessibility check, it is not implicitly performed upon the VirtualBox server startup (to prevent the application freeze). In partcular, this means that if you try to read image properties that depend on the accessibility state without first reading the value of the attribute and ensuring it's value is true, you will get wrong (zero) values.
UUID of the CD/DVD image. Full file name of the CD/DVD image. Whether the CD/DVD image is currently accessible or not. The image, for example, can be unaccessible if it is placed on a network share that is not available by the time this property is read. The accessibility check is performed automatically every time this attribute is read. You should keep it in mind that this check may be slow and can block the calling thread for a long time (for example, if the network share where the image is located is down). The following attributes of the image object are considered to be invalid when this attribute is false:
Size of the ISO image in bytes.
Current drive state. When a host drive is mounted and passthrough is enabled the guest will be able to directly send SCSI commands to the host drive. This enables the guest to use CD/DVD writers but is potentially dangerous. Mounts the specified image. Captures the specified host drive. Unmounts the currently mounted image/device. Gets the currently mounted image ID. Gets the currently mounted image ID. Searches this collection for a floppy image with the given disk path. The method returns an error if the given name does not correspond to any floppy image in the collection. Name of the floppy image's file system location. Found Floppy image object The IFloppyImage interface represents a file containing the image of a floppy disk.

Image Accessibility

The attribute of the image object defines the accessibility state of the image file. If the value of this attribute is false then some image attributes may contain invalid or outdated values (for example, the the image file size) until a new accessibility check is done that returns true. Because of the possible slowness of the accessibility check, it is not implicitly performed upon the VirtualBox server startup (to prevent the application freeze). In partcular, this means that if you try to read image properties that depend on the accessibility state without first reading the value of the attribute and ensuring it's value is true, you will get wrong (zero) values.
UUID of the floppy image. Full file name of the floppy image. Whether the floppy image is currently accessible or not. The image, for example, can be unaccessible if it is placed on a network share that is not available by the time this property is read. The accessibility check is performed automatically every time this attribute is read. You should keep it in mind that this check may be slow and can block the calling thread for a long time (for example, if the network share where the image is located is down). The following attributes of the image object are considered to be invalid when this attribute is false:
Size of the floppy image in bytes.
Flag whether the floppy drive is enabled. If it is disabled, the floppy drive will not be reported to the guest. Current drive state. Mounts the specified image. Captures the specified host drive. Unmounts the currently mounted image/device. Gets the currently mounted image ID. Gets the currently mounted image ID. Sends a scancode to the keyboard. Sends an array of scancode to the keyboard. Sends the Ctrl-Alt-Del sequence to the keyboard. The IMouse interface represents a virtual mouse device. Whether the guest OS supports absolute mouse pointer positioning or not. VirtualBox Guest Tools need to be installed to the guest OS in order to enable absolute mouse positioning support. You can use the callback to be instantly informed about changes of this attribute during virtual machine execution. Initiates a mouse event using relative pointer movements along x and y axis. Amout of pixels the mouse should move to the right. Negative values move the mouse to the left. Amout of pixels the mouse should move downwards. Negative values move the mouse upwards. Amount of mouse wheel moves. Positive values describe clockwize wheel rotations, negative values describe counterclockwise rotations. The current state of mouse buttons. Every bit represents a mouse button as follows:
Bit 0 (0x01)left mouse button
Bit 1 (0x02)right mouse button
Bit 2 (0x04)middle mouse button
A value of 1 means the corresponding button is pressed. otherwise it is released.
Positions the mouse pointer using absolute x and y coordinates. These coordinates are expressed in pixels and start from [1,1] which corresponds to the top left corner of the virtual display. This method will have effect only if absolute mouse positioning is supported by the guest OS. X coordinate of the pointer in pixels, starting from 1. Y coordinate of the pointer in pixels, starting from 1. Amout of mouse wheel moves. Positive values describe clockwize wheel rotations, negative values describe counterclockwise rotations. The current state of mouse buttons. Every bit represents a mouse button as follows:
Bit 0 (0x01)left mouse button
Bit 1 (0x02)right mouse button
Bit 2 (0x04)middle mouse button
A value of 1 means the corresponding button is pressed. otherwise it is released.
Address of the start byte of the framebuffer. Framebuffer width. Framebuffer height. Framebuffer color depth. framebuffer scan line size in bytes. Framebuffer pixel format. Hint from the framebuffer about how much of the standard screen height it wants to use for itself. This information is exposed to the guest through the VESA BIOS and VMMDev interface so that it can use it for determining its video mode table. It is not guaranteed that the guest respects the value. An alpha-blended overlay which is superposed over the framebuffer. The initial purpose is to allow the display of icons providing information about the VM state, including disk activity, in front ends which do not have other means of doing that. The overlay is designed to controlled exclusively by IDisplay. It has no locking of its own, and any changes made to it are not guaranteed to be visible until the affected portion of IFramebuffer is updated. The overlay can be created lazily the first time it is requested. This attribute can also return NULL to signal that the overlay is not implemented. Locks the framebuffer. Gets called by the display object where this buffer is registered. Unlocks the framebuffer. Gets called by the display object where this buffer is registered. Informs about an update. Gets called by the display object where this buffer is registered. Requests a size and pixel format change. The IFramebuffer implementation should try to setup a memory buffer suitable for the given pixel format and line size. The buffer must be page aligned, must contain whole number of pages, and one should be able to lock it to obtain physical addresses of pages. (Note: this method is currently not supported, use the below mentioned vram pointer!) If the requested pixel format is not supported, or a PixelFormatDefault is requested, a default format is set. In that case the memory buffer does not have to be aligned and lockable. The callee is also allowed to use the memory buffer pointed to by the vram parameter. For non linear modes (such as text and standard VGA), the parameter is NULL and must not be used. When using it, all the IFramebuffer implementation has to do is return the same pointer as the Address property. It is recommended to use it as it will remove one copy operation. The caller checks if the call was successful via IFramebuffer property 'PixelFormat'. Note: The method is called by IDisplay under the Framebuffer lock. Specifies the pixel format of the surface (bpp and layout) Pointer to original guest VRAM (NULL for non linear modes) Returns whether the given acceleration operation is supported by the IFramebuffer implementation. If not, the display object will not attempt to call the corresponding IFramebuffer entry point. Even if an operation is indicated to supported, the IFramebuffer implementation always has the option to return non supported from the corresponding acceleration method in which case the operation will be performed by the display engine. This allows for reduced IFramebuffer implementation complexity where only common cases are handled. Returns whether the framebuffer implementation is willing to support a given video mode. In case it is not able to render the video mode (or for some reason not willing), it should return false. Usually this method is called when the guest asks the VMM device whether a given video mode is supported so the information returned is directly exposed to the guest. It is important that this method returns very quickly. Fill the specified rectangle on screen with a solid color. Copy specified rectangle on the screen. An alpha blended overlay for displaying status icons above an IFramebuffer. It is always created not visible, so that it must be explicitly shown. It only covers a portion of the IFramebuffer, determined by its width, height and co-ordinates. It is always in packed pixel little-endian 32bit ARGB (in that order) format, and may be written to directly. Do re-read the width though, after setting it, as it may be adjusted (increased) to make it more suitable for the front end. X position of the overlay, relative to the framebuffer. Y position of the overlay, relative to the framebuffer. Whether the overlay is currently visible. The global alpha value for the overlay. This may or may not be supported by a given front end. Changes the overlay's position relative to the IFramebuffer. Current display width. Current display height. Current guest display color depth. Note that this might be different from IFramebuffer::colorDepth. Prepares an internally managed framebuffer. Requests access to the internal framebuffer. Releases access to the internal framebuffer. Registers an external framebuffer. Asks VirtualBox to request the given video mode from the guest. This is just a hint and it cannot be guaranteed that the requested resolution will be used. Guest Additions are required for the request to be seen by guests. The caller should issue the request and wait for a resolution change and after a timeout retry. Specifying "0" for either width and height or the color depth means that the dimensions or color depth should not be changed. Takes a screen shot of the requested size and copies it to the 32-bpp buffer allocated by the caller. Draws a 32-bpp image of the specified size from the given buffer to the given point on the VM display. Does a full invalidation of the VM display and instructs the VM to update it. Signals that a framebuffer has completed the resize operation. Signals that a framebuffer has completed the update operation. Type of the virtual network adapter. Depending on this value, VirtualBox will provide a different virtual network hardware to the guest. Slot number this adapter is plugged into. Corresponds to the value you pass to to obtain this instance. Flag whether the network adapter is present in the guest system. If disabled, the virtual guest hardware will not contain this network adapter. Can only be changed when the VM is not running. Ethernet MAC address of the adapter, 12 hexadecimal characters. When setting it to NULL, VirtualBox will generate a unique MAC address. Name of the Host Network Interface that is currently in use. NULL will be returned if no device has been allocated. On Linux, setting this refers to a permanent TAP device. However, a file descriptor has precedence over the interface name on Linux. Note that when VBox allocates a TAP device, this property will not be set, i.e. the interface name would have to be determined using the file descriptor and /proc/self/fd. File descriptor of the TAP device. It can either be setup by the caller which has to supply an existing valid file handle allocated in the parent process of the VM process or allocated by VirtualBox. The value is -1 if it has not been defined. This property is non persistent, i.e. it will not be stored in the VM's configuration data and thus has to be set at each startup. Application to start to configure the TAP device. It is being passed two parameters, 1) the file handle (as ascii), 2) the TAP device name if it is available. Application to start before closing a TAP device. It is being passed two parameters, 1) the file handle (as ascii), 2) the TAP device name if it is available. Name of the internal network the VM is attached to. Flag whether the adapter reports the cable as connected or not. It can be used to report offline situations to a VM. Flag whether network traffic from/to the network card should be traced. Can only be toggled when the VM is turned off. Filename where a network trace will be stored. If not set, VBox-pid.pcap will be used. Attach the network adapter to the Network Address Translation (NAT) interface. Attach the network adapter to a host interface. On Linux, the TAP setup application will be executed if configured and unless a device name and/or file descriptor has been set, a new TAP interface will be created. Attach the network adapter to an internal network. Detach the network adapter Reset VM statistics. Dumps VM statistics. Switch for enabling singlestepping. Switch for forcing code recompilation for user mode code. Switch for forcing code recompilation for supervisor mode code. Switch for enabling and disabling the PATM component. Switch for enabling and disabling the CSAM component. Switch for enabling and disabling logging. Flag indicating whether the VM is currently making use of CPU hardware virtualization extensions Gets the VM handle. This is only for internal use while we carve the details of this interface. Flag whether the USB controller is present in the guest system. If disabled, the virtual guest hardware will not contain any USB controller. Can only be changed when the VM is powered off. USB standard version which the controller implements. This is a BCD which means that the major version is in the high byte and minor version is in the low byte. List of USB device filters associated with the machine. If the machine is currently running, these filters are activated every time a new (supported) USB device is attached to the host computer that was not ignored by global filters (). These filters are also activated when the machine is powered up. They are run against a list of all currently available USB devices (in states USBDeviceAvailable, USBDeviceBusy, USBDeviceHeld) that were not previously ignored by global filters. If at least one filter matches the USB device in question, this device is automatically captured (attached to) the virtual USB controller of this machine. IUSBDeviceFilter, ::IUSBController Creates a new USB device filter. All attributes except the filter name are set to null (any match), active is false (the filter is not active). The created filter can then be added to the list of filters using . #DeviceFilters Filter name. See for more info. Created filter object. Inserts the given USB device to the specified position in the list of filters. Positions are numbered starting from 0. If the specified position is equal to or greater than the number of elements in the list, the filter is added to the end of the collection. Duplicates are not allowed, so an attempt to inster a filter that is already in the collection, will return an error. #DeviceFilters Position to insert the filter to. USB device filter to insert. Removes a USB device filter from the specified position in the list of filters. Positions are numbered starting from 0. Specifying a position equal to or greater than the number of elements in the list will produce an error. #DeviceFilters Position to remove the filter from. Removed USB device filter. Searches this collection for a USB device with the given UUID. The method returns an error if the given UUID does not correspond to any USB device in the collection. IUSBDevice::id UUID of the USB device to search for. Found USB device object. Searches this collection for a USB device with the given host address. The method returns an error if the given address does not correspond to any USB device in the collection. IUSBDevice::address Address of the USB device (as assigned by the host) to search for. Found USB device object. The IUSBDevice interface represents a USB device captured by (attached to) a running virtual machine's USB controller. IConsole::USBDevices Unique USB device ID. This ID is built from #vendorId, #productId, #revision and #serialNumber. Vendor ID. Product ID. Product revision number. This is a packed BCD represented as unsigned short. The high byte is the integer part and the low byte is the decimal. Manufacturer string. Product string. Serial number string. Host specific address of the device. Host USB port number the device is physically coonected to. Whether the device is physically connected to a remote VRDP client or to a local host machine. The IUSBDeviceFilter interface represents an USB device filter used to perform actions on a group of USB devices. This type of filters is used by running virtual machines to automatically capture selected USB devices once they are physically attached to the host computer. A USB device is matched to the given device filter if and only if all attributes of the device match the corresponding attributes of the filter (that is, attributes are joined together using the logical AND operation). On the other hand, all together, filters in the list of filters carry the semantics of the logical OR operation. So if it is desirable to create a match like "this vendor id OR this product id", one needs to create two filters and specify "any match" (see below) for unused attributes. All filter attributes used for matching are strings. Each string is an expression representing a set of values of the corresponding device attribute, that will match the given filter. Currently, the following filtering expressions are supported:
  • Interval filters. Used to specify valid intervals for integer device attributes (Vendor ID, Product ID and Revision). The format of the string is: int:((m)|([m]-[n]))(,(m)|([m]-[n]))* where m and n are integer numbers, either in octal (starting from 0), hexadecimal (starting from 0x) or decimal (otherwise) form, so that m < n. If m is ommitted before a dash (-), the minimum possible integer is assumed; if n is ommitted after a dash, the maximum possible integer is assummed.
  • Boolean filters. Used to specify acceptable values for boolean device attributes. The format of the string is: true|false|yes|no|0|1
  • Exact match. Used to specify a single value for the given device attribute. Any string that does't start with int: represents the exact match. String device attributes are compared to this string including case of symbols. Integer attributes are first converted to a string (see individual filter attributes) and then compared ignoring case.
  • Any match. Any value of the corresponding device attribute will match the given filter. An empty or null string is used to construct this type of filtering expressions.
On the Windows host platform, interval filters are not currently available. Also all string filter attributes (, , ) are ignored, so they behave as any match no matter what string expression is specified. IUSBController::DeviceFilters, IHostUSBDeviceFilter
Visible name for this filter. This name is used to visually distungish one filter from another, so it can neither be null nor an empty string. Whether this filter active or has been temporarily disabled. Vendor ID filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes). Product ID filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes). Product revision number filter. The string representation for the exact matching has the form IIFF, where I is the decimal digit of the integer part of the revision, and F is the decimal digit of its fractional part (including leading and trailing zeroes). Note that for interval filters, it's best to use the hexadecimal form, because the revision is stored as a 16 bit packed BCD value; so the expression int:0x0100-0x0199 will match any revision from 1.0 to 1.99. Manufacturer filter. Product filter. Serial number filter. Host USB port filter. Remote state filter. This filter makes sense only for machine USB filters, i.e. it is ignored by IHostUSBDeviceFilter objects.
USB device state. This enumeration represents all possible states of the USB device physically attached to the host computer regarding its state on the host computer and availability to guest computers (all currently running virtual machines). Once a supported USB device is attached to the host, global USB filters () are activated. They can either ignore the device, or put ot to #USBDeviceHeld state, or do nothing. Unless the device is ignored by global filters, filters of all currently running guests () are activated that can put it to #USBDeviceCaptured state. If the device was ignored by global filters, or didn't match any filters at all (including guest ones), it is handled by the host in a normal way. In this case, the device state is determined by the host and can be one of #USBDeviceUnavailable, #USBDeviceBusy or #USBDeviceAvailable, depending on the current device usage. Besides auto-capturing based on filters, the device can be manually captured by guests () if its state is #USBDeviceBusy, #USBDeviceAvailable or #USBDeviceHeld. Due to differences in USB stack implementations in Linux and Win32, states #USBDeviceBusy and #USBDeviceAvailable are applicable only to the Linux version of the product. This also means that () can only succeed on Win32 if the device state is #USBDeviceHeld. IHostUSBDevice, IHostUSBDeviceFilter Not supported by the VirtualBox server, not available to guests. Being used by the host computer exclusively, not available to guests. Being used by the host computer, potentially available to guests. Not used by the host computer, available to guests. The host computer can also start using the device at any time. Held by the VirtualBox server (ignored by the host computer), available to guests. Captured by one of the guest computers, not available to anybody else. Searches this collection for a USB device with the given UUID. The method returns an error if the given UUID does not correspond to any USB device in the collection. IHostUSBDevice::id UUID of the USB device to search for. Found USB device object. Searches this collection for a USB device with the given host address. The method returns an error if the given address does not correspond to any USB device in the collection. IHostUSBDevice::address Address of the USB device (as assigned by the host) to search for. Found USB device object. The IHostUSBDevice interface represents a USB device attached to the host computer. Among with properties inherited from IUSBDevice, this interface adds the property that holds the courrent state of the USB device. IHost::USBDevices, IHost::USBDeviceFilters Current state of the device. Actions for host USB device filters. IHostUSBDeviceFilter, USBDeviceState Ignore the matched USB device. Hold the matched USB device. The IHostUSBDeviceFilter interface represents a USB device filter used by the host computer. Using filters of this type, the host computer determines the initial state of the USB device after it is physically attached to the host's USB controller. The attribute is ignored by this type of filters, because it makes sense only for machine USB filters. IHost::USBDeviceFilters Action performed by the host when an attached USB device matches this filter. Flag whether the audio adapter is present in the guest system. If disabled, the virtual guest hardware will not contain any audio adapter. Can only be changed when the VM is not running. Audio driver the adapter is connected to. This setting can only be changed when the VM is not running. VRDP server status. VRDP server port. VRDP authentication method. Timeout for guest authentication. Milliseconds. Searches this collection for a shared folder drive with the given logical name. The method returns an error if the given name does not correspond to any shared folder in the collection. Logical name of the shared folder to search for Found shared folder object The ISharedFolder interface represents a folder in the host computer's file system accessible from a guest OS running inside a virtual machine using an associated logical name. There are three types of shared folders:
  • permanent ()
  • transient ()
  • global ()
For a given virtual machine, both permanently and transiently shared folders have the same logical name space which also includes all globally shared folders. Thus, every folder in this name space must have an unique logical name. Note that permanent and transient shares of other machines are in different name spaces, so they don't have to have unique names.
Logical name of the shared folder. Full path to the shared folder in the host file system. Whether the folder defined by the host path is currently accessible or not. For example, the folder can be unaccessible if it is placed on the network share that is not available by the time this property is read.
PID of the process that has created this Session object. Returns the console object suitable for remote control. Assigns the machine object associated with this direct-type session or informs the session that it will be a remote one (if machine = NULL). Assigns the machine and the (remote) console object associated with this remote-type session. Updates the machine state in the VM process. Must be called only in certain cases (see the method implementation). Uninitializes (closes) this session. Used by VirtualBox to close the corresponding remote session when the direct session dies or gets closed. Triggered when settings of the DVD drive object of the associated virtual machine have changed. Triggered when settings of the floppy drive object of the associated virtual machine have changed. Triggered when settions of a network adapter of the associated virtual machine have changed. Triggered when settings of the VRDP server object of the associated virtual machine have changed. Triggered when settings of the USB controller object of the associated virtual machine have changed. Triggered when a USB device has just been attached to the host computer and is to be auto-captured by the machine according to its USB filters. Triggered when a USB device has just been detached from the host computer and needs to be detached from the machine. Current state of this session. Type of this session. The value of this attribute is valid only if the session is currently open (i.e. its #state is SessionType::SessionOpen), otherwise an error will be returned. Machine object associated with this session. Console object associated with this session. Closes this session. If a direct session for a machine opened with is not explicitly closed when the application terminates, the state of the machine will be set to on the server. Generally, it is recommended to close all open sessions explicitly before terminating the application (no matter what is the reason of the termination).