I'm faced with a weird issue. I have a remote Windows Server 2016 Std Edition and would like to install Hyper-V. The problem I'm facing is that the provider doesn't use DHCP, so the IP is statically assigned by the OS/Machine. During the installation process of the Hyper-V service, I need to create a Virtual Switch to manage the Host and the virtual machines that will be created. The creation of the V-Switch restores the IP settings to DHCP which means that the host machine will never get an IP address, resulting in disconnection of the RDP Session plus never getting access again - unless the company involves into the process. The involvement of the company means there will be an additional cost - which I'd like to avoid.

Would a custom written script, which would run on startup, be a viable idea? Is there another - safe way - to proceed?

  • No KVM available? I would say "log into KVM and fix the setup". Any server from a provider should have KVM. – TomTom Jun 23 '17 at 16:00
  • KVM was indeed available. It was charged though after 3 hours of usage - which was way more than I needed it. Used it for 10 minutes and did my job! – Rapsoulis Jun 26 '17 at 10:12

Yes, you want to script this. You absolutely can do what you want, you just need to let the machine set itself up rather than trying to do it interactively. For this sort of task, the best strategy is to use Desired State Configuration. The PowerShell Gallery has a bunch of scripts to do exactly what you're looking for via DSC.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.