Has anyone managed to get guest customization of Windows Server 2012 working? From what I can tell it doesn't work at all.
I am running the latest version of everything (vCenter 5.1, ESXi 5.1). I created a brand new VM, chose Windows Server 2012 as the guest type (which automatically makes it EFI instead of BIOS) and installed Windows Server 2012 and the guest tools - all working OK. I then shut down the guest and converted it to a template.
I am then deploying a new guest from the template and using a guest customization specification which I also created from scratch - the guest customization is very simple doing the standard stuff (like naming the OS the same as the guest, setting our company name and prompting the user for an IP address). Nothing fancy.
The new guest is created as expected and then I power it on. VMware obviously "injects" something into the OS at this point (like the sysprep file) and what is meant to happen is the OS boots up and then a minute or two later it reboots and does the sysprep routine with the injected sysprep file. This works fine with Windows 2008 R2.
With Windows Server 2012 it just sits there forever and never reboots - the guest customization simply doesn't run. If I logon to the server I can see that VMware has successfully created c:\sysprep and injected sysprep.xml and guestcustutil.exe into the folder. It just never actually uses them.
Any ideas? Is this working for anyone else?
It's currently a known issue with the customization of Windows 8/Server 2012 guests. After you initially power on the deployed VM, you have to reboot the guest manually once to actually start the customization/sysprep process.
I've read the KB article, but can you clarify what "reboot the guest manually" actually means...?
I've restarted the VM from the power options in vCenter, I've restarted the guest OS from vCenter, I've logged into the guest and rebooted it manually, I've even done these steps with shutdown/power on rather than reboots, and still I've got nothing - I occasionally see the guest customization splash pop up for a few seconds, then it just stops and returns me to my logon prompt again. Any help would be appreciated, or timeline on a fix from VMware, as I'm running vSphere 5.1 which according to the compatibility matrix is supposed to be OK for Server 2012.
Seems like you have a different issue.
Either of these methods should work because you see, the root cause of the one described the KB article and the one I'm seeing is the following:
After cloning a new Windows 2012 VM from Template and powering it on, the customization process creates a scheduled task within the OS to initiate the sysprep. You can see this task in the ordinary Windows Task Scheduler MMC if you just log onto the OS manually directly after deployment/power-on. The task is set to "Run on system startup", so by a reboot/power-off/reset or whatever, it is automatically invoked again on OS startup.
Alternatively, you can just execute the task in the Task Scheduler after logging on with the same effect.
(I do this with Invoke-VMScript for scripted automatic installs as a workaround).
First of all you should check if you see this task in the Task Scheduler. If not then you've probably got a different issue. Also check the logs located in C:\Windows\TEMP\vmware-imc after deployment.
Hi David, Tom,
I've run into the same thing you're seeing. What works for me: deploy Server 2012 VM with customization, once complete and server is fully installed and booted at the Ctrl-Alt-Del prompt initiate a Restart Guest from the vSphere client. Once VM has fully loaded again, you may have seen the customization message at boot, wait! I had to leave the VM 5-10 minutes sitting at the Ctrl-Alt-Del prompt before customization took place and completed, if I recall it then initiated it's own restart.
OK, so interestingly I'm seeing the following event in eventvwr from source "VMware Tools" after the reboot:
[warning] [vmsvcautoUpgrade] vmx returned Autoupgrade is not supported for guest.initiateUpgradeAtShutdown.
Also, I'm not seeing the guest customization task in Task Scheduler, but I am seeing 'guestcust.log' appearing, so it has clearly tried. Reading this log seems to indicate that it/something is breaking networking, as the log stops outputting after "Trying to connect network interfaces..." which is also backed up by the fact networking is broken after the customization attempt - I hadn't spotted that as I'd only been consoling in to this point!
Update: It seems to be wiping out the original IP the template had, but rather than applying the IP from the guest customization wizard, switching it to DHCP. So that's why network is broken, but not sure why the customization wizard is causing it!
I've read some non-VMware forum things about uninstalling and reinstalling the adapters in the OS but I'd rather not have to do that on every 2012 VM if I can help it, does anybody have any further ideas?
It should not try anything like that before the actual customization process started, so I'm not sure this really is causing it.
Anyways, you can just uninstall the NIC Device in the device manager before you shutdown the template VM to mark it as a template. The NIC will automatically be detected on the next startup again aka after you deploy from template again with no manual interaction needed.
This step is part of all my Windows template standard builds, as it prevents the new VMs deployed from this template running with "Local Area Connection 2" NICs and a ghost device in device manager.
Also, I'm fairly sure your first error message from the eventlog is completely unrelated.
Ok, disabling the NIC in the OS before converting to a template seems to have done the trick - I do believe it was this networking issue that was breaking the customization wizard, though...
It seemed to be starting the customization process, doing initial tasks like changing the user/organisation, resetting the admin password, then when it came to joining the domain, because the NIC was broken at some point during the process it couldn't complete this step, which broke the process part way through.
Having the NIC disabled on the template causes it to auto-enable during the process (as advised by MKguy) and apparently doing it this way allows the process to run through from start to finish without incident (following the first manual reboot post-deployment).
Thanks for the assistance!
Are you guys sysprepping the OS prior to converting the VM to template? I ask as I have found that this seems to be what is breaking the VM customization for 2012/2012 R2 VMs. If I don't sysprep the OS prior to converting to template, the VM customization runs as expected.
If I sysprep the OS prior to converting to template, when the VM customization runs, the following WMI query gets run and bombs out, which seems to cause the whole process to fail.
From the C:\Windows\TEMP\vmware-imc\guestcust.log
select * from win32_networkadapter where Manufacturer != 'Microsoft' and ServiceName != 'VMnetAdapter' and manufacturer is not null and MACAddress is not null
Found 0 objects. Pointer 0. return code -2147217398(0x8004100a)
After this, each reboot leads to a message on screen saying VM customization in progress. The only way to get rid of it is to follow another VM KB article for an entirely different issue, but same symptom, which requires removing something from the registry.
This seems to coincide with some of the other posts above about uninstalling/disabling the network as being a potential fix. The WMI query above seems to query the network adapters of the system. It seems this runs while the OS is still trying to finish the previous SYSPREP putting the network card in flux.
Note: This does not happen with 2008. Sysprepped OSes successfully get customized. It seems to be something new with 2012. I think this may be due to changes in the Sysprep process in 2012 vs. 2008.
At any rate, as per the advice above, I will retry with disabling/uninstalling the NIC entirely to see if that helps.
FYI I currently have a support ticket in with VMware with my findings and they have been able to replicate the issue themselves. They stated they will most likely have to work with MS for a resolution.
JLOAIZA, are you referring to the Sysprep before Guest Customization issue that I posted above? If so, I wouldn't expect much on this. After working for several months with VMware Support, it does not appear this will ever be "resolved". In discussing this with them, they have essentially told me this is an MS problem in that they changed how Sysprep is applied. And given the fact that Guest Customization actually runs Sysprep as part of its process, running it manually is just not supported. It does not appear they even understand what the actual issue is or why it's happening, but they've essentially washed their hands of the matter. Truly disappointing, if you ask me.
WOW that sucks. I was able to get it to work in one of my environments but when i go to my other environments it's a crap shoot. I had to get all my VCenter servers to 5.0 U3 which fixed it on my PROD environment. I'll keep trying though it's definitely related to networking though that's a given. BTW thanks for your quick response.
No problem. For clarity, my issue is only present if I sysprep my template before shutting it down/making it a template. If I don't manually sysprep it, the guest customization always worked fine for me.
FYI, it may be worth your trouble to go through VMware support as well. If they get enough cases about the issue they may be more willing to actually FIX it. Just a thought.
Actually i figured out my problem my storage guy copied the wrong VM image template to all the other environments where is failing. I'm having him copy the correct image and if i get it to work I'll share with you what i did. BTW i'm doing exactly what you're trying because i like to run sysprep so that i can copy profile to all other profiles as well as having it so that it never rearms itself. So when you run spec config file deploy via vm it's actually as if it's the first and only time you'll be syspreping it.
I had a situation where any new 2012 R2 VMs would lose the domain connection, IP stack (back to DHCP) and the Drive letters would reset.
Causes three reboots from a cold start, hence the SysPrep. This can happen to any 2008 or 2012 flavor of OS because these OS flavors have SysPrep builtin.
This is due to a known issue with ESXi 5.1 hosts with build level 17443533.
Here is the fix VMware KB2078352.
The original issue has been fixed in vCenter 5.5. Could you please be more specific what kind of issue do you have on 5.5?
Drive letters reset is a known sysprep issues which reproduces at least starting from XP (see Drive Letters Changed After Running Sysprep). We're working on a workaround for the future releases. In the meantime, you would have to backup/restore those registry keys yourself.
I am running 5.5 U2 and deploying a machine from template to create the customizations profile to be used by Horizon so I can setup an 8.1 pool of auto deployed guests....
the customization scripts fail to join the guest to the domain and or rename the machine based on guest name...along with that it disables the administrator account and you cant long in. Every time you cold restart
the guest you can see it trying o run VMware image customization but nothing ever succeeds...
it also doesn't allow for username change?
Username change is currently not supported.
For the rest, please open an SR. If you prefer, you can also post your in-guest logs here in order to troubleshoot this further: