public void CreateDirectory(string name) { VixCOM.IJob job = _virtualMachine.CreateDirectoryInGuest(name, null, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("CreateDirectory: " + errMsg); } }
private void WaitForToolsInGuest() { VixCOM.IJob job = _virtualMachine.WaitForToolsInGuest(0, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("WaitForToolsInGuest: " + errMsg); } }
public void LoginInGuest(string username, string password) { VixCOM.IJob job = _virtualMachine.LoginInGuest(username, password, 0, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("LoginInGuest: " + errMsg); } }
public void CopyFileToHost(string source, string destination) { VixCOM.IJob job = _virtualMachine.CopyFileFromGuestToHost(source, destination, 0, null, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("CopyFileToHost: " + errMsg); } }
public void PowerOff() { VixCOM.IJob job = _virtualMachine.PowerOff(0, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("PowerOff: " + errMsg); } }
public void RunProgramInGuest(string fullPath, string param) { VixCOM.IJob job = _virtualMachine.RunProgramInGuest(fullPath, param, 0, null, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("RunProgramInGuest: " + errMsg); } }
public void RevertToSnapshot(string snapshotName) { VixCOM.ISnapshot snapshot; _virtualMachine.GetNamedSnapshot(snapshotName, out snapshot); VixCOM.IJob job = _virtualMachine.RevertToSnapshot(snapshot, 0, null, null); UInt64 err = job.WaitWithoutResults(); if (lib.ErrorIndicatesFailure(err)) { short errCode = lib.ErrorCode(err); string errMsg; errMsg = lib.GetErrorText(err, null); throw new Exception("RevertToSnapshot: " + errMsg); } WaitForToolsInGuest(); }