I had a plan this weekend to get my Veeam components all updated with the recent release of v10 RTM and I wanted to use Windows 2019 Server Core for some of my proxy components. Lightweight and should be easy to spin up and spin down as and when you need them.
Anyway, there were two things I was finding when it came to spin up my new lab using terraform and that was Guest Customisation being a pain.
The pain was that the guest customisation just didn’t work on the template that I had, my advice is troubleshoot this for all of 5 minutes if it’s a quick fix then great if not throw your template away and build another one.
My other advice is when building templates or any machine in a lab maybe go for the same password throughout to avoid maybe something being typed in wrong…
Ok so back to the pain points but more so it’s really quick to get a new server core machine up and running. Like no time at all.
The first thing you want to do is check that you have picked up a valid IP address and that you have access to a network with internet access on.
The first thing I want to do when creating a template is make sure it’s as up to date as possible. Your best friend in Server Core is going to be “sconfig”
From the command prompt type “sconfig” and enter
No, you don’t have to just worry about command shell and guess the commands you need to run. Here you can do all of your administration tasks very much including if you wish computer name and join to the domain.
If you are using terraform with this template later then my suggestion is do your windows updates and everything you want to do for your vanilla image. But then shut down and clone and run through the steps manually to confirm you have everything configured correctly, there is nothing like waiting for terraform to time out and fail. It roughly takes 11 minutes and 3 seconds a friend told me.
Make sure that you have the correct network configuration you wish, I tend to boot machines and get a DHCP address and then I assign a static through terraform.
When you have confirmed you have internet then you can select the windows update option in the previous sconfig screen.
Another thing you want to make sure you have is VMware tools installed on your machine. Biggest bit of advice go and download from vmware.com the latest VMware Tools available and place somewhere that is accessible on the network.
Mount the ISO that you have downloaded and from the cmd prompt change to your disk drive and run setup.exe
This as I might have said is a lab so depending on your use case you may wish to turn off the firewall on the machine if this is the case then you can use the following two PowerShell commands
Check firewall status and if enabled
And to disable those you run
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled false
Final thing make sure everything is done before you shut down and turn this into a template.