|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.virtualbox_4_1.IUnknown
org.virtualbox_4_1.IMachine
public class IMachine
The IMachine interface represents a virtual machine, or guest, created
in VirtualBox.
This interface is used in two contexts. First of all, a collection of
objects implementing this interface is stored in the
IVirtualBox.getMachines()
attribute which lists all the virtual
machines that are currently registered with this VirtualBox
installation. Also, once a session has been opened for the given virtual
machine (e.g. the virtual machine is running), the machine object
associated with the open session can be queried from the session object;
see ISession
for details.
The main role of this interface is to expose the settings of the virtual
machine and provide methods to change various aspects of the virtual
machine's configuration. For machine objects stored in the
IVirtualBox.getMachines()
collection, all attributes are
read-only unless explicitly stated otherwise in individual attribute
and method descriptions.
In order to change a machine setting, a session for this machine must be
opened using one of the lockMachine(org.virtualbox_4_1.ISession,org.virtualbox_4_1.LockType)
or
launchVMProcess(org.virtualbox_4_1.ISession,String,String)
methods. After the
machine has been successfully locked for a session, a mutable machine object
needs to be queried from the session object and then the desired settings
changes can be applied to the returned object using IMachine attributes and
methods. See the ISession
interface description for more
information about sessions.
Note that IMachine does not provide methods to control virtual machine
execution (such as start the machine, or power it down) -- these methods
are grouped in a separate interface called IConsole
.
ISession
,
Interface ID: {5EAA9319-62FC-4B0A-843C-0CB1940F8A91}
Field Summary |
---|
Fields inherited from class org.virtualbox_4_1.IUnknown |
---|
obj, port |
Constructor Summary | |
---|---|
IMachine(java.lang.String wrapped,
org.virtualbox_4_1.jaxws.VboxPortType port)
|
Method Summary | |
---|---|
IStorageController |
addStorageController(java.lang.String name,
StorageBus connectionType)
Adds a new storage controller (SCSI, SAS or SATA controller) to the machine and returns it as an instance of IStorageController . |
void |
attachDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
DeviceType type,
IMedium medium)
Attaches a device and optionally mounts a medium to the given storage controller ( IStorageController , identified by name),
at the indicated port and device. |
void |
attachHostPciDevice(java.lang.Integer hostAddress,
java.lang.Integer desiredGuestAddress,
java.lang.Boolean tryToUnbind)
Attaches host PCI device with the given (host) PCI address to the PCI bus of the virtual machine. |
java.lang.Boolean |
canShowConsoleWindow()
Returns true if the VM console process can activate the console window and bring it to foreground on the desktop of the host PC. |
IProgress |
cloneTo(IMachine target,
CloneMode mode,
java.util.List<CloneOptions> options)
Creates a clone of this machine, either as a full clone (which means creating independent copies of the hard disk media, save states and so on), or as a linked clone (which uses its own differencing media, sharing the parent media with the source machine). |
void |
createSharedFolder(java.lang.String name,
java.lang.String hostPath,
java.lang.Boolean writable,
java.lang.Boolean automount)
Creates a new permanent 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. |
IProgress |
delete(java.util.List<IMedium> aMedia)
Deletes the files associated with this machine from disk. |
void |
detachDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device)
Detaches the device attached to a device slot of the specified bus. |
void |
detachHostPciDevice(java.lang.Integer hostAddress)
Detach host PCI device from the virtual machine. |
void |
discardSettings()
Discards any changes to the machine settings made since the session has been opened or since the last call to saveSettings()
or discardSettings() . |
void |
enumerateGuestProperties(java.lang.String patterns,
Holder<java.util.List<java.lang.String>> name,
Holder<java.util.List<java.lang.String>> value,
Holder<java.util.List<java.lang.Long>> timestamp,
Holder<java.util.List<java.lang.String>> flags)
Return a list of the guest properties matching a set of patterns along with their values, time stamps and flags. |
IVirtualSystemDescription |
export(IAppliance aAppliance,
java.lang.String location)
Exports the machine to an OVF appliance. |
ISnapshot |
findSnapshot(java.lang.String nameOrId)
Returns a snapshot of this machine with the given name or UUID. |
java.lang.Boolean |
getAccelerate2DVideoEnabled()
This setting determines whether VirtualBox allows this machine to make use of the 2D video acceleration support available on the host. |
java.lang.Boolean |
getAccelerate3DEnabled()
This setting determines whether VirtualBox allows this machine to make use of the 3D graphics support available on the host. |
IVirtualBoxErrorInfo |
getAccessError()
Error information describing the reason of machine inaccessibility. |
java.lang.Boolean |
getAccessible()
Whether this virtual machine is currently accessible or not. |
IAudioAdapter |
getAudioAdapter()
Associated audio adapter, always present. |
IBandwidthControl |
getBandwidthControl()
Bandwidth control manager. |
IBIOSSettings |
getBIOSSettings()
Object containing all BIOS settings. |
DeviceType |
getBootOrder(java.lang.Long position)
Returns the device type that occupies the specified position in the boot order. |
ChipsetType |
getChipsetType()
Chipset type used in this VM. |
ClipboardMode |
getClipboardMode()
Synchronization mode between the host OS clipboard and the guest OS clipboard. |
java.lang.Long |
getCPUCount()
Number of virtual CPUs in the VM. |
java.lang.Long |
getCPUExecutionCap()
Means to limit the number of CPU cycles a guest can use. |
java.lang.Boolean |
getCPUHotPlugEnabled()
This setting determines whether VirtualBox allows CPU hotplugging for this machine. |
void |
getCPUIDLeaf(java.lang.Long id,
Holder<java.lang.Long> valEax,
Holder<java.lang.Long> valEbx,
Holder<java.lang.Long> valEcx,
Holder<java.lang.Long> valEdx)
Returns the virtual CPU cpuid information for the specified leaf. |
java.lang.Boolean |
getCPUProperty(CPUPropertyType property)
Returns the virtual CPU boolean value of the specified property. |
java.lang.Boolean |
getCPUStatus(java.lang.Long cpu)
Returns the current status of the given CPU. |
ISnapshot |
getCurrentSnapshot()
Current snapshot of this machine. |
java.lang.Boolean |
getCurrentStateModified()
Returns true if the current state of the machine is not identical to the state stored in the current snapshot. |
java.lang.String |
getDescription()
Description of the virtual machine. |
java.lang.Boolean |
getEmulatedUSBCardReaderEnabled()
|
java.lang.Boolean |
getEmulatedUSBWebcameraEnabled()
|
java.lang.String |
getExtraData(java.lang.String key)
Returns associated machine-specific extra data. |
java.util.List<java.lang.String> |
getExtraDataKeys()
Returns an array representing the machine-specific extra data keys which currently have values defined. |
java.lang.String |
getFaultToleranceAddress()
The address the fault tolerance source or target. |
java.lang.String |
getFaultTolerancePassword()
The password to check for on the standby VM. |
java.lang.Long |
getFaultTolerancePort()
The TCP port the fault tolerance source or target will use for communication. |
FaultToleranceState |
getFaultToleranceState()
Fault tolerance state; disabled, source or target. |
java.lang.Long |
getFaultToleranceSyncInterval()
The interval in ms used for syncing the state between source and target. |
FirmwareType |
getFirmwareType()
Type of firmware (such as legacy BIOS or EFI), used for initial bootstrap in this VM. |
void |
getGuestProperty(java.lang.String name,
Holder<java.lang.String> value,
Holder<java.lang.Long> timestamp,
Holder<java.lang.String> flags)
Reads an entry from the machine's guest property store. |
java.lang.String |
getGuestPropertyNotificationPatterns()
A comma-separated list of simple glob patterns. |
java.lang.Long |
getGuestPropertyTimestamp(java.lang.String property)
Reads a property timestamp from the machine's guest property store. |
java.lang.String |
getGuestPropertyValue(java.lang.String property)
Reads a value from the machine's guest property store. |
java.lang.String |
getHardwareUUID()
The UUID presented to the guest via memory tables, hardware and guest properties. |
java.lang.String |
getHardwareVersion()
Hardware version identifier. |
java.lang.Boolean |
getHpetEnabled()
This attribute controls if High Precision Event Timer (HPET) is enabled in this VM. |
java.lang.Boolean |
getHWVirtExProperty(HWVirtExPropertyType property)
Returns the value of the specified hardware virtualization boolean property. |
java.lang.String |
getId()
UUID of the virtual machine. |
java.lang.Boolean |
getIoCacheEnabled()
When set to true, the builtin I/O cache of the virtual machine will be enabled. |
java.lang.Long |
getIoCacheSize()
Maximum size of the I/O cache in MB. |
KeyboardHidType |
getKeyboardHidType()
Type of keyboard HID used in this VM. |
java.lang.Long |
getLastStateChange()
Time stamp of the last execution state change, in milliseconds since 1970-01-01 UTC. |
java.lang.String |
getLogFolder()
Full path to the folder that stores a set of rotated log files recorded during machine execution. |
IMedium |
getMedium(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device)
Returns the virtual medium attached to a device slot of the specified bus. |
IMediumAttachment |
getMediumAttachment(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device)
Returns a medium attachment which corresponds to the controller with the given name, on the given port and device slot. |
java.util.List<IMediumAttachment> |
getMediumAttachments()
Array of media attached to this machine. |
java.util.List<IMediumAttachment> |
getMediumAttachmentsOfController(java.lang.String name)
Returns an array of medium attachments which are attached to the the controller with the given name. |
java.lang.Long |
getMemoryBalloonSize()
Memory balloon size in megabytes. |
java.lang.Long |
getMemorySize()
System memory size in megabytes. |
java.lang.Long |
getMonitorCount()
Number of virtual monitors. |
java.lang.String |
getName()
Name of the virtual machine. |
INetworkAdapter |
getNetworkAdapter(java.lang.Long slot)
Returns the network adapter associated with the given slot. |
java.lang.String |
getOSTypeId()
User-defined identifier of the Guest OS type. |
java.lang.Boolean |
getPageFusionEnabled()
This setting determines whether VirtualBox allows page fusion for this machine (64 bits host only). |
IParallelPort |
getParallelPort(java.lang.Long slot)
Returns the parallel port associated with the given slot. |
IVirtualBox |
getParent()
Associated parent object. |
java.util.List<IPciDeviceAttachment> |
getPciDeviceAssignments()
Array of PCI devices assigned to this machine, to get list of all PCI devices attached to the machine use IConsole.getAttachedPciDevices() attribute, as this attribute
is intended to list only devices additional to what described in
virtual hardware config. |
PointingHidType |
getPointingHidType()
Type of pointing HID (such as mouse or tablet) used in this VM. |
java.lang.Boolean |
getRTCUseUTC()
When set to true, the RTC device of the virtual machine will run in UTC time, otherwise in local time. |
ISerialPort |
getSerialPort(java.lang.Long slot)
Returns the serial port associated with the given slot. |
java.lang.Long |
getSessionPid()
Identifier of the session process. |
SessionState |
getSessionState()
Current session state for this machine. |
java.lang.String |
getSessionType()
Type of the session. |
java.lang.String |
getSettingsFilePath()
Full name of the file containing machine settings data. |
java.lang.Boolean |
getSettingsModified()
Whether the settings of this machine have been modified (but neither yet saved nor discarded). |
java.util.List<ISharedFolder> |
getSharedFolders()
Collection of shared folders for this machine (permanent shared folders). |
java.lang.Long |
getSnapshotCount()
Number of snapshots taken on this machine. |
java.lang.String |
getSnapshotFolder()
Full path to the directory used to store snapshot data (differencing media and saved state files) of this machine. |
MachineState |
getState()
Current execution state of this machine. |
java.lang.String |
getStateFilePath()
Full path to the file that stores the execution state of the machine when it is in the MachineState.Saved state. |
IStorageController |
getStorageControllerByInstance(java.lang.Long instance)
Returns a storage controller with the given instance number. |
IStorageController |
getStorageControllerByName(java.lang.String name)
Returns a storage controller with the given name. |
java.util.List<IStorageController> |
getStorageControllers()
Array of storage controllers attached to this machine. |
java.lang.String |
getTeleporterAddress()
The address the target teleporter will listen on. |
java.lang.Boolean |
getTeleporterEnabled()
When set to true, the virtual machine becomes a target teleporter the next time it is powered on. |
java.lang.String |
getTeleporterPassword()
The password to check for on the target teleporter. |
java.lang.Long |
getTeleporterPort()
The TCP port the target teleporter will listen for incoming teleportations on. |
IUSBController |
getUSBController()
Associated USB controller object. |
java.lang.Long |
getVRAMSize()
Video memory size in megabytes. |
IVRDEServer |
getVRDEServer()
VirtualBox Remote Desktop Extension (VRDE) server object. |
void |
hotPlugCPU(java.lang.Long cpu)
Plugs a CPU into the machine. |
void |
hotUnplugCPU(java.lang.Long cpu)
Removes a CPU from the machine. |
IProgress |
launchVMProcess(ISession session,
java.lang.String type,
java.lang.String environment)
Spawns a new process that will execute the virtual machine and obtains a shared lock on the machine for the calling session. |
void |
lockMachine(ISession session,
LockType lockType)
Locks the machine for the given session to enable the caller to make changes to the machine or start the VM or control VM execution. |
void |
mountMedium(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
IMedium medium,
java.lang.Boolean force)
Mounts a medium ( IMedium , identified
by the given UUID id) to the given storage controller
(IStorageController , identified by name),
at the indicated port and device. |
void |
nonRotationalDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
java.lang.Boolean nonRotational)
Sets a flag in the device information which indicates that the medium is not based on rotational technology, i.e. |
void |
passthroughDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
java.lang.Boolean passthrough)
Sets the passthrough mode of an existing DVD device. |
static IMachine |
queryInterface(IUnknown obj)
|
java.lang.String |
queryLogFilename(java.lang.Long idx)
Queries for the VM log file name of an given index. |
void |
querySavedGuestSize(java.lang.Long screenId,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Returns the guest dimensions from the saved state. |
void |
querySavedScreenshotPNGSize(java.lang.Long screenId,
Holder<java.lang.Long> size,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Returns size in bytes and dimensions of a saved PNG image of screenshot from saved state. |
void |
querySavedThumbnailSize(java.lang.Long screenId,
Holder<java.lang.Long> size,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Returns size in bytes and dimensions in pixels of a saved thumbnail bitmap from saved state. |
byte[] |
readLog(java.lang.Long idx,
java.lang.Long offset,
java.lang.Long size)
Reads the VM log file. |
byte[] |
readSavedScreenshotPNGToArray(java.lang.Long screenId,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Screenshot in PNG format is retrieved to an array of bytes. |
byte[] |
readSavedThumbnailPNGToArray(java.lang.Long screenId,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Thumbnail in PNG format is retrieved to an array of bytes. |
byte[] |
readSavedThumbnailToArray(java.lang.Long screenId,
java.lang.Boolean BGR,
Holder<java.lang.Long> width,
Holder<java.lang.Long> height)
Thumbnail is retrieved to an array of bytes in uncompressed 32-bit BGRA or RGBA format. |
void |
removeAllCPUIDLeaves()
Removes all the virtual CPU cpuid leaves |
void |
removeCPUIDLeaf(java.lang.Long id)
Removes the virtual CPU cpuid leaf for the specified index |
void |
removeSharedFolder(java.lang.String name)
Removes the permanent shared folder with the given name previously created by createSharedFolder(String,String,Boolean,Boolean) from the collection of
shared folders and stops sharing it. |
void |
removeStorageController(java.lang.String name)
Removes a storage controller from the machine. |
void |
saveSettings()
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 saveSettings() or discardSettings() . |
void |
setAccelerate2DVideoEnabled(java.lang.Boolean value)
This setting determines whether VirtualBox allows this machine to make use of the 2D video acceleration support available on the host. |
void |
setAccelerate3DEnabled(java.lang.Boolean value)
This setting determines whether VirtualBox allows this machine to make use of the 3D graphics support available on the host. |
void |
setBandwidthGroupForDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
IBandwidthGroup bandwidthGroup)
Sets the bandwidth group of an existing storage device. |
void |
setBootOrder(java.lang.Long position,
DeviceType device)
Puts the given device to the specified position in the boot order. |
void |
setChipsetType(ChipsetType value)
Chipset type used in this VM. |
void |
setClipboardMode(ClipboardMode value)
Synchronization mode between the host OS clipboard and the guest OS clipboard. |
void |
setCPUCount(java.lang.Long value)
Number of virtual CPUs in the VM. |
void |
setCPUExecutionCap(java.lang.Long value)
Means to limit the number of CPU cycles a guest can use. |
void |
setCPUHotPlugEnabled(java.lang.Boolean value)
This setting determines whether VirtualBox allows CPU hotplugging for this machine. |
void |
setCPUIDLeaf(java.lang.Long id,
java.lang.Long valEax,
java.lang.Long valEbx,
java.lang.Long valEcx,
java.lang.Long valEdx)
Sets the virtual CPU cpuid information for the specified leaf. |
void |
setCPUProperty(CPUPropertyType property,
java.lang.Boolean value)
Sets the virtual CPU boolean value of the specified property. |
void |
setDescription(java.lang.String value)
Description of the virtual machine. |
void |
setEmulatedUSBCardReaderEnabled(java.lang.Boolean value)
|
void |
setEmulatedUSBWebcameraEnabled(java.lang.Boolean value)
|
void |
setExtraData(java.lang.String key,
java.lang.String value)
Sets associated machine-specific extra data. |
void |
setFaultToleranceAddress(java.lang.String value)
The address the fault tolerance source or target. |
void |
setFaultTolerancePassword(java.lang.String value)
The password to check for on the standby VM. |
void |
setFaultTolerancePort(java.lang.Long value)
The TCP port the fault tolerance source or target will use for communication. |
void |
setFaultToleranceState(FaultToleranceState value)
Fault tolerance state; disabled, source or target. |
void |
setFaultToleranceSyncInterval(java.lang.Long value)
The interval in ms used for syncing the state between source and target. |
void |
setFirmwareType(FirmwareType value)
Type of firmware (such as legacy BIOS or EFI), used for initial bootstrap in this VM. |
void |
setGuestProperty(java.lang.String property,
java.lang.String value,
java.lang.String flags)
Sets, changes or deletes an entry in the machine's guest property store. |
void |
setGuestPropertyNotificationPatterns(java.lang.String value)
A comma-separated list of simple glob patterns. |
void |
setGuestPropertyValue(java.lang.String property,
java.lang.String value)
Sets, changes or deletes a value in the machine's guest property store. |
void |
setHardwareUUID(java.lang.String value)
The UUID presented to the guest via memory tables, hardware and guest properties. |
void |
setHardwareVersion(java.lang.String value)
Hardware version identifier. |
void |
setHpetEnabled(java.lang.Boolean value)
This attribute controls if High Precision Event Timer (HPET) is enabled in this VM. |
void |
setHWVirtExProperty(HWVirtExPropertyType property,
java.lang.Boolean value)
Sets a new value for the specified hardware virtualization boolean property. |
void |
setIoCacheEnabled(java.lang.Boolean value)
When set to true, the builtin I/O cache of the virtual machine will be enabled. |
void |
setIoCacheSize(java.lang.Long value)
Maximum size of the I/O cache in MB. |
void |
setKeyboardHidType(KeyboardHidType value)
Type of keyboard HID used in this VM. |
void |
setMemoryBalloonSize(java.lang.Long value)
Memory balloon size in megabytes. |
void |
setMemorySize(java.lang.Long value)
System memory size in megabytes. |
void |
setMonitorCount(java.lang.Long value)
Number of virtual monitors. |
void |
setName(java.lang.String value)
Name of the virtual machine. |
void |
setOSTypeId(java.lang.String value)
User-defined identifier of the Guest OS type. |
void |
setPageFusionEnabled(java.lang.Boolean value)
This setting determines whether VirtualBox allows page fusion for this machine (64 bits host only). |
void |
setPointingHidType(PointingHidType value)
Type of pointing HID (such as mouse or tablet) used in this VM. |
void |
setRTCUseUTC(java.lang.Boolean value)
When set to true, the RTC device of the virtual machine will run in UTC time, otherwise in local time. |
void |
setSnapshotFolder(java.lang.String value)
Full path to the directory used to store snapshot data (differencing media and saved state files) of this machine. |
void |
setStorageControllerBootable(java.lang.String name,
java.lang.Boolean bootable)
Sets the bootable flag of the storage controller with the given name. |
void |
setTeleporterAddress(java.lang.String value)
The address the target teleporter will listen on. |
void |
setTeleporterEnabled(java.lang.Boolean value)
When set to true, the virtual machine becomes a target teleporter the next time it is powered on. |
void |
setTeleporterPassword(java.lang.String value)
The password to check for on the target teleporter. |
void |
setTeleporterPort(java.lang.Long value)
The TCP port the target teleporter will listen for incoming teleportations on. |
void |
setVRAMSize(java.lang.Long value)
Video memory size in megabytes. |
java.lang.Long |
showConsoleWindow()
Activates the console window and brings it to foreground on the desktop of the host PC. |
void |
temporaryEjectDevice(java.lang.String name,
java.lang.Integer controllerPort,
java.lang.Integer device,
java.lang.Boolean temporaryEject)
Sets the behavior for guest-triggered medium eject. |
java.util.List<IMedium> |
unregister(CleanupMode cleanupMode)
Unregisters a machine previously registered with IVirtualBox.registerMachine(org.virtualbox_4_1.IMachine) and optionally do additional
cleanup before the machine is unregistered. |
Methods inherited from class org.virtualbox_4_1.IUnknown |
---|
getRemoteWSPort, getWrapped, releaseRemote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IMachine(java.lang.String wrapped, org.virtualbox_4_1.jaxws.VboxPortType port)
Method Detail |
---|
public IVirtualBox getParent()
public java.lang.Boolean getAccessible()
getAccessError()
property may be used to get the
detailed error information describing the reason of
inaccessibility, including XML error messages.
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
unregister(org.virtualbox_4_1.CleanupMode)
call (or, to check
for the accessibility state once more by querying this
property).
NOTE:
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.
public IVirtualBoxErrorInfo getAccessError()
getAccessible()
returned false (i.e. the
machine is currently inaccessible). Otherwise, a null
IVirtualBoxErrorInfo object will be returned.
public java.lang.String getName()
saveSettings()
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:
saveSettings()
is called.
saveSettings()
will return an appropriate error message explaining the exact
reason and the changes you made to this machine will not be saved.
Starting with VirtualBox 4.0, a ".vbox" extension of the settings
file is recommended, but not enforced. (Previous versions always
used a generic ".xml" extension.)
public void setName(java.lang.String value)
saveSettings()
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:
saveSettings()
is called.
saveSettings()
will return an appropriate error message explaining the exact
reason and the changes you made to this machine will not be saved.
Starting with VirtualBox 4.0, a ".vbox" extension of the settings
file is recommended, but not enforced. (Previous versions always
used a generic ".xml" extension.)
value
- Stringpublic java.lang.String getDescription()
public void setDescription(java.lang.String value)
value
- Stringpublic java.lang.String getId()
public java.lang.String getOSTypeId()
IVirtualBox.getGuestOSType(String)
to obtain
an IGuestOSType object representing details about the given
Guest OS type.
NOTE:
This value may differ from the value returned by
IGuest.getOSTypeId()
if Guest Additions are
installed to the guest OS.
public void setOSTypeId(java.lang.String value)
IVirtualBox.getGuestOSType(String)
to obtain
an IGuestOSType object representing details about the given
Guest OS type.
NOTE:
This value may differ from the value returned by
IGuest.getOSTypeId()
if Guest Additions are
installed to the guest OS.
value
- Stringpublic java.lang.String getHardwareVersion()
public void setHardwareVersion(java.lang.String value)
value
- Stringpublic java.lang.String getHardwareUUID()
public void setHardwareUUID(java.lang.String value)
value
- Stringpublic java.lang.Long getCPUCount()
public void setCPUCount(java.lang.Long value)
value
- Longpublic java.lang.Boolean getCPUHotPlugEnabled()
public void setCPUHotPlugEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Long getCPUExecutionCap()
public void setCPUExecutionCap(java.lang.Long value)
value
- Longpublic java.lang.Long getMemorySize()
public void setMemorySize(java.lang.Long value)
value
- Longpublic java.lang.Long getMemoryBalloonSize()
public void setMemoryBalloonSize(java.lang.Long value)
value
- Longpublic java.lang.Boolean getPageFusionEnabled()
public void setPageFusionEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Long getVRAMSize()
public void setVRAMSize(java.lang.Long value)
value
- Longpublic java.lang.Boolean getAccelerate3DEnabled()
public void setAccelerate3DEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Boolean getAccelerate2DVideoEnabled()
public void setAccelerate2DVideoEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Long getMonitorCount()
public void setMonitorCount(java.lang.Long value)
value
- Longpublic IBIOSSettings getBIOSSettings()
public FirmwareType getFirmwareType()
public void setFirmwareType(FirmwareType value)
value
- org.virtualbox_4_1.FirmwareTypepublic PointingHidType getPointingHidType()
public void setPointingHidType(PointingHidType value)
value
- org.virtualbox_4_1.PointingHidTypepublic KeyboardHidType getKeyboardHidType()
public void setKeyboardHidType(KeyboardHidType value)
value
- org.virtualbox_4_1.KeyboardHidTypepublic java.lang.Boolean getHpetEnabled()
public void setHpetEnabled(java.lang.Boolean value)
value
- Booleanpublic ChipsetType getChipsetType()
public void setChipsetType(ChipsetType value)
value
- org.virtualbox_4_1.ChipsetTypepublic java.lang.String getSnapshotFolder()
getSettingsFilePath()
>/<getId()
>.
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.
NOTE:
Setting this property to null or to an empty string will restore
the initial value.
NOTE:
When setting this property, the specified path can be
absolute (full path) or relative to the directory where the
getSettingsFilePath()
is located. When reading this property, a full path is
always returned.
NOTE:
The specified path may not exist, it will be created
when necessary.
public void setSnapshotFolder(java.lang.String value)
getSettingsFilePath()
>/<getId()
>.
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.
NOTE:
Setting this property to null or to an empty string will restore
the initial value.
NOTE:
When setting this property, the specified path can be
absolute (full path) or relative to the directory where the
getSettingsFilePath()
is located. When reading this property, a full path is
always returned.
NOTE:
The specified path may not exist, it will be created
when necessary.
value
- Stringpublic IVRDEServer getVRDEServer()
public java.lang.Boolean getEmulatedUSBWebcameraEnabled()
public void setEmulatedUSBWebcameraEnabled(java.lang.Boolean value)
public java.lang.Boolean getEmulatedUSBCardReaderEnabled()
public void setEmulatedUSBCardReaderEnabled(java.lang.Boolean value)
public java.util.List<IMediumAttachment> getMediumAttachments()
public IUSBController getUSBController()
public IAudioAdapter getAudioAdapter()
public java.util.List<IStorageController> getStorageControllers()
public java.lang.String getSettingsFilePath()
public java.lang.Boolean getSettingsModified()
ISession.getMachine()
and on new machines
created by IVirtualBox.createMachine(String,String,String,String,Boolean)
or opened
by IVirtualBox.openMachine(String)
but not
yet registered, or on unregistered machines after calling
unregister(org.virtualbox_4_1.CleanupMode)
. For all other
cases, the settings can never be modified.
NOTE:
For newly created unregistered machines, the value of this
property is always true until saveSettings()
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).
public SessionState getSessionState()
public java.lang.String getSessionType()
getSessionState()
is
Spawning or Locked, this attribute contains the
same value as passed to the
launchVMProcess(org.virtualbox_4_1.ISession,String,String)
method in the
type parameter. If the session was used with
lockMachine(org.virtualbox_4_1.ISession,org.virtualbox_4_1.LockType)
, or if
getSessionState()
is SessionClosed, the value of this
attribute is an empty string.
public java.lang.Long getSessionPid()
lockMachine(org.virtualbox_4_1.ISession,org.virtualbox_4_1.LockType)
call. The returned
value is only valid if getSessionState()
is Locked or
Unlocking by the time this property is read.
public MachineState getState()
public java.lang.Long getLastStateChange()
public java.lang.String getStateFilePath()
MachineState.Saved
state.
NOTE:
When the machine is not in the Saved state, this attribute is
an empty string.
public java.lang.String getLogFolder()
public ISnapshot getCurrentSnapshot()
IConsole.takeSnapshot(String,String)
,
IConsole.deleteSnapshot(String)
or IConsole.restoreSnapshot(org.virtualbox_4_1.ISnapshot)
, depending on which
was called last. See ISnapshot
for details.
public java.lang.Long getSnapshotCount()
public java.lang.Boolean getCurrentStateModified()
IConsole.restoreSnapshot(org.virtualbox_4_1.ISnapshot)
IConsole.takeSnapshot(String,String)
(issued on a
"powered off" or "saved" machine, for which
getSettingsModified()
returns false)
public java.util.List<ISharedFolder> getSharedFolders()
createSharedFolder(String,String,Boolean,Boolean)
. Existing shared folders can be
removed using removeSharedFolder(String)
.
public ClipboardMode getClipboardMode()
public void setClipboardMode(ClipboardMode value)
value
- org.virtualbox_4_1.ClipboardModepublic java.lang.String getGuestPropertyNotificationPatterns()
IGuestPropertyChangedEvent
signal.
public void setGuestPropertyNotificationPatterns(java.lang.String value)
IGuestPropertyChangedEvent
signal.
value
- Stringpublic java.lang.Boolean getTeleporterEnabled()
public void setTeleporterEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Long getTeleporterPort()
public void setTeleporterPort(java.lang.Long value)
value
- Longpublic java.lang.String getTeleporterAddress()
public void setTeleporterAddress(java.lang.String value)
value
- Stringpublic java.lang.String getTeleporterPassword()
public void setTeleporterPassword(java.lang.String value)
value
- Stringpublic FaultToleranceState getFaultToleranceState()
public void setFaultToleranceState(FaultToleranceState value)
value
- org.virtualbox_4_1.FaultToleranceStatepublic java.lang.Long getFaultTolerancePort()
public void setFaultTolerancePort(java.lang.Long value)
value
- Longpublic java.lang.String getFaultToleranceAddress()
public void setFaultToleranceAddress(java.lang.String value)
value
- Stringpublic java.lang.String getFaultTolerancePassword()
public void setFaultTolerancePassword(java.lang.String value)
value
- Stringpublic java.lang.Long getFaultToleranceSyncInterval()
public void setFaultToleranceSyncInterval(java.lang.Long value)
value
- Longpublic java.lang.Boolean getRTCUseUTC()
public void setRTCUseUTC(java.lang.Boolean value)
value
- Booleanpublic java.lang.Boolean getIoCacheEnabled()
public void setIoCacheEnabled(java.lang.Boolean value)
value
- Booleanpublic java.lang.Long getIoCacheSize()
public void setIoCacheSize(java.lang.Long value)
value
- Longpublic IBandwidthControl getBandwidthControl()
public java.util.List<IPciDeviceAttachment> getPciDeviceAssignments()
IConsole.getAttachedPciDevices()
attribute, as this attribute
is intended to list only devices additional to what described in
virtual hardware config. Usually, this list keeps host's physical
devices assigned to the particular machine.
public static IMachine queryInterface(IUnknown obj)
public void lockMachine(ISession session, LockType lockType)
ISession.getMachine()
attribute.
ISession.getType()
, which will have been
set to either WriteLock or Shared.
IConsole
object which controls VM execution.
Also in all of the above cases, one must always call
ISession.unlockMachine()
to release the lock on the machine, or
the machine's state will eventually be set to "Aborted".
To change settings on a machine, the following sequence is typically
performed:
ISession.getMachine()
.saveSettings()
.ISession.unlockMachine()
.
session
- Session object for which the machine will be locked.lockType
- If set to Write, then attempt to acquire an exclusive write lock or fail.
If set to Shared, then either acquire an exclusive write lock or establish
a link to an existing session.
Expected result codes:
E_UNEXPECTED | Virtual machine not registered. |
E_ACCESSDENIED | Process not started by OpenRemoteSession. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Session already open or being opened. |
@link ::VBOX_E_VM_ERROR VBOX_E_VM_ERROR | Failed to assign machine to session. |
public IProgress launchVMProcess(ISession session, java.lang.String type, java.lang.String environment)
IConsole
object which can be used
to control machine execution, but it cannot be used to change all VM settings
which would be available after a lockMachine(org.virtualbox_4_1.ISession,org.virtualbox_4_1.LockType)
call.
The caller must eventually release the session's shared lock by calling
ISession.unlockMachine()
on the local session object once this call
has returned. However, the session's state (see ISession.getState()
)
will not return to "Unlocked" until the remote session has also unlocked
the machine (i.e. the machine has stopped running).
Launching a VM process can take some time (a new VM is started in a new process,
for which memory and other resources need to be set up). Because of this,
an IProgress
object is returned to allow the caller to wait
for this asynchronous operation to be completed. Until then, the caller's
session object remains in the "Unlocked" state, and its ISession.getMachine()
and ISession.getConsole()
attributes cannot be accessed.
It is recommended to use IProgress.waitForCompletion(Integer)
or
similar calls to wait for completion. Completion is signalled when the VM
is powered on. If launching the VM fails, error messages can be queried
via the progress object, if available.
The progress object will have at least 2 sub-operations. The first
operation covers the period up to the new VM process calls powerUp.
The subsequent operations mirror the IConsole.powerUp()
progress object. Because IConsole.powerUp()
may require
some extra sub-operations, the IProgress.getOperationCount()
may change at the completion of operation.
For details on the teleportation progress operation, see
IConsole.powerUp()
.
The environment argument is a string containing definitions of
environment variables in the following format:
NAME[=VALUE]\n NAME[=VALUE]\n ...where \\n is the new line character. These environment variables will be appended to the environment of the VirtualBox server process. If an environment variable exists both in the server process and in this list, the value from this list takes precedence over the server's variable. If the value of the environment variable is omitted, this variable will be removed from the resulting environment. If the environment string is null or empty, the server environment is inherited by the started process as is.
session
- Client session object to which the VM process will be connected (this
must be in "Unlocked" state).type
- Front-end to use for the new VM process. The following are currently supported:
environment
- Environment to pass to the VM process.
E_UNEXPECTED | Virtual machine not registered. |
E_INVALIDARG | Invalid session type type. |
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | No machine matching machineId found. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Session already open or being opened. |
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR | Launching process for machine failed. |
@link ::VBOX_E_VM_ERROR VBOX_E_VM_ERROR | Failed to assign machine to session. |
public void setBootOrder(java.lang.Long position, DeviceType device)
DeviceType.Null
should be used.
TODO setHardDiskBootOrder(), setNetworkBootOrder()
position
- Position in the boot order ( 1 to the total number of
devices the machine can boot from, as returned by
ISystemProperties.getMaxBootPosition()
).device
- The type of the device used to boot at the given position.
Expected result codes:
E_INVALIDARG | Boot position out of range. |
E_NOTIMPL | Booting from USB device currently not supported. |
public DeviceType getBootOrder(java.lang.Long position)
DeviceType.Null
is returned.
TODO getHardDiskBootOrder(), getNetworkBootOrder()
position
- Position in the boot order ( 1 to the total number of
devices the machine can boot from, as returned by
ISystemProperties.getMaxBootPosition()
).
E_INVALIDARG | Boot position out of range. |
public void attachDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, DeviceType type, IMedium medium)
IStorageController
, identified by name),
at the indicated port and device.
This method is intended for managing storage devices in general while a
machine is powered off. It can be used to attach and detach fixed
and removable media. The following kind of media can be attached
to a machine:
IVirtualBox.openMedium(String,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.AccessMode,Boolean)
.
IHost.getDVDDrives()
and IHost.getFloppyDrives()
arrays to indicate a host drive.
For removable devices, you can also use mountMedium(String,Integer,Integer,org.virtualbox_4_1.IMedium,Boolean)
to change the media while the machine is running.
IMediumAttachment
will appear in the machine's list of medium
attachments (see getMediumAttachments()
).
See IMedium
and IMediumAttachment
for more
information about attaching media.
The specified device slot must not have a device attached to it,
or this method will fail.
name
- Name of the storage controller to attach the device to.controllerPort
- Port to attach the device to. For an IDE controller, 0 specifies
the primary controller and 1 specifies the secondary controller.
For a SCSI controller, this must range from 0 to 15; for a SATA controller,
from 0 to 29; for an SAS controller, from 0 to 7.device
- Device slot in the given port to attach the device to. This is only
relevant for IDE controllers, for which 0 specifies the master device and
1 specifies the slave device. For all other controller types, this must
be 0.type
- Device type of the attached device. For media opened by
IVirtualBox.openMedium(String,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.AccessMode,Boolean)
, this must match the device type
specified there.medium
- Medium to mount or NULL for an empty drive.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range, or file or UUID not found. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Machine must be registered before media can be attached. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
@link ::VBOX_E_OBJECT_IN_USE VBOX_E_OBJECT_IN_USE | A medium is already attached to this or another virtual machine. |
saveSettings()
.
NOTE:
If the medium is being attached indirectly, a new differencing medium
will implicitly be created for it and attached instead. If the
changes made to the machine settings (including this indirect
attachment) are later cancelled using discardSettings()
,
this implicitly created differencing medium will implicitly
be deleted.public void detachDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device)
saveSettings()
call. See IMedium
for more detailed information about attaching media.
name
- Name of the storage controller to detach the medium from.controllerPort
- Port number to detach the medium from.device
- Device slot number to detach the medium from.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Attempt to detach medium from a running virtual machine. |
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | No medium attached to given slot/bus. |
@link ::VBOX_E_NOT_SUPPORTED VBOX_E_NOT_SUPPORTED | Medium format does not support storage deletion. |
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for the indirect attachment using this
method will not implicitly delete them. The
IMedium.deleteStorage()
operation should be
explicitly performed by the caller after the medium is successfully
detached and the settings are saved with
saveSettings()
, if it is the desired action.public void passthroughDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, java.lang.Boolean passthrough)
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for how to attach a new device.
The controllerPort and device parameters specify the device slot and
have have the same meaning as with attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
.
name
- Name of the storage controller.controllerPort
- Storage controller port.device
- Device slot in the given port.passthrough
- New value for the passthrough setting.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Attempt to modify an unregistered virtual machine. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
public void temporaryEjectDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, java.lang.Boolean temporaryEject)
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for how to
attach a new device.
The controllerPort and device parameters specify the device slot and
have have the same meaning as with attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
.
name
- Name of the storage controller.controllerPort
- Storage controller port.device
- Device slot in the given port.temporaryEject
- New value for the eject behavior.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Attempt to modify an unregistered virtual machine. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
public void nonRotationalDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, java.lang.Boolean nonRotational)
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for how to attach a new device.
The controllerPort and device parameters specify the device slot and
have have the same meaning as with attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
.
name
- Name of the storage controller.controllerPort
- Storage controller port.device
- Device slot in the given port.nonRotational
- New value for the non-rotational device flag.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Attempt to modify an unregistered virtual machine. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
public void setBandwidthGroupForDevice(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, IBandwidthGroup bandwidthGroup)
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for how to attach a new device.
The controllerPort and device parameters specify the device slot and
have have the same meaning as with attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
.
name
- Name of the storage controller.controllerPort
- Storage controller port.device
- Device slot in the given port.bandwidthGroup
- New value for the bandwidth group or NULL for no group.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Attempt to modify an unregistered virtual machine. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
public void mountMedium(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device, IMedium medium, java.lang.Boolean force)
IMedium
, identified
by the given UUID id) to the given storage controller
(IStorageController
, identified by name),
at the indicated port and device. The device must already exist;
see attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
for how to attach a new device.
This method is intended only for managing removable media, where the
device is fixed but media is changeable at runtime (such as DVDs
and floppies). It cannot be used for fixed media such as hard disks.
The controllerPort and device parameters specify the device slot and
have have the same meaning as with attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
.
The specified device slot can have a medium mounted, which will be
unmounted first. Specifying a zero UUID (or an empty string) for
medium does just an unmount.
See IMedium
for more detailed information about
attaching media.
name
- Name of the storage controller to attach the medium to.controllerPort
- Port to attach the medium to.device
- Device slot in the given port to attach the medium to.medium
- Medium to mount or NULL for an empty drive.force
- Allows to force unmount/mount of a medium which is locked by
the device slot in the given port to attach the medium to.
Expected result codes:
E_INVALIDARG | SATA device, SATA port, IDE port or IDE slot out of range. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Attempt to attach medium to an unregistered virtual machine. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Invalid machine state. |
@link ::VBOX_E_OBJECT_IN_USE VBOX_E_OBJECT_IN_USE | Medium already attached to this or another virtual machine. |
public IMedium getMedium(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device)
mountMedium(String,Integer,Integer,org.virtualbox_4_1.IMedium,Boolean)
to the given device slot then this
method will return not the same object as passed to the
mountMedium(String,Integer,Integer,org.virtualbox_4_1.IMedium,Boolean)
call. See IMedium
for
more detailed information about mounting a medium.
name
- Name of the storage controller the medium is attached to.controllerPort
- Port to query.device
- Device slot in the given port to query.
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | No medium attached to given slot/bus. |
public java.util.List<IMediumAttachment> getMediumAttachmentsOfController(java.lang.String name)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | A storage controller with given name doesn't exist. |
public IMediumAttachment getMediumAttachment(java.lang.String name, java.lang.Integer controllerPort, java.lang.Integer device)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | No attachment exists for the given controller/port/device combination. |
public void attachHostPciDevice(java.lang.Integer hostAddress, java.lang.Integer desiredGuestAddress, java.lang.Boolean tryToUnbind)
hostAddress
- Address of the host PCI device.desiredGuestAddress
- Desired position of this device on guest PCI bus.tryToUnbind
- If VMM shall try to unbind existing drivers from the
device before attaching it to the guest.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine state is not stopped (PCI hotplug not yet implemented). |
@link ::VBOX_E_PDM_ERROR VBOX_E_PDM_ERROR | Virtual machine does not have a PCI controller allowing attachment of physical devices. |
@link ::VBOX_E_NOT_SUPPORTED VBOX_E_NOT_SUPPORTED | Hardware or host OS doesn't allow PCI device passthrought. |
IHostPciDevicePlugEvent
public void detachHostPciDevice(java.lang.Integer hostAddress)
hostAddress
- Address of the host PCI device.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine state is not stopped (PCI hotplug not yet implemented). |
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | This host device is not attached to this machine. |
@link ::VBOX_E_PDM_ERROR VBOX_E_PDM_ERROR | Virtual machine does not have a PCI controller allowing attachment of physical devices. |
@link ::VBOX_E_NOT_SUPPORTED VBOX_E_NOT_SUPPORTED | Hardware or host OS doesn't allow PCI device passthrought. |
IHostPciDevicePlugEvent
public INetworkAdapter getNetworkAdapter(java.lang.Long slot)
ISystemProperties.getMaxNetworkAdapters(org.virtualbox_4_1.ChipsetType)
property,
so the maximum slot number is one less than that property's value.
Expected result codes:
E_INVALIDARG | Invalid slot number. |
public IStorageController addStorageController(java.lang.String name, StorageBus connectionType)
IStorageController
.
name identifies the controller for subsequent calls such as
getStorageControllerByName(String)
,
getStorageControllerByInstance(Long)
,
removeStorageController(String)
,
attachDevice(String,Integer,Integer,org.virtualbox_4_1.DeviceType,org.virtualbox_4_1.IMedium)
or mountMedium(String,Integer,Integer,org.virtualbox_4_1.IMedium,Boolean)
.
After the controller has been added, you can set its exact
type by setting the IStorageController.getControllerType()
.
Expected result codes:
@link ::VBOX_E_OBJECT_IN_USE VBOX_E_OBJECT_IN_USE | A storage controller with given name exists already. |
E_INVALIDARG | Invalid controllerType. |
public IStorageController getStorageControllerByName(java.lang.String name)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | A storage controller with given name doesn't exist. |
public IStorageController getStorageControllerByInstance(java.lang.Long instance)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | A storage controller with given instance number doesn't exist. |
public void removeStorageController(java.lang.String name)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | A storage controller with given name doesn't exist. |
public void setStorageControllerBootable(java.lang.String name, java.lang.Boolean bootable)
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | A storage controller with given name doesn't exist. |
@link ::VBOX_E_OBJECT_IN_USE VBOX_E_OBJECT_IN_USE | Another storage controller is marked as bootable already. |
public ISerialPort getSerialPort(java.lang.Long slot)
ISystemProperties.getSerialPortCount()
property,
so the maximum slot number is one less than that property's value.
Expected result codes:
E_INVALIDARG | Invalid slot number. |
public IParallelPort getParallelPort(java.lang.Long slot)
ISystemProperties.getParallelPortCount()
property,
so the maximum slot number is one less than that property's value.
Expected result codes:
E_INVALIDARG | Invalid slot number. |
public java.util.List<java.lang.String> getExtraDataKeys()
public java.lang.String getExtraData(java.lang.String key)
key
- Name of the data key to get.
@link ::VBOX_E_FILE_ERROR VBOX_E_FILE_ERROR | Settings file not accessible. |
@link ::VBOX_E_XML_ERROR VBOX_E_XML_ERROR | Could not parse the settings file. |
public void setExtraData(java.lang.String key, java.lang.String value)
key
- Name of the data key to set.value
- Value to assign to the key.
Expected result codes:
@link ::VBOX_E_FILE_ERROR VBOX_E_FILE_ERROR | Settings file not accessible. |
@link ::VBOX_E_XML_ERROR VBOX_E_XML_ERROR | Could not parse the settings file. |
IExtraDataCanChangeEvent
notification for a permission. If one of the listeners refuses the
new value, the change will not be performed.
NOTE:
On success, the
IExtraDataChangedEvent
notification
is called to inform all registered listeners about a successful data
change.
NOTE:
This method can be called outside the machine session and therefore
it's a caller's responsibility to handle possible race conditions
when several clients change the same key at the same time.public java.lang.Boolean getCPUProperty(CPUPropertyType property)
property
- Property type to query.
E_INVALIDARG | Invalid property. |
public void setCPUProperty(CPUPropertyType property, java.lang.Boolean value)
property
- Property type to query.value
- Property value.
Expected result codes:
E_INVALIDARG | Invalid property. |
public void getCPUIDLeaf(java.lang.Long id, Holder<java.lang.Long> valEax, Holder<java.lang.Long> valEbx, Holder<java.lang.Long> valEcx, Holder<java.lang.Long> valEdx)
id
- CPUID leaf index.valEax
- CPUID leaf value for register eax.valEbx
- CPUID leaf value for register ebx.valEcx
- CPUID leaf value for register ecx.valEdx
- CPUID leaf value for register edx.
Expected result codes:
E_INVALIDARG | Invalid id. |
public void setCPUIDLeaf(java.lang.Long id, java.lang.Long valEax, java.lang.Long valEbx, java.lang.Long valEcx, java.lang.Long valEdx)
id
- CPUID leaf index.valEax
- CPUID leaf value for register eax.valEbx
- CPUID leaf value for register ebx.valEcx
- CPUID leaf value for register ecx.valEdx
- CPUID leaf value for register edx.
Expected result codes:
E_INVALIDARG | Invalid id. |
public void removeCPUIDLeaf(java.lang.Long id)
id
- CPUID leaf index.
Expected result codes:
E_INVALIDARG | Invalid id. |
public void removeAllCPUIDLeaves()
public java.lang.Boolean getHWVirtExProperty(HWVirtExPropertyType property)
property
- Property type to query.
E_INVALIDARG | Invalid property. |
public void setHWVirtExProperty(HWVirtExPropertyType property, java.lang.Boolean value)
property
- Property type to set.value
- New property value.
Expected result codes:
E_INVALIDARG | Invalid property. |
public void saveSettings()
saveSettings()
or discardSettings()
.
For registered machines, new settings become visible to all
other VirtualBox clients after successful invocation of this
method.
Expected result codes:
@link ::VBOX_E_FILE_ERROR VBOX_E_FILE_ERROR | Settings file not accessible. |
@link ::VBOX_E_XML_ERROR VBOX_E_XML_ERROR | Could not parse the settings file. |
E_ACCESSDENIED | Modification request refused. |
IMachineDataChangedEvent
notification event after the configuration has been successfully
saved (only for registered machines).
NOTE:
Calling this method is only valid on instances returned
by ISession.getMachine()
and on new machines
created by IVirtualBox.createMachine(String,String,String,String,Boolean)
but not
yet registered, or on unregistered machines after calling
unregister(org.virtualbox_4_1.CleanupMode)
.
public void discardSettings()
saveSettings()
or discardSettings()
.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine is not mutable. |
ISession.getMachine()
and on new machines
created by IVirtualBox.createMachine(String,String,String,String,Boolean)
or
opened by IVirtualBox.openMachine(String)
but not
yet registered, or on unregistered machines after calling
unregister(org.virtualbox_4_1.CleanupMode)
.
public java.util.List<IMedium> unregister(CleanupMode cleanupMode)
IVirtualBox.registerMachine(org.virtualbox_4_1.IMachine)
and optionally do additional
cleanup before the machine is unregistered.
This method does not delete any files. It only changes the machine configuration and
the list of registered machines in the VirtualBox object. To delete the files which
belonged to the machine, including the XML file of the machine itself, call
delete(List)
, optionally with the array of IMedium objects which was returned
from this method.
How thoroughly this method cleans up the machine configuration before unregistering
the machine depends on the cleanupMode argument.
IMediumAttachment
).
It is the responsibility of the caller to delete all such configuration in this mode.
In this mode, the API behaves like the former IVirtualBox::unregisterMachine() API
which it replaces.delete(List)
API for closing and deletion.delete(List)
in that case because users will typically want to preserve ISO and RAW image files.delete(List)
. This way, the machine is completely
deleted with all its saved states and hard disk images, but images for removable
drives (such as ISO and RAW files) will remain on disk.
This API does not verify whether the media files returned in the array are still
attached to other machines (i.e. shared between several machines). If such a shared
image is passed to delete(List)
however, closing the image will fail there
and the image will be silently skipped.
This API may, however, move media from this machine's media registry to other media
registries (see IMedium
for details on media registries). For machines
created with VirtualBox 4.0 or later, if media from this machine's media registry
are also attached to another machine (shared attachments), each such medium will be
moved to another machine's registry. This is because without this machine's media
registry, the other machine cannot find its media any more and would become inaccessible.
This API implicitly calls saveSettings()
to save all current machine settings
before unregistering it. It may also silently call saveSettings()
on other machines
if media are moved to other machines' media registries.
After successful method invocation, the IMachineRegisteredEvent
event
is fired.
The call will fail if the machine is currently locked (see ISession
).
cleanupMode
- How to clean up after the machine has been unregistered.
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Machine is currently locked for a session. |
getAccessible()
), 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.public IProgress delete(java.util.List<IMedium> aMedia)
unregister(org.virtualbox_4_1.CleanupMode)
call.
This method must only be called on machines which are either write-locked (i.e. on instances
returned by ISession.getMachine()
) or on unregistered machines (i.e. not yet
registered machines created by IVirtualBox.createMachine(String,String,String,String,Boolean)
or opened by
IVirtualBox.openMachine(String)
, or after having called unregister(org.virtualbox_4_1.CleanupMode)
).
The following files will be deleted by this method:
unregister(org.virtualbox_4_1.CleanupMode)
had been previously called with a cleanupMode
argument other than "UnregisterOnly", this will delete all saved state files that
the machine had in use; possibly one if the machine was in "Saved" state and one
for each online snapshot that the machine had.IMedium.close()
. If that succeeds, this will attempt to delete the
medium's storage on disk. Since the IMedium.close()
call will fail if the medium is still
in use, e.g. because it is still attached to a second machine; in that case the
storage will not be deleted.
aMedia
- List of media to be closed and whose storage files will be deleted.
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine is registered but not write-locked. |
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR | Could not delete the settings file. |
getSettingsModified()
will return true after this
method successfully returns.public IVirtualSystemDescription export(IAppliance aAppliance, java.lang.String location)
IAppliance
for the
steps required to export VirtualBox machines to OVF.
aAppliance
- Appliance to export this machine to.location
- The target location.
public ISnapshot findSnapshot(java.lang.String nameOrId)
ISnapshot.getChildren()
attribute and recurse over those children.
nameOrId
- What to search for. Name or UUID of the snapshot to find
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | Virtual machine has no snapshots or snapshot not found. |
public void createSharedFolder(java.lang.String name, java.lang.String hostPath, java.lang.Boolean writable, java.lang.Boolean automount)
ISharedFolder
to read more about logical names.
name
- Unique logical name of the shared folder.hostPath
- Full path to the shared folder in the host file system.writable
- Whether the share is writable or readonly.automount
- Whether the share gets automatically mounted by the guest
or not.
Expected result codes:
@link ::VBOX_E_OBJECT_IN_USE VBOX_E_OBJECT_IN_USE | Shared folder already exists. |
@link ::VBOX_E_FILE_ERROR VBOX_E_FILE_ERROR | Shared folder hostPath not accessible. |
public void removeSharedFolder(java.lang.String name)
createSharedFolder(String,String,Boolean,Boolean)
from the collection of
shared folders and stops sharing it.
name
- Logical name of the shared folder to remove.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine is not mutable. |
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND | Shared folder name does not exist. |
public java.lang.Boolean canShowConsoleWindow()
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine session is not open. |
public java.lang.Long showConsoleWindow()
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine session is not open. |
public void getGuestProperty(java.lang.String name, Holder<java.lang.String> value, Holder<java.lang.Long> timestamp, Holder<java.lang.String> flags)
name
- The name of the property to read.value
- The value of the property. If the property does not exist then this
will be empty.timestamp
- The time at which the property was last modified, as seen by the
server process.flags
- Additional property parameters, passed as a comma-separated list of
"name=value" type entries.
Expected result codes:
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine session is not open. |
public java.lang.String getGuestPropertyValue(java.lang.String property)
property
- The name of the property to read.
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine session is not open. |
public java.lang.Long getGuestPropertyTimestamp(java.lang.String property)
property
- The name of the property to read.
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Machine session is not open. |
public void setGuestProperty(java.lang.String property, java.lang.String value, java.lang.String flags)
property
- The name of the property to set, change or delete.value
- The new value of the property to set, change or delete. If the
property does not yet exist and value is non-empty, it will be
created. If the value is null or empty, the property will be
deleted if it exists.flags
- Additional property parameters, passed as a comma-separated list of
"name=value" type entries.
Expected result codes:
E_ACCESSDENIED | Property cannot be changed. |
E_INVALIDARG | Invalid flags. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine is not mutable or session not open. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Cannot set transient property when machine not running. |
public void setGuestPropertyValue(java.lang.String property, java.lang.String value)
property
- The name of the property to set, change or delete.value
- The new value of the property to set, change or delete. If the
property does not yet exist and value is non-empty, it will be
created. If the value is null or empty, the property will be
deleted if it exists.
Expected result codes:
E_ACCESSDENIED | Property cannot be changed. |
@link ::VBOX_E_INVALID_VM_STATE VBOX_E_INVALID_VM_STATE | Virtual machine is not mutable or session not open. |
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Cannot set transient property when machine not running. |
public void enumerateGuestProperties(java.lang.String patterns, Holder<java.util.List<java.lang.String>> name, Holder<java.util.List<java.lang.String>> value, Holder<java.util.List<java.lang.Long>> timestamp, Holder<java.util.List<java.lang.String>> flags)
patterns
- The patterns to match the properties against, separated by '|'
characters. If this is empty or null, all properties will match.name
- The names of the properties returned.value
- The values of the properties returned. The array entries match the
corresponding entries in the name array.timestamp
- The time stamps of the properties returned. The array entries match
the corresponding entries in the name array.flags
- The flags of the properties returned. The array entries match the
corresponding entries in the name array.public void querySavedGuestSize(java.lang.Long screenId, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to query info from.width
- Guest width at the time of the saved state was taken.height
- Guest height at the time of the saved state was taken.public void querySavedThumbnailSize(java.lang.Long screenId, Holder<java.lang.Long> size, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to query info from.size
- Size of buffer required to store the bitmap.width
- Bitmap width.height
- Bitmap height.public byte[] readSavedThumbnailToArray(java.lang.Long screenId, java.lang.Boolean BGR, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to read from.BGR
- How to order bytes in the pixel. A pixel consists of 4 bytes. If this parameter is true, then
bytes order is: B, G, R, 0xFF. If this parameter is false, then bytes order is: R, G, B, 0xFF.width
- Bitmap width.height
- Bitmap height.
public byte[] readSavedThumbnailPNGToArray(java.lang.Long screenId, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to read from.width
- Image width.height
- Image height.
public void querySavedScreenshotPNGSize(java.lang.Long screenId, Holder<java.lang.Long> size, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to query info from.size
- Size of buffer required to store the PNG binary data.width
- Image width.height
- Image height.public byte[] readSavedScreenshotPNGToArray(java.lang.Long screenId, Holder<java.lang.Long> width, Holder<java.lang.Long> height)
screenId
- Saved guest screen to read from.width
- Image width.height
- Image height.
public void hotPlugCPU(java.lang.Long cpu)
cpu
- The CPU id to insert.public void hotUnplugCPU(java.lang.Long cpu)
cpu
- The CPU id to remove.public java.lang.Boolean getCPUStatus(java.lang.Long cpu)
cpu
- The CPU id to check for.
public java.lang.String queryLogFilename(java.lang.Long idx)
idx
- Which log file name to query. 0=current log file.
public byte[] readLog(java.lang.Long idx, java.lang.Long offset, java.lang.Long size)
idx
- Which log file to read. 0=current log file.offset
- Offset in the log file.size
- Chunk size to read in the log file.
public IProgress cloneTo(IMachine target, CloneMode mode, java.util.List<CloneOptions> options)
IVirtualBox.createMachine(String,String,String,String,Boolean)
, and all the settings will be
transferred except the VM name and the hardware UUID. You can set the
VM name and the new hardware UUID when creating the target machine. The
network MAC addresses are newly created for all newtwork adapters. You
can change that behaviour with the options parameter. The operation is
performed asynchronously, so the machine object will be not be usable
until the progress object signals completion.
target
- Target machine object.mode
- Which states should be cloned.options
- Options for the cloning operation.
E_INVALIDARG | target is null. |
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |