Share via


IVMGuestOS::SetParameter method

The SetParameter method sets a configuration parameter inside the guest operating system.

Syntax

HRESULT SetParameter(
  [in] BSTR inParameterName,
  [in] BSTR inParameterValue
);

Parameters

inParameterName [in]

The parameter name. It must be between 1 and 255 characters in length and cannot contain a backslash () character.

inParameterValue [in]

The parameter value.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The inParameter or inParameterValue parameter is not valid or not specified.
VM_E_VM_NOT_RUNNING
The virtual machine is not running.
VM_E_VM_PAUSED
The virtual machine is paused.
VM_E_ADDITIONS_FEATURE_NOT_AVAIL
Additions are not installed in this virtual machine.
DISP_E_EXCEPTION
An unexpected error occurred.

Remarks

The virtual machine must be running and Additions must be installed when this method is invoked. This method is only supported for Windows-based guest operating systems.

With Additions installed, the following key is automatically added to the guest operating system's registry:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters

When the guest operating system starts, the following registry string values are populated in the Parameters key:

  • HostName

  • PhysicalHostName

  • PhysicalHostNameFullyQualified

  • VirtualMachineName

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMGuestOS

GetParameter