Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all 34639 articles
Browse latest View live

Error code 17

$
0
0

I've called RunProgramInGuest with a REG command. The operation fails returning error code 17. This error code is not in the list in the VIX API Reference here. The error message is:

 

"The procedure returned an error. A guest may have unexpectedly stopped".

 

 

What's up with this weird error? What can cause it and how can it be fixed?

 

 

I've also tried it with a simple command like "REG /?" or "echo" but i get the same result. Also, it seems that this happens only on a specific VM. On others it works fine.

 

 


Problem with running LoginInGuest with VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT option.

$
0
0

 

Hi,

 

 

I have trouble running LoginInGuest with VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT option. I want to run a GUI apllication in VM, and need to use this option according to the vix api. But i always got 'Autenthentication failure or insufficient permission in guest operation system' error when i run RunProgramInGuest after LoginInGuest method being called.

 

 

Set job = VM.LoginInGuest(UID, PWD, VixCOM.Constants.VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT, Nothing)

err = job.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

  WScript.Echo("Error logging in: " & lib.GetErrorText(err, empty))

  WScript.Quit

End If

 

Set job = VM.RunProgramInGuest("c:\Windows\system32\CMD.exe", "/c c:\scripts\CopyAndInstall.cmd", 0, Nothing, Nothing)

err = job.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

    WScript.Echo("Error running install: " & lib.GetErrorText(err, empty))                          _      ----- error reported from here_

    host.Disconnect

    WScript.Quit

 

End If

 

 

At first i thought something wrong with RunProgramInGuest method, then i realized LoginInGuest is the one  establised the authentication context in guest OS.

 

 

Any one has seen this problem? any workaround? or any prereq account setting i need to do? By the way, the account user name and password provided to the loginInGuest method is the same one on the windows console log in prompt. I tried auto-logon, but not working either.

 

 

I got stuck, and any input would be well appreciated.

 

 

J

 

 

 

 

 

Configuring Output from vmrun runProgramInGuest

$
0
0

 

Hello,

 

 

I am using vmrun to run an MSDOS batch file inside a Windows vm as follows:

 

 

vmrun -T vc -h https://<vcenterservername>:443/sdk -u username -p password -gu Administrator -gp administratorpassword runProgramInGuest "[datastoreLUNname] vmfoldername/vmname.vmx" C:\batchfilename.bat 

 

 

 

 

 

So this code works - I start if from my Windows XP laptop and it starts a batch file runnining inside a Windows virtual machine.  However, the output displays inside the virtual machine and not at the command line of tmy Windows xp laptop - where I need it to display.  As each line of the MSDOS file executes inside the Windows VM, I need the output directed to my WindowsXP laptop so I can confirm each command is successful.  Can this be done?

 

 

thanks

 

 

Where's VIX_SERVICEPROVIDER_VMWARE_PLAYER in 1.10.2?

$
0
0

Greetings,

 

I do not see VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_PLAYER in my Interop.VixCOM.dll built from the 1.10.2.15207 build of VixCOM.dll.  The VIX API reference for 1.10 indicates that it should be in there, but this is all I see:

 

#region Assembly Interop.VixCOM.dll, v2.0.50727

// G:\MSDProjects\iTest Projects\Reference Assemblies\Interop.VixCOM.dll
#endregion
using System;
using System.Runtime.InteropServices;
namespace VixCOM
{
    [Guid("3A9AC120-8161-4857-8677-F3B0B132A93D")]
    public abstract class Constants
    {
        public const int VIX_API_VERSION = -1;
        public const int VIX_CAPTURESCREENFORMAT_PNG = 1;
        public const int VIX_CAPTURESCREENFORMAT_PNG_NOCOMPRESS = 2;
        public const int VIX_CLONETYPE_FULL = 0;
        public const int VIX_CLONETYPE_LINKED = 1;
        public const int VIX_E_ALREADY_EXISTS = 23;
        public const int VIX_E_ANON_GUEST_OPERATIONS_PROHIBITED = 3018;
        public const int VIX_E_BAD_VM_INDEX = 8000;
        public const int VIX_E_BUFFER_TOOSMALL = 24;
        public const int VIX_E_CANCELLED = 10;
        public const int VIX_E_CANNOT_AUTHENTICATE_WITH_GUEST = 3024;
        public const int VIX_E_CANNOT_CONNECT_TO_HOST = 18000;
        public const int VIX_E_CANNOT_CONNECT_TO_VM = 3008;
        public const int VIX_E_CANNOT_POWER_ON_VM = 3041;
        public const int VIX_E_CANNOT_READ_VM_CONFIG = 4002;
        public const int VIX_E_CANNOT_START_READ_ONLY_VM = 3005;
        public const int VIX_E_CONSOLE_GUEST_OPERATIONS_PROHIBITED = 3026;
        public const int VIX_E_CRYPTO_BAD_BUFFER_SIZE = 17001;
        public const int VIX_E_CRYPTO_BAD_FORMAT = 17009;
        public const int VIX_E_CRYPTO_BAS_PASSWORD = 17005;
        public const int VIX_E_CRYPTO_EMPTY = 17011;
        public const int VIX_E_CRYPTO_ERROR = 17008;
        public const int VIX_E_CRYPTO_INVALID_OPERATION = 17002;
        public const int VIX_E_CRYPTO_KEYSAFE_LOCATOR = 17012;
        public const int VIX_E_CRYPTO_LOCKED = 17010;
        public const int VIX_E_CRYPTO_NEED_PASSWORD = 17004;
        public const int VIX_E_CRYPTO_NO_CRYPTO = 17007;
        public const int VIX_E_CRYPTO_NOT_IN_DICTIONARY = 17006;
        public const int VIX_E_CRYPTO_RANDOM_DEVICE = 17003;
        public const int VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000;
        public const int VIX_E_DISK_CANTREPAIR = 16062;
        public const int VIX_E_DISK_CANTSHRINK = 16009;
        public const int VIX_E_DISK_CID_MISMATCH = 16008;
        public const int VIX_E_DISK_ENCODING = 16061;
        public const int VIX_E_DISK_FULL = 8;
        public const int VIX_E_DISK_INVAL = 16000;
        public const int VIX_E_DISK_INVALID_CONNECTION = 16054;
        public const int VIX_E_DISK_INVALIDCHAIN = 16030;
        public const int VIX_E_DISK_INVALIDDISK = 16063;
        public const int VIX_E_DISK_INVALIDPARTITIONTABLE = 16018;
        public const int VIX_E_DISK_KEY_NOTFOUND = 16052;
        public const int VIX_E_DISK_NEEDKEY = 16014;
        public const int VIX_E_DISK_NEEDSREPAIR = 16006;
        public const int VIX_E_DISK_NEEDVMFS = 16022;
        public const int VIX_E_DISK_NODEVICE = 16065;
        public const int VIX_E_DISK_NOINIT = 16001;
        public const int VIX_E_DISK_NOIO = 16002;
        public const int VIX_E_DISK_NOKEY = 16017;
        public const int VIX_E_DISK_NOKEYOVERRIDE = 16015;
        public const int VIX_E_DISK_NOLICENSE = 16064;
        public const int VIX_E_DISK_NOTENCDESC = 16020;
        public const int VIX_E_DISK_NOTENCRYPTED = 16016;
        public const int VIX_E_DISK_NOTNORMAL = 16019;
        public const int VIX_E_DISK_NOTSUPPORTED = 16013;
        public const int VIX_E_DISK_OPENPARENT = 16012;
        public const int VIX_E_DISK_OUTOFRANGE = 16007;
        public const int VIX_E_DISK_PARTIALCHAIN = 16003;
        public const int VIX_E_DISK_PARTMISMATCH = 16010;
        public const int VIX_E_DISK_RAWTOOBIG = 16024;
        public const int VIX_E_DISK_RAWTOOSMALL = 16029;
        public const int VIX_E_DISK_SUBSYSTEM_INIT_FAIL = 16053;
        public const int VIX_E_DISK_TOOMANYOPENFILES = 16027;
        public const int VIX_E_DISK_TOOMANYREDO = 16028;
        public const int VIX_E_DISK_UNSUPPORTEDDEVICE = 16066;
        public const int VIX_E_DISK_UNSUPPORTEDDISKVERSION = 16011;
        public const int VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST = 3033;
        public const int VIX_E_FAIL = 1;
        public const int VIX_E_FILE_ACCESS_ERROR = 13;
        public const int VIX_E_FILE_ALREADY_EXISTS = 12;
        public const int VIX_E_FILE_ALREADY_LOCKED = 15;
        public const int VIX_E_FILE_ERROR = 7;
        public const int VIX_E_FILE_NAME_INVALID = 22;
        public const int VIX_E_FILE_NAME_TOO_LONG = 20004;
        public const int VIX_E_FILE_NOT_FOUND = 4;
        public const int VIX_E_FILE_READ_ONLY = 11;
        public const int VIX_E_FILE_TOO_BIG = 21;
        public const int VIX_E_GUEST_OPERATIONS_PROHIBITED = 3017;
        public const int VIX_E_GUEST_USER_PERMISSIONS = 3015;
        public const int VIX_E_GUEST_VOLUMES_NOT_FROZEN = 20000;
        public const int VIX_E_HOST_DISK_INVALID_VALUE = 14003;
        public const int VIX_E_HOST_DISK_SECTORSIZE = 14004;
        public const int VIX_E_HOST_FILE_ERROR_EOF = 14005;
        public const int VIX_E_HOST_NBD_HASHFILE_INIT = 14013;
        public const int VIX_E_HOST_NBD_HASHFILE_VOLUME = 14012;
        public const int VIX_E_HOST_NETBLKDEV_HANDSHAKE = 14006;
        public const int VIX_E_HOST_NETWORK_CONN_REFUSED = 14009;
        public const int VIX_E_HOST_NOT_CONNECTED = 26;
        public const int VIX_E_HOST_SERVER_NOT_FOUND = 14008;
        public const int VIX_E_HOST_SOCKET_CREATION_ERROR = 14007;
        public const int VIX_E_HOST_TCP_CONN_LOST = 14011;
        public const int VIX_E_HOST_TCP_SOCKET_ERROR = 14010;
        public const int VIX_E_HOST_USER_PERMISSIONS = 3014;
        public const int VIX_E_INCORRECT_FILE_TYPE = 9;
        public const int VIX_E_INTERACTIVE_SESSION_NOT_PRESENT = 3034;
        public const int VIX_E_INTERACTIVE_SESSION_USER_MISMATCH = 3035;
        public const int VIX_E_INVALID_ARG = 3;
        public const int VIX_E_INVALID_HANDLE = 1000;
        public const int VIX_E_INVALID_HOSTNAME_SPECIFICATION = 18002;
        public const int VIX_E_INVALID_MESSAGE_BODY = 10001;
        public const int VIX_E_INVALID_MESSAGE_HEADER = 10000;
        public const int VIX_E_INVALID_PROPERTY_VALUE = 6001;
        public const int VIX_E_INVALID_SERIALIZED_DATA = 6004;
        public const int VIX_E_INVALID_UTF8_STRING = 27;
        public const int VIX_E_INVALID_XML = 2002;
        public const int VIX_E_LICENSE = 32;
        public const int VIX_E_LOGIN_TYPE_NOT_SUPPORTED = 3032;
        public const int VIX_E_MISSING_ANON_GUEST_ACCOUNT = 3023;
        public const int VIX_E_MISSING_REQUIRED_PROPERTY = 6003;
        public const int VIX_E_MUST_BE_CONSOLE_USER = 3027;
        public const int VIX_E_NEED_KEY = 30;
        public const int VIX_E_NO_DISPLAY_SERVER = 3043;
        public const int VIX_E_NO_GUEST_OS_INSTALLED = 3010;
        public const int VIX_E_NO_SUCH_PROCESS = 20003;
        public const int VIX_E_NOT_A_DIRECTORY = 20002;
        public const int VIX_E_NOT_A_FILE = 20001;
        public const int VIX_E_NOT_ALLOWED_DURING_VM_RECORDING = 3029;
        public const int VIX_E_NOT_ALLOWED_DURING_VM_REPLAY = 3030;
        public const int VIX_E_NOT_FOR_REMOTE_HOST = 18001;
        public const int VIX_E_NOT_FOUND = 2000;
        public const int VIX_E_NOT_SUPPORTED = 6;
        public const int VIX_E_NOT_SUPPORTED_FOR_VM_VERSION = 4001;
        public const int VIX_E_NOT_SUPPORTED_ON_HANDLE_TYPE = 1001;
        public const int VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT = 20;
        public const int VIX_E_OBJECT_IS_BUSY = 5;
        public const int VIX_E_OBJECT_NOT_FOUND = 25;
        public const int VIX_E_OP_NOT_SUPPORTED_ON_GUEST = 3003;
        public const int VIX_E_OPERATION_ALREADY_IN_PROGRESS = 31;
        public const int VIX_E_OPERATION_NOT_ALLOWED_FOR_LOGIN_TYPE = 3031;
        public const int VIX_E_OUT_OF_MEMORY = 2;
        public const int VIX_E_POWEROP_SCRIPTS_NOT_AVAILABLE = 3009;
        public const int VIX_E_PROGRAM_NOT_STARTED = 3004;
        public const int VIX_E_READ_ONLY_PROPERTY = 6002;
        public const int VIX_E_REQUIRES_LARGE_FILES = 14;
        public const int VIX_E_ROOT_GUEST_OPERATIONS_PROHIBITED = 3019;
        public const int VIX_E_SCREEN_CAPTURE_BAD_FORMAT = 19001;
        public const int VIX_E_SCREEN_CAPTURE_COMPRESSION_FAIL = 19002;
        public const int VIX_E_SCREEN_CAPTURE_ERROR = 19000;
        public const int VIX_E_SCREEN_CAPTURE_LARGE_DATA = 19003;
        public const int VIX_E_SNAPSHOT_CHECKPOINT = 13009;
        public const int VIX_E_SNAPSHOT_CONFIG = 13007;
        public const int VIX_E_SNAPSHOT_DISKLIB = 13002;
        public const int VIX_E_SNAPSHOT_DISKLOCKED = 13014;
        public const int VIX_E_SNAPSHOT_DUMPER = 13001;
        public const int VIX_E_SNAPSHOT_DUPLICATEDDISK = 13015;
        public const int VIX_E_SNAPSHOT_EXISTS = 13004;
        public const int VIX_E_SNAPSHOT_INCONSISTENT = 13011;
        public const int VIX_E_SNAPSHOT_INDEPENDENTDISK = 13016;
        public const int VIX_E_SNAPSHOT_INVAL = 13000;
        public const int VIX_E_SNAPSHOT_LOCKED = 13010;
        public const int VIX_E_SNAPSHOT_MAXSNAPSHOTS = 13019;
        public const int VIX_E_SNAPSHOT_MEMORY_ON_INDEPENDENT_DISK = 13018;
        public const int VIX_E_SNAPSHOT_MIN_FREE_SPACE = 13020;
        public const int VIX_E_SNAPSHOT_NAMETOOLONG = 13012;
        public const int VIX_E_SNAPSHOT_NOCHANGE = 13008;
        public const int VIX_E_SNAPSHOT_NONUNIQUE_NAME = 13017;
        public const int VIX_E_SNAPSHOT_NOPERM = 13006;
        public const int VIX_E_SNAPSHOT_NOTFOUND = 13003;
        public const int VIX_E_SNAPSHOT_VERSION = 13005;
        public const int VIX_E_SNAPSHOT_VIXFILE = 13013;
        public const int VIX_E_SUSPEND_ERROR = 3012;
        public const int VIX_E_TEMPLATE_VM = 4003;
        public const int VIX_E_TIMEOUT_WAITING_FOR_TOOLS = 3000;
        public const int VIX_E_TOO_MANY_HANDLES = 1002;
        public const int VIX_E_TOOLS_INSTALL_ALREADY_UP_TO_DATE = 21010;
        public const int VIX_E_TOOLS_INSTALL_AUTO_NOT_SUPPORTED = 21006;
        public const int VIX_E_TOOLS_INSTALL_CANCELLED = 21004;
        public const int VIX_E_TOOLS_INSTALL_DEVICE_NOT_CONNECTED = 21003;
        public const int VIX_E_TOOLS_INSTALL_ERROR = 21009;
        public const int VIX_E_TOOLS_INSTALL_GUEST_NOT_READY = 21007;
        public const int VIX_E_TOOLS_INSTALL_IMAGE_INACCESIBLE = 21001;
        public const int VIX_E_TOOLS_INSTALL_IN_PROGRESS = 21011;
        public const int VIX_E_TOOLS_INSTALL_INIT_FAILED = 21005;
        public const int VIX_E_TOOLS_INSTALL_NO_DEVICE = 21002;
        public const int VIX_E_TOOLS_INSTALL_NO_IMAGE = 21000;
        public const int VIX_E_TOOLS_INSTALL_SIG_CHECK_FAILED = 21008;
        public const int VIX_E_TOOLS_NOT_RUNNING = 3016;
        public const int VIX_E_TYPE_MISMATCH = 2001;
        public const int VIX_E_UNABLE_TO_REPLAY_VM = 3039;
        public const int VIX_E_UNFINISHED_JOB = 29;
        public const int VIX_E_UNRECOGNIZED_COMMAND = 3001;
        public const int VIX_E_UNRECOGNIZED_COMMAND_IN_GUEST = 3025;
        public const int VIX_E_UNRECOGNIZED_PROPERTY = 6000;
        public const int VIX_E_VM_ALREADY_LOADED = 4004;
        public const int VIX_E_VM_ALREADY_UP_TO_DATE = 4006;
        public const int VIX_E_VM_HOST_DISCONNECTED = 34;
        public const int VIX_E_VM_INSUFFICIENT_HOST_MEMORY = 3011;
        public const int VIX_E_VM_IS_RUNNING = 3007;
        public const int VIX_E_VM_NOT_ENOUGH_CPUS = 3013;
        public const int VIX_E_VM_NOT_FOUND = 4000;
        public const int VIX_E_VM_NOT_RUNNING = 3006;
        public const int VIX_E_VMDB = 16;
        public const int VIX_E_VMX_MSG_DIALOG_AND_NO_UI = 3028;
        public const int VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND = 22003;
        public const int VIX_E_WRAPPER_VERSION_NOT_FOUND = 22002;
        public const int VIX_E_WRAPPER_WORKSTATION_NOT_INSTALLED = 22001;
        public const int VIX_EVENTTYPE_CALLBACK_SIGNALLED = 2;
        public const int VIX_EVENTTYPE_FIND_ITEM = 8;
        public const int VIX_EVENTTYPE_JOB_COMPLETED = 2;
        public const int VIX_EVENTTYPE_JOB_PROGRESS = 3;
        public const int VIX_FILE_ATTRIBUTES_DIRECTORY = 1;
        public const int VIX_FILE_ATTRIBUTES_SYMLINK = 2;
        public const int VIX_FIND_REGISTERED_VMS = 4;
        public const int VIX_FIND_RUNNING_VMS = 1;
        public const int VIX_GUEST_ENVIRONMENT_VARIABLE = 3;
        public const int VIX_HANDLETYPE_HOST = 2;
        public const int VIX_HANDLETYPE_JOB = 6;
        public const int VIX_HANDLETYPE_METADATA_CONTAINER = 11;
        public const int VIX_HANDLETYPE_NETWORK = 5;
        public const int VIX_HANDLETYPE_NONE = 0;
        public const int VIX_HANDLETYPE_PROPERTY_LIST = 9;
        public const int VIX_HANDLETYPE_SNAPSHOT = 7;
        public const int VIX_HANDLETYPE_VM = 3;
        public const int VIX_HOSTOPTION_USE_EVENT_PUMP = 8;
        public const int VIX_INSTALLTOOLS_AUTO_UPGRADE = 1;
        public const int VIX_INSTALLTOOLS_MOUNT_TOOLS_INSTALLER = 0;
        public const int VIX_INSTALLTOOLS_RETURN_IMMEDIATELY = 2;
        public const int VIX_INVALID_HANDLE = 0;
        public const int VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT = 8;
        public const int VIX_OK = 0;
        public const int VIX_POWERSTATE_BLOCKED_ON_MSG = 256;
        public const int VIX_POWERSTATE_PAUSED = 512;
        public const int VIX_POWERSTATE_POWERED_OFF = 2;
        public const int VIX_POWERSTATE_POWERED_ON = 8;
        public const int VIX_POWERSTATE_POWERING_OFF = 1;
        public const int VIX_POWERSTATE_POWERING_ON = 4;
        public const int VIX_POWERSTATE_RESETTING = 128;
        public const int VIX_POWERSTATE_RESUMING = 2048;
        public const int VIX_POWERSTATE_SUSPENDED = 32;
        public const int VIX_POWERSTATE_SUSPENDING = 16;
        public const int VIX_POWERSTATE_TOOLS_RUNNING = 64;
        public const int VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010;
        public const int VIX_PROPERTY_HOST_API_VERSION = 51;
        public const int VIX_PROPERTY_HOST_HOSTTYPE = 50;
        public const int VIX_PROPERTY_JOB_RESULT_COMMAND_OUTPUT = 3005;
        public const int VIX_PROPERTY_JOB_RESULT_ERROR_CODE = 3000;
        public const int VIX_PROPERTY_JOB_RESULT_EXIT_CODE = 3004;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_FLAGS = 3054;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME = 3062;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_SIZE = 3061;
        public const int VIX_PROPERTY_JOB_RESULT_FOUND_ITEM_DESCRIPTION = 3036;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS = 3011;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_ELAPSED_TIME = 3017;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE = 3018;
        public const int VIX_PROPERTY_JOB_RESULT_HANDLE = 3010;
        public const int VIX_PROPERTY_JOB_RESULT_ITEM_NAME = 3035;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_BEING_DEBUGGED = 3057;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_COMMAND = 3053;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_ID = 3051;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_OWNER = 3052;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_START_TIME = 3055;
        public const int VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_DATA = 3059;
        public const int VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_SIZE = 3058;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT = 3046;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS = 3049;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST = 3048;
        public const int VIX_PROPERTY_JOB_RESULT_USER_MESSAGE = 3002;
        public const int VIX_PROPERTY_JOB_RESULT_VM_IN_GROUP = 3001;
        public const int VIX_PROPERTY_JOB_RESULT_VM_VARIABLE_STRING = 3056;
        public const int VIX_PROPERTY_META_DATA_CONTAINER = 2;
        public const int VIX_PROPERTY_NONE = 0;
        public const int VIX_PROPERTY_SNAPSHOT_DESCRIPTION = 4201;
        public const int VIX_PROPERTY_SNAPSHOT_DISPLAYNAME = 4200;
        public const int VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE = 4207;
        public const int VIX_PROPERTY_SNAPSHOT_POWERSTATE = 4205;
        public const int VIX_PROPERTY_VM_IN_VMTEAM = 128;
        public const int VIX_PROPERTY_VM_IS_RECORDING = 236;
        public const int VIX_PROPERTY_VM_IS_REPLAYING = 237;
        public const int VIX_PROPERTY_VM_IS_RUNNING = 196;
        public const int VIX_PROPERTY_VM_MEMORY_SIZE = 106;
        public const int VIX_PROPERTY_VM_NUM_VCPUS = 101;
        public const int VIX_PROPERTY_VM_POWER_STATE = 129;
        public const int VIX_PROPERTY_VM_READ_ONLY = 107;
        public const int VIX_PROPERTY_VM_SUPPORTED_FEATURES = 197;
        public const int VIX_PROPERTY_VM_TOOLS_STATE = 152;
        public const int VIX_PROPERTY_VM_VMTEAM_PATHNAME = 105;
        public const int VIX_PROPERTY_VM_VMX_PATHNAME = 103;
        public const int VIX_PROPERTYTYPE_ANY = 0;
        public const int VIX_PROPERTYTYPE_BLOB = 6;
        public const int VIX_PROPERTYTYPE_BOOL = 3;
        public const int VIX_PROPERTYTYPE_HANDLE = 4;
        public const int VIX_PROPERTYTYPE_INT64 = 5;
        public const int VIX_PROPERTYTYPE_INTEGER = 1;
        public const int VIX_PROPERTYTYPE_STRING = 2;
        public const int VIX_PUMPEVENTOPTION_NONE = 0;
        public const int VIX_RUNPROGRAM_ACTIVATE_WINDOW = 2;
        public const int VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 1;
        public const int VIX_SERVICEPROVIDER_DEFAULT = 1;
        public const int VIX_SERVICEPROVIDER_VMWARE_SERVER = 2;
        public const int VIX_SERVICEPROVIDER_VMWARE_VI_SERVER = 10;
        public const int VIX_SERVICEPROVIDER_VMWARE_WORKSTATION = 3;
        public const int VIX_SHAREDFOLDER_WRITE_ACCESS = 4;
        public const int VIX_SNAPSHOT_INCLUDE_MEMORY = 2;
        public const int VIX_SNAPSHOT_REMOVE_CHILDREN = 1;
        public const int VIX_TOOLSSTATE_NOT_INSTALLED = 4;
        public const int VIX_TOOLSSTATE_RUNNING = 2;
        public const int VIX_TOOLSSTATE_UNKNOWN = 1;
        public const int VIX_VM_CONFIG_RUNTIME_ONLY = 2;
        public const int VIX_VM_GUEST_VARIABLE = 1;
        public const int VIX_VM_SUPPORT_HARDWARE_UPGRADE = 8;
        public const int VIX_VM_SUPPORT_MULTIPLE_SNAPSHOTS = 2;
        public const int VIX_VM_SUPPORT_SHARED_FOLDERS = 1;
        public const int VIX_VM_SUPPORT_TOOLS_INSTALL = 4;
        public const int VIX_VMDELETE_DISK_FILES = 2;
        public const int VIX_VMPOWEROP_FROM_GUEST = 4;
        public const int VIX_VMPOWEROP_LAUNCH_GUI = 512;
        public const int VIX_VMPOWEROP_NORMAL = 0;
        public const int VIX_VMPOWEROP_START_VM_PAUSED = 4096;
        public const int VIX_VMPOWEROP_SUPPRESS_SNAPSHOT_POWERON = 128;
    }
}

 

Any idea why it's not in here?

 

Thank you,

 

 

-Randy

Can VIX be used to get UPTIME

$
0
0

Can VIX be used to get UPTIME as seen via a column in vSphere client? I am not looking for the client OS uptime. I'm looking for the time since it was started or since it was last resumed from pause.

 

ScreenClip.png

About undocumented VIX API

$
0
0



I would like to be able to configure networking as well as set vcpus and memory of my VMs, and so on. It seems like the VIX library includes a whole bunch of functions that are not exposed in the header we use to write apps. Would it be possible for you to expose and document? The following is the list I would be interested the most.


VixVM_ConnectNamedDevice


VixVM_IsNamedDeviceConnected


VixVM_GetGuestNetworkingConfig


VixVM_SetGuestNetworkingConfig


VixVM_GetNumDevices


VixVM_GetDevice


VixVM_GetNumDevicesSimple


VixVM_GetDeviceSimple


VixVM_RemoveDevice


VixVM_AddDevice


VixVM_IsDevicePresent


VixVM_UpdateDevices


VixVM_LoadDevicesFromConfig


VixVM_SaveDevicesToConfig


VixVM_VMXReload


VixVM_TypeKeystrokesInGuest 


VixVM_CancelInstallToolsInGuest


VixVM_HotPlugCPU


VixVM_HotPlugMemory


VixVM_HotAddDevice


VixVM_HotRemoveDevice


VixVM_GetPerformanceData

Difference between VIX API TO VSPHERE API

$
0
0

Hello

i am a very "green" in vm world and i am trying to create some simple implication c# that will read the data from vcenter about machine and will deploy machine in a future .

rom what i have learned until now that my option is using vsphere api for this task is best option .Now i found that there is one more vix api can u pls explain me what is the difference between them and do i need to install addition packets on the esx that is hosting the vcenter?

thank you!!!!

vmrun clone with vCenter and ESXi 5.x

$
0
0

My basic question is does “vmrun clone” work with vCenter 5.5 and/or ESXi 5.5?  If “vmrun clone” is supported with vCenter/ESXi, then are there any special requirements to make it work.  For example, do I need a special license or any special configuration on vCenter/ESXi?

 

When I attempt to use “vmrun clone” with either vCenter 5.5 or ESXi 5.5 I get the error below:

 

Error: The operation is not supported

 

FYI…

 

  • I know that clone was not supported on vSphere 4.x, but I have vSphere 5.5.


  • I have read some posts that suggest that clone is a feature of vCenter, but not ESXi.  I am OK with this.  I would actually prefer to do the clone through vCenter.

 

 

