Open joefitzgerald opened 10 years ago
Could this sysprep be used to prepare the basebox in a way to rename the computername after the next boot which is then done by first vagrant up call?
I think of a way
I don't know sysprep enough, but I have seen manually created VMs which ask for a new computername on first boot. If this could be set with something like an unattend.xml on boot time by vagrant then this could save me one reboot.
At the moment I have to reboot freshly created vagrant Windows boxes so they really have their new computernames from vagrant-windows plugin.
My Packer shutdown command specifies another unattend xml file - which contains the new computer name. This is run on first boot after Packer has finished with the box.
"shutdown_command": "c:/windows/system32/sysprep/sysprep.exe /generalize /oobe /quiet /shutdown /unattend:a:/unattend.xml",
Can you please post your unattend.xml I do not seem to be able to change the computername as it errors out.
+1 to this idea, I'll look into it, but like others I don't have much experience with sysprep. @sneal could you post your unattend.xml file for this? Any thoughts on how to pass the hostname to sysprep through an environment variable or something along those lines?
I've been using this one for 2008R2: https://gist.github.com/stonith/33a75407b465cfbf4f5e
Specify the ComputerName on line 39. I'm also uninstalling OpenSSH on first boot but that can be removed.
Anyone still working on this ?
This would ensure that a base box does not begin counting down the activation clock until you use it for the first time - at the expense of using up one of the three
sysprep /generalize
runs that you can do (http://technet.microsoft.com/en-us/library/dd744512(v=ws.10).aspx).