VMware Cloud Community
sgannon200
Contributor
Contributor
Jump to solution

Customization Specification Manager for Windows machine with auto-login

I'd like to use the Customization Specification Manager (CSM) to provide a host name for any new Windows 7 VM. I create new VMs based off a template. The template is configured to auto-login as the administrator. 

With CSM it's possible to use a profile to set the host name. That's ideal for me. But it seems to break the auto-login functionality.

Is it possible to create a new VM from a template, assign its host name via CSM, and keep auto-login enabled?

PS: I noticed CSM has a auto-login property. But this is limited to X logins. I need auto-login to persist.

Reply
0 Kudos
1 Solution

Accepted Solutions
aneverov
VMware Employee
VMware Employee
Jump to solution

I see. Well, yes - we invoke sysprep's /generalize. So, if we don't pass the auto-logon info, sysprep simply disables it.

Could you please try with both enabling the auto-logon feature and adding the following run-once command (it will run at the very end):

cmd /c reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoLogonCount

/* Please remember to mark answer as 'helpful' or 'correct' such that other users know it can be used and people focusing on ‘unanswered’ questions can skip it. */

View solution in original post

Reply
0 Kudos
7 Replies
aneverov
VMware Employee
VMware Employee
Jump to solution

Hi,

Having auto-login inside the template wouldn't work, because DefaultDomainName inside [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] must be set to the correct (changed) host name. That's why we have that auto-login feature to make sure we ask sysprep to update things correctly.

We currently do not support permanent auto-logon out-of-the-box. I'm not sure why UI limits it only to 100 logins. I just tried customize via VIM API and 9999 is allowed and applied. Maybe you'll be able to work around the UI by creating the spec, exporting it, editing the text and importing back. Haven't tried that.

The alternative could be to use run-once commands to edit the Windows registry at the very end of customization. I'm not sure how to setup the permanent auto-logon, but the AutoLogonCount registry settings should be easy to increase.

Hope that helps.

/Andrii

/* Please remember to mark answer as 'helpful' or 'correct' such that other users know it can be used and people focusing on ‘unanswered’ questions can skip it. */
Reply
0 Kudos
sgannon200
Contributor
Contributor
Jump to solution

Hmmm... I have not experienced any problems with using a template configured with auto-login. The DefaultDomainName is incorrect. But I'm only logging into a machine account. So the domain seems to be ignored.

The UI limitation is curious. I'd suggest changing it. I'm not 100% sold on setting the number to 9999.

The run once command is worth exploring. If it can configure auto-login I should be golden.

Reply
0 Kudos
aneverov
VMware Employee
VMware Employee
Jump to solution

I'm a bit confused. In the first entry you mentioned "But it seems to break the auto-login functionality.". So, if the DefaultDomainName name is ignored, what is broken?

> The UI limitation is curious. I'd suggest changing it. I'm not 100% sold on setting the number to 9999.

Please open an SR. From a quick look at the engine, I think we could support more than 100. But I would need to check the history of this thing.

/* Please remember to mark answer as 'helpful' or 'correct' such that other users know it can be used and people focusing on ‘unanswered’ questions can skip it. */
Reply
0 Kudos
sgannon200
Contributor
Contributor
Jump to solution

I'm sorry I may have muddled the issue. Currently I have a template with auto-login enabled and I don't use the CSM. Instead I manually re-name new machines (which is a pain).

I checked the registry on one of these machines, noticed the DefaultDomainName was incorrect, and assumed it did not matter.

When I tried to use the CSM I found that it turned auto-login off. i.e. I'd configure it on the template but when I deployed a VM with CSM it did not auto-login. I assumed CSM had disabled it.

Reply
0 Kudos
aneverov
VMware Employee
VMware Employee
Jump to solution

I see. Well, yes - we invoke sysprep's /generalize. So, if we don't pass the auto-logon info, sysprep simply disables it.

Could you please try with both enabling the auto-logon feature and adding the following run-once command (it will run at the very end):

cmd /c reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoLogonCount

/* Please remember to mark answer as 'helpful' or 'correct' such that other users know it can be used and people focusing on ‘unanswered’ questions can skip it. */
Reply
0 Kudos
sgannon200
Contributor
Contributor
Jump to solution

That seems to have done the trick. When I deploy a machine with CSM it continues to auto-login.

I noticed one or two blemishes.

  1. My desktop background has changed
  2. An item I expected to see on the desktop has disappeared
  3. My startup folder has been emptied

This seems like a separate topic and is likely the standard CSM behavior. But is it possible to disable it, workaround it, or do I need additional once off tasks?

Reply
0 Kudos
aneverov
VMware Employee
VMware Employee
Jump to solution

Hmm, that's a tricky question.

> An item I expected to see on the desktop has disappeared

> My startup folder has been emptied

It would be a feature request for us to support sysprep's CopyProfile (http://technet.microsoft.com/en-us/library/cc748953(v=ws.10).aspx, http://support.microsoft.com/kb/973289) which may help. You could also try Preventing Sysprep from Removing Default and Custom Desktop Icons and Shortcuts, but I doubt it will work, since that KB refers only to XP.

> My desktop background has changed

That's another feature request to basically support sysprep's Theme stuff ((Solved) Add Windows 7 Theme with your xml - Unattended Windows 7/Server 2008R2 - MSFN Forum).

I haven't found anything better so far. I would be interested to hear if you do find.

If you really get stuck, we do have a workaround for such cases. It's called "Use custom SysPrep answer file" in the UI. However, I highly recommend against it and it should only be used as a last resort.

/* Please remember to mark answer as 'helpful' or 'correct' such that other users know it can be used and people focusing on ‘unanswered’ questions can skip it. */