Virtuozzo Virtualization SDK C API Reference
|
Creates a new console session or binds to an existing GUI session in a virtual machine.
PRL_HANDLE PrlVm_LoginInGuest( PRL_HANDLE hVm, PRL_CONST_STR sUserName, PRL_CONST_STR sUserPassword, PRL_UINT32 nFlags );
PrlApiVm.h
PRL_CURRENT_GUEST_OS_SESSION -- binds to an existing GUI session in a virtual machine.
PRL_PRIVILEGED_GUEST_OS_SESSION -- binds to an existing session under which Virtuozzo Service is running. This session belongs to a privileged user (e.g. root on Linux or LocalSystem on Windows), so it can be used to perform administrative tasks.
Note that in order to use the constants above, the current user must be an administrator of the host OS or be the owner of the target virtual machine.
A handle of type PHT_JOB containing the results of this asynchronous operation or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object.
Note: To use this function, Virtuozzo Tools must be installed in the target virtual machine.
This function is used when you want to run a program in a virtual machine or perform an administrative task that require native guest operating system login. Depending on the type of the program that you would like to run, the login must be performed using one of the following methods:
When the session is no longer needed, it should be closed using the PrlVmGuest_Logout function.
To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are:
PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.
PRL_ERR_SUCCESS - function completed successfully.
To get the PHT_VM_GUEST_SESSION handle from the returned PHT_JOB object: