VMware Communities
astibich
Contributor
Contributor

'VixVirtualMachine.Logon' is failing when passed domain account

We are attempting to call  'VixVirtualMachine.Logon' using a domain account (eg. '<domain>\<domain account>') because we need domain credentials within the VM. This results in the following exception:

     LogIn failed, error = 3015 : 'Authentication failure or insufficient permissions in guest operating system'

We are Googling like mad, and it seems like people used to use 'VIX_CONSOLE_USER_NAME' back in the day to achieve this, but it's since been removed due to security concerns. What is the recommended procedure in the latest version of VMWare workstation?

I'm using the following:

VMWare Workstation version 8.02

VMWare Tools version 8.8.2

Running on Windows 7 64 bit

Thanks,

Aaron Stibich

Agilent Technologies

0 Kudos
2 Replies
admin
Immortal
Immortal

Can you call LoginInGuest instead? Looking at the documentation I do not see any reference to VixVirtualMachine.Logon but I do see

Name

LoginInGuest

Description

HRESULT
LoginInGuest([in] BSTR userName,
             [in] BSTR password,
             [in] LONG options,
             [in] ICallback* jobDoneCallback,
             [out,retval] IJob** loginJob);

This function establishes a guest operating system authentication context that can be used with guest functions for the given virtual machine handle.

Parameters

userName - The name of a user account on the guest operating system. password - The password of the account identified by userName. options - Must be 0 or one of the following values:
  • VixCOM.Constants.VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT -
directs guest commands invoked after the call to LoginInGuest() to be run from within the session of the user who is interactively logged into the guest operating system. See the remarks below for more information about VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT. jobDoneCallback - An ICallback instance that will be called when the operation is complete. loginJob - Returns an IJob object that describes the state of this asynchronous operation.

Return Value

HRESULT

https://www.vmware.com/support/developer/vix-api/vix111_reference/

0 Kudos
admin
Immortal
Immortal

I just tested this and was able to start notepad.exe on a Windows server 2008 R2 Domain controller. Maybe are you not passing the \ correctly? For example I am using C# and i need to use \\

here is what I ran. I am using http://vmwaretasks.codeplex.com/

        string vmPath = @"C:\_path\to\the\vmx.vmx";
        string vmUser = "DOMAIN\\Administrator";
        string vmPass = "Password123";

       private void button1_Click(object sender, EventArgs e)

        {

            // declare a virtual host

            using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())

            {

                // connect to a local VMWare Workstation virtual host

                virtualHost.ConnectToVMWareWorkstation();

                using (VMWareVirtualMachine virtualMachine = virtualHost.Open(vmPath))

                {

                    // power on this virtual machine

                    virtualMachine.PowerOn();

                    // wait for VMWare Tools

                    //virtualMachine.WaitForToolsInGuest();

                    // login to the virtual machine

                    virtualMachine.LoginInGuest(vmUser, vmPass);

                    // run notepad

                    virtualMachine.RunProgramInGuest("notepad.exe", string.Empty);

                }

            }

        }

0 Kudos