如何 執行 一個 執行檔 在 虛擬機裡 Programmatically executing a program in a VMware machine
如何 執行 一個 執行檔 在 虛擬機裡 Programmatically executing a program in a VMware machine As reported in the documentation of the VMware API, the function you need is VixVM_RunProgramInGuest(), which requires you to authenticate on the guest OS (the OS running on the virtual machine) with VixVM_LoginInGuest(). // Authenticate for guest operations. jobHandle = VixVM_LoginInGuest(vmHandle, "vixuser", // userName "secret", // password 0, // options NULL, // callbackProc NULL // clientData ); /* https://www.vmware.com/support/developer/vix-api/vix16_reference/lang/c/functions/VixVM_LoginInGuest.html VIX_E_PROGRAM_NOT_STARTED error code. */ err = VixJob_Wait(jobHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error. goto abort; } Vix_ReleaseHandle(jobH...