IVMVirtualMachine::Startup2 method

[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]

Starts the virtual machine (VM) from either the uninitialized or saved state, with advanced options.

This method provides a mechanism to start a VM with a differencing disk even if the parent disk's timestamp has been changed.

Syntax

HRESULT Startup2(
  [in]          VMStartupOption startupOption,
  [out, retval] IVMTask         **startupTask
);

Parameters

startupOption [in]

The advanced startup option. The possible values are from the VMStartupOption enumeration.

startupTask [out, retval]

An IVMTask object that is used to track the completion progress of the start sequence.

Return value

This method can return one of these values.

Return code/value Description
S_OK
0
The operation was successful.
E_INVALIDARG
0x80000003
The startupOption parameter is not valid.
E_POINTER
0x80004003
The startupTask parameter is NULL.
HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)
0x80070005
The caller must have execute access permissions to start this VM.
VM_E_TIMED_OUT
0xA0040202
The operation did not complete in a timely manner.
VM_E_OUT_OF_RESOURCE
0xA0040203
There are not enough host resources.
VM_E_TOO_MANY_VMS
0xA0040204
There are too many active VMs.
VM_E_VM_RUNNING
0xA0040500
The VM is already running.
DISP_E_EXCEPTION
0x80020009
An unexpected error has occurred.

Remarks

The following values can be returned through the Error property of the returned IVMTask object.

Error code/Value Description
VM_E_UNSUPPORTED_HARDWARE (0xA0040950)
The hardware does not support virtualization.
VM_E_HARDWARE_VIRTUALIZATION_DISABLED (0xA0040951)
Hardware virtualization is disabled.
VM_E_VMVIRTUALPC_OLDER_VERSION (0xA0040952)
Both Virtual PC 2007 and Windows Virtual PC are installed.
VM_E_OTHER_VIRTUALIZATION_SOFTWARE (0xA0040953)
Other virtualization software is installed.
VM_E_OUT_OF_RESOURCE (0xa00400203)
There are not enough host resources.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
End of client support
Windows 7
Product
Windows Virtual PC
Header
VPCCOMInterfaces.h
IID
IID_IVMVirtualMachine is defined as f7092aa1-33ed-4f78-a59f-c00adfc2edd7

See also

IVMVirtualMachine