Common Tasks :Connecting to the Local Host as the Current User
2012-10-19 11:17
501 查看
This option allows you to connect a Vix client to a VMware product running on the same host. You can use this option with a host running either VMware Workstation or VMware server. To allow the client to connect to either product without modifying your
code, specify VIX_SERVICEPROVIDER_DEFAULT as the value of the hostType parameter.
This option maximizes portability. You can run the client on any host machine, without limiting yourself to a particular user account and without having to specify a user account
at run time. However, you must be sure that the current user has appropriate permissions to use one or more virtual machines on the local host.
Example 3-3.
code, specify VIX_SERVICEPROVIDER_DEFAULT as the value of the hostType parameter.
This option maximizes portability. You can run the client on any host machine, without limiting yourself to a particular user account and without having to specify a user account
at run time. However, you must be sure that the current user has appropriate permissions to use one or more virtual machines on the local host.
Example 3-3.
#include "vix.h" int main(int argc, char * argv[]) { VixHandle hostHandle = VIX_INVALID_HANDLE; VixHandle jobHandle = VIX_INVALID_HANDLE; VixError err; // Connect as current user on local host. jobHandle = VixHost_Connect(VIX_API_VERSION, VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, NULL, // hostName 0, // hostPort NULL, // userName NULL, // password, 0, // options VIX_INVALID_HANDLE, // propertyListHandle NULL, // callbackProc NULL); // clientData err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; } Vix_ReleaseHandle(jobHandle); jobHandle = VIX_INVALID_HANDLE; // Other code goes here... abort: VixHost_Disconnect(hostHandle); }
相关文章推荐
- Common Tasks :Connecting to the Local Host as a Specified User
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- Common Tasks :Connecting to a Specified Host
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- 错误解决:Unable to add module to the current project as it is not of packagi
- 错误解决:Unable to add module to the current project as it is not of package
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- How to get the current user logged into Sharepoint
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- how to set a user-defined process as the system key process
- 解决问题:Cannot refer to the non-final local variable user defined in an enclosing scope
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- Unable to post the review. &&The user specified as a definer ('admin'@'localhost') does not exist
- httclient caught when connecting to the target host:Address already in use
- Unable to add module to the current project as it is not of packaging type 'pom'
- ubuntu install node0.8.9 to the current user
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- How to reset windows local user passwd, without knowing its current passwd
- Error - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)
- eclipse ERROR: Unable to add module to the current project as it is not of ...