How to fix a failing grub-pc package installation in Hyper-V virtual machine?

Solution 1:

I found that the "the grub-pc package failed to install" grub installation problem for Ubuntu 12.04.1 Server was related to the degree of network access. If there was no network connection (cable unplugged) Grub-PC installed OK (but then you need to configure the network by hand). If it was connected to an isolated or limited network (LAN access only or bad DNS) that could not contact an external ubuntu server, the Grub-PC installation failed. Only if it had full network access, was Grub-PC able to install correctly, ah including networking.

So my suggestion is to first troubleshoot your local network to make sure that it is providing complete Internet access. If it isn't, fix it, or completely disconnect from the network, do the install and then install and troubleshoot the network after the rest of the installation is complete.