Additionally, except on VMware Server (discontinued), you can clone a virtual machine image to another

virtual machine.

and

(Cloning not supported on VMware Server or on VMware Fusion.)

 

To me, this implies that “vmrun clone” is supported against both vCenter and ESXi.


Am I trying to do something that is never going to work, or have I simply not found the magic combination of parameters yet?


Information about Virtual Disk via VMware Tools API

$
0
0

Hello,

 

Is it possible to use the VMware Tools API to read:

 

  • The partitions on the virtual disk(s)
  • The amount of space available on them
  • The total size
  • Space used
  • The name (eg. Windows)

 

If yes, what functions needs to be used? I looked at the documentation briefly, but I can't figure it out.

 

The goal is to write a tool that automatically collects this information from all VM's on a daily basis. Would PowerCLI be at help here, since I like to collect this information from one machine?

 

Thanks!

using vix api with non-root user to download disk info/data.

$
0
0

I am trying to connect to ESX 4.1 to download data from disk(vm snapshot), All this code works fine with root but doesnt work for another Administrator user - suser.

suser has is Administrator , Also tried adding in root group. With some changes I can ssh to ESX box using  suser, but my client always fail with username/password incorrect.

 

vix version i am using - VMware-vix-disklib-5.1.1-1042608.x86_64

 

my client side vix related logs

31249:07:21:2014:11:54:23:WARNING:SSL_VerifyCbHelper: Certificate verification is disabled, so connection will proceed despite the error

31249:07:21:2014:11:54:23:WARNING:SSL_VerifyCbHelper: Certificate verification is disabled, so connection will proceed despite the error

31249:07:21:2014:11:54:23:INFO:CnxConnectAuthd: Returning false because CnxAuthdProtoAuthenticate failed

31249:07:21:2014:11:54:23:INFO:Cnx_Connect: Returning false because CnxConnectAuthd failed

31249:07:21:2014:11:54:23:INFO:Cnx_Connect: Error message: Login (username/password) incorrect

31249:07:21:2014:11:54:23:WARNING:[NFC ERROR] NfcNewAuthdConnectionEx: Failed to connect to peer. Error: Login (username/password) incorrect

31249:07:21:2014:11:54:23:INFO:NBD_ClientOpen: Couldn't connect to 172.16.8.155:902 Login (username/password) incorrect

31249:07:21:2014:11:54:23:INFO:DISKLIB-DSCPTR: : "ha-nfc://[datastore1] foo/foo-000001.vmdk@172.16.8.155:902" : Failed to open NBD extent.

31249:07:21:2014:11:54:23:INFO:DISKLIB-LINK  : "ha-nfc://[datastore1] foo/foo-000001.vmdk@172.16.8.155:902" : failed to open (NBD_ERR_NETWORK_CONNECT).

31249:07:21:2014:11:54:23:INFO:DISKLIB-CHAIN : "ha-nfc://[datastore1] foo/foo-000001.vmdk@172.16.8.155:902" : failed to open (NBD_ERR_NETWORK_CONNECT).

31249:07:21:2014:11:54:23:INFO:DISKLIB-LIB   : Failed to open 'ha-nfc://[datastore1] foo/foo-000001.vmdk@172.16.8.155:902' with flags 0x1e NBD_ERR_NETWORK_CONNECT (2338).

 

I  think this is corresponding log from hostd-*.log

[2014-07-21 17:11:13.482 6DD05B90 info 'ha-eventmgr'] Event 162 : User suser@172.16.10.10 logged in

[2014-07-21 17:11:13.494 6DD87B90 verbose 'Proxysvc Req00255'] New proxy client SSL(TCP(local=172.16.10.10:49134, peer=172.16.8.155:443))

[2014-07-21 17:11:13.741 6DD05B90 verbose 'ha-license-manager'] Load: Loading existing file: /etc/vmware/license.cfg

[2014-07-21 17:11:13.747 6DD05B90 verbose 'ha-license-manager'] Load: Loading existing file: /etc/vmware/license.cfg

[2014-07-21 17:11:13.755 6DD05B90 verbose 'App'] ha-license-manager:Validate -> Valid evaluation detected for "VMware ESX Server 4.0" (lastError=0, desc.IsValid:Yes)

[2014-07-21 17:11:13.759 6DD05B90 error 'PropertyProvider'] Unexpected fault reading property: vim.LicenseManager,IsSourceAvailable: vmodl.fault.NotSupported

[2014-07-21 17:11:13.759 6DD05B90 verbose 'Locale'] Default resource used for 'LicenseManager.LicenseInfo.dpvmotion.label' expected in module 'default'.

[2014-07-21 17:11:13.759 6DD05B90 verbose 'Locale'] Default resource used for 'LicenseManager.LicenseInfo.vaai.label' expected in module 'default'.

[2014-07-21 17:11:13.871 6E780B90 verbose 'App'] CloseSession called for session id=52a1457d-28a8-936c-857b-408e4fa2a3cf

 

Thanks,

Sachin

vix file execution errors

$
0
0

I installed strawberry perl 5 version, vix api 1.12.exe on a windows system to connect to a remote VM in vSphere.

After i run the sample perl code given in the vix-api installation directory I am getting the below error

Error : "

Can't locate VMware/Vix/Simple.pm in @INC (@INC contains: blib/lib blib/auto bli

b/arch blib/arch/auto/VMware blib/arch/auto C:/Strawberry/perl/site/lib C:/Straw

berry/perl/vendor/lib C:/Strawberry/perl/lib .) at powertest.pl line 18.

BEGIN failed--compilation aborted at powertest.pl line 18.

"

Can anyone tell how to fix this...

vmrun.exe - is it redistributable?

$
0
0

In my company we're thinking of using vmplayer(s) and its unity feature in our embedded system. When the users power off the system, we would like to be able to power off the virtual machines automatically. I know that you can start the machines simply with vmplayer.exe path.vmx but I haven't found a way to shutdown the vm through command line. The only way I've found is by using VIX and vmrun -suspend or -stop.

 

Now, I wonder, is it possible to distribute vmrun.exe? I know the vix api files (Redistibutable VIX API client libraries | VIX API Blog - VMware Blogs) are redistributable but what about vmrun?

vix api remote automation

$
0
0

Hi

i am now using esxi and i have automation that creats vcnter on this host and afterwards creats vm's and add them to vcenter.and i can run

my up over network since the vsphere api is based on web service.

Now we have new system that will run vmware work station over ubuntu.

From what i understand i need to switch to vix api for automation task's so my question is will i be able to use the api over network (remotly by ip)  or i will need to run my app localy on same host where the vmware work station is running?

Thx

vmware work station version 10

vix api 1.13

How should the path to the remote vm looks like?

$
0
0

I;m trying to crate my Vm snapshot running on the remote server.
Tha path in the vsphere menu looks like this:


    • ServerName.domain.com




        1. datacenterX








            1. somename.domain.com












                  1. XXX ( resource pool)














                        1. YYY ( resource pool)
















                                  1. ZZZ ( resource pool)


















                                          1. VMS




















                                                      1. Mymachine














                                            • So  how should I put the path on the OpenVm parameter?


                                              in the api reference I only found sample about local vms:

                                              Set job = host.OpenVM("C:\VMs\winxpprowithsp2\winxpprowithsp2.vmx", Nothing)

                                              Perform Actions on a virtual host on esx server

                                              $
                                              0
                                              0

                                              Hello there

                                              I try to connect to a virtual machine on an esx server. Creating a connection does work properly, but I can't perform anything on the virtualHost object!


                                              This is how I create the connection:

                                              VMWareVirtualHost virtualHost = new VMWareVirtualHost();

                                              virtualHost.ConnectToVMWareVIServer(EsxServer, EsxUser, EsxPassword);


                                              And now, whatever method or property I'm calling, for example:

                                              List<VMWareVirtualMachine> vitualMachines = virtualHost.RegisteredVirtualMachines.ToList();

                                               

                                              I end up getting this error:

                                              System.Exception: Failed to get all registered virtual machines ---> System.Exception: Failed to open virtual machine: fileName="SREAT01/SREAT01.vmx" timeoutInSeconds=60 ---> Vestris.VMWareLib.VMWareException:

                                              Insufficient permissions in the host operating system

                                                 at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode)

                                                 at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties)

                                                 at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties, Int32 index, Int32 timeoutInSeconds)

                                                 at Vestris.VMWareLib.VMWareJob.Wait[T](Int32 propertyId, Int32 timeoutInSeconds)

                                                 at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName, Int32 timeoutInSeconds)

                                                 --- End of inner exception stack trace ---

                                                 at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName, Int32 timeoutInSeconds)

                                                 at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName)

                                                 at Vestris.VMWareLib.VMWareVirtualHost.get_RegisteredVirtualMachines()

                                                 --- End of inner exception stack trace ---

                                                 at Vestris.VMWareLib.VMWareVirtualHost.get_RegisteredVirtualMachines()

                                                 at TestAutomationTool.Program.Main(String[] args) in c:\*****\Program.cs:line 20

                                               

                                              Additional information:

                                              - The user, does have the administrator rights for this VM

                                              - vSphere Client, Version 5.5.0 / Build 1993072
                                              - VMware vCenter Server, Version 5.5.0 / Build 1750787

                                               

                                              Now, how can I fix this?

                                              I searched the internet from the bottom to the top and could not find a solution!

                                               

                                              Thanks in advance.

                                              Regards, RUL


                                              Enable / disable unity mode from VIX API, not possible?!

                                              $
                                              0
                                              0

                                               

                                              Hello!

                                               

                                               

                                              I was very surprised to see that it is seemingly impossible (i.e. not supported)  to enable/disable Unity mode from the most recent version of the VIX API. Is this really true? (I'm referring to VMware Workstation 6.5.x, but it doesn't seem to be supported in any VMware version anyway)

                                               

                                               

                                              I've been searching quit a lot, so I sadly believe it is true. :-/ Or isn't it?

                                               

                                               

                                              Would you please consider adding support for this in the VIX API? Practically all other possible VMware operations are supported, so this feels quite natural to support, and a very big "hole" to leave out, correct? I for one would need it very much.

                                               

                                               

                                              If it is left out for a reason (and thus will continue to be left out) , I would be very interested to hear the explanation for it, since it would be a really useful thing to have.

                                               

                                               

                                              Thanks!

                                               

                                               

                                              Can't connect to ESX 3.5u4 or 4.0 using VIX 1.6.2

                                              $
                                              0
                                              0

                                               

                                              Going by the documentation here http://www.vmware.com/support/developer/vix-api/vix16_reference/lang/com/functions/Connect.html I've been trying to connect to ESX in several instances.  I've tried ESX 3.5 u2, u4 and ESX 4.0.  In every single case, I can't connect In the manner described in the documentation, namely:

                                               

                                               

                                              -using VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER;

                                               

                                               

                                              -using https://hostname:port/sdk

                                               

                                               

                                              I have, however, been able to connect using VixCOM.Constants.VIX_SERVICEPROVIDER_DEFAULT, and using only the direct hostname (ie esx10.example.com) for the hostname value.

                                               

                                               

                                              The problem, however, is that even once I'm connected using SERVICEPROVIDER_DEFAULT, I can't open any VM's.  I've tried opening them with datastore paths, absolute paths, and relative paths.  Nothing works.

                                               

                                               

                                              Does anybody know what's going on here and how I can get connected to ESX and open a VM?  All of this code worked perfectly on VMware Server.

                                               

                                               

                                              I really appreciate any help that anyone can give.

                                               

                                               

                                              There was an error in communication

                                              $
                                              0
                                              0

                                              ESX version: 3.5 U4

                                              VIX version: latest

                                               

                                              Command run:

                                              C:\Program Files (x86)\VMware\VMware VIX>vmrun -T esx -h https://172.17.235.10/sdk -u serveruser -p serverpass -gu administrator -gp guestpass runProgramInGuest "[shared2] APDNA1101/APDNA1101.vmx" c:\windows\notepad.exe
                                              Error: Cannot open VM: [shared2] APDNA1101/APDNA1101.vmx, There was an error in communication=

                                               

                                              We are having a problem connecting to an ESX 3.5 U4 server with VIX. Snapshot is reverted ok, image powers up ok, but cannot connect to the guest image with VIX. We can copy files to the image without issue however. Any ideas what could be wrong here?

                                              Getting "VMware Tools are not running in the guest" from VIX, but tools are running

                                              $
                                              0
                                              0

                                              I'm having an issue with a Perl VIX script that I am writing. I am connecting to a VM, I wait for the VMWare tools using VMWaitForToolsInGuest, and then I execute a VBScript. After about 15 minutes, I get an 3016 error code "VMWare Tools are not running in the guest", but if I check the VM manually, the tools are running. Does anyone have any clue as to why I might get this error if the tools are running?

                                               

                                              Below is the code that I am using. I am able to connect to the VM before this in the same script without error. The error occurs during the last VMRunProgramInGuest.

                                               

                                              Any help would be greatly appreciated.

                                               

                                              Thanks,

                                               

                                              Andy


                                              print Time(), "Connecting to host...";
                                              $err, $hostHandle) = HostConnect(      VIX_API_VERSION,      VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,      $hostName, # hostName      0, # hostPort      $userName, # userName      $password, # password      0, # options      VIX_INVALID_HANDLE); # propertyListHandle
                                              CheckError("HostConnect() failed");
                                              print "Connected\n";
                                              print Time(), "Opening VM...";
                                              ($err, $vmHandle) = VMOpen(      $hostHandle,      "$vmName");
                                              CheckError("VMOpen() failed");
                                              print "Opened\n";
                                              
                                              print Time(), "Powering on VM...";
                                              $err = VMPowerOn(
                                                    $vmHandle,      VIX_VMPOWEROP_LAUNCH_GUI, # powerOnOptions      VIX_INVALID_HANDLE);  # propertyListHandle
                                              CheckError("VMPowerOn() failed");
                                              print "Powered on\n";
                                              
                                              print Time(), "Waiting for tools...";
                                              $err = VMWaitForToolsInGuest(
                                                    $vmHandle,      3600); # timeoutInSeconds
                                              CheckError("VMWaitForToolsInGuest() failed");
                                              print "Ready\n";  
                                              
                                              print Time(), "Logging in as $userName...";
                                              $err = VMLoginInGuest(
                                                    $vmHandle,      $userName, # userName      $password, # password      0); # options
                                              CheckError("VMLoginInGuest() failed");
                                              print "Logged in\n";  
                                              
                                              $err =  VMRunProgramInGuest(      $vmHandle,      $cscript, #executable      "$vmTestsDir\\runAnt.vbs $vmTestsDir\\build.xml $buildTarget", #arguments      0, # options      VIX_INVALID_HANDLE);
                                              CheckError("VMRunProgramInGuest(JUnit tests) failed");
                                              print "Finished\n";

                                              VixVM_UpgradeVirtualHardware returns error 10, "The operation was canceled"

                                              $
                                              0
                                              0

                                              I'm attempting to upgrade virtual hardware of a powered off virtual machine but VIX is returning an error about the operation being cancelled. The thing is that it does not explain why it was cancelled :/.

                                               

                                              Does anybody have any hint about this?

                                              Viewing all 34639 articles
                                              Browse latest View live