Installing Hyper-V Blind
One of the initiatives at work right now is to prepare for / expand on IPv6 adoption. We have a great lab environment just begging to be hacked away at and it’s a perfect chance for some self-paced real-world learning on cool stuff that doesn’t apply directly to my daily responsibilities.
To that end, we needed a VM environment so we don’t crowd up the lab racks with physical hardware. We’re entirely a VMware shop but where’s the fun in just spinning up another ESXi host? My goal:
- Server 2012 Standard – It would’t really be a fair virtualization tech comparison if we went with Server 2008 and it’s Hyper-V 2.0. We need new and 3.0!
- Server Core install – That means no GUI! Command prompt and powershell is required until the system is up enough to accept remote management connections that have a more GUI-driven interface
- Configure Hyper-V as much as possible using PowerShell. But I do hope to enable things so that my colleagues can fall back on the GUI as needed
- No using IPv4 during setup. I want it going through the virtual switch and available to guests at the end, but that’s it
So that I can look a little more bad-ass in the lab when I’m working on this, I decided to do a test run at home and get through a bunch of the “how the hell do I _____ ?” stuff. Here’s my notes on everything I ran into:
- Use setres -w #### -h #### to change the screen resolution
- There’s a decent “Getting started with Server Core” guide on TechNet that the rest of my notes are based around
- Get-NetIPInterface is frustrating because it won’t show me the MAC of these interfaces
- Came up with this instead:
Get-NetAdapter | Select Name,MacAddress,ifIndex,Status - To rename an adapter: (annoyingly can’t use the interfaceIndex property)
Rename-NetAdapter -Name “Current Name” -NewName “New Name” - To set a static IP:
New-NetIPAddress -InterfaceIndex ## -IPAddress 123.123.123.123 -PrefixLength ## -DefaultGateway 123.123.123.123 - No info ANYwhere on how to switch back to DHCP though using PowerShell and not WMI though
- Came up with this instead:
- Didn’t find a suitable powershell equivalent for what ipconfig does for me
- To join to AD, use Add-Computer with no parameters and you’ll be walked through. Make sure the computer object is created in AD beforehand. Looks buggy according to internet. Failback method is netdom)
- Rename-Computer does just what you’d expect
- Can’t believe slmgr.vbs is still the command-line way of activating Windows
- Install-WindowsFeature feature1,feature2 (dependencies automatically grabbed. Use -whatif to show them)
- End of testing. Can’t install Hyper-V role within Hyper-V it looks like, despite being able to install Hyper-V under VMware (after some tweaks). I probably just don’t know the equivalent tricks