Azure is a great service for hosting virtual machines, however sometimes VMs get into trouble and aren’t able to boot… Then you find yourself longing for a keyboard and screen connected directly or via Hyper-V or ESX.
Alas don’t despair there are two options that may help!
Within the Azure Portal there is a Serial Console option, which can give you access to the VM without needing to remote into the VM. This is great for when you’ve locked yourself out in some way. Conrad recently blogged about a use case for this when sysprepping a domain joined machine
You get to the Serial Console by going to the Virtual Machine in Azure and then in the VM blade looking toward the bottom for Serial Console
Once you have the serial console connected then you can type
cmd
ch -si 1
to get to a command prompt after entering administrative credentials.
There are cases where you can’t get a serial console to work, one recent case for us was a Domain Controller that kept throwing a 0xc00002e2 stop error, which means ADDS is unable to start. Normally you would start the VM without ADDS running and work out what happened. Often it is a disk that failed to come online, which has happened to us a few times with on-premises VMs after Microsoft patching/reboot.
Of course in Azure you can’t press F8 to get to the Advanced Boot Options menu. True but you can create a VM within Azure that runs Hyper-V which uses the disks/snapshots of the broken VM to create a VM where you can press F8!
OK I admit that is a bit of a mind meld but it does actually work!
So the high level steps to achieve this are