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

33,532

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.

Share:
33,532

Related videos on Youtube

Marc
Author by

Marc

Updated on September 18, 2022

Comments

  • Marc
    Marc over 1 year

    I am trying to install Ubuntu Server 12.04 64 bit on a Windows Hyper-V virtual machine. I am having issues with the following error:

    the grub-pc package failed to install into /target/
    

    I have tried the suggestion of doing a "rescue failed system" and doing the apt-get to repair the boot loader, but my virtual machine can't download the updates due to DNS issues (for some reason, it's not getting DNS resolution).

    I have also tried reinstalling the boot loader in the rescue failed system, and the loader appears to install correctly (no errors). But after rebooting the system, it will not boot.

    I'm including a screenshot.

    • Admin
      Admin over 11 years
      a temporary solution for your dns issue is: sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf && sudo /etc/init.d/networking restart but this will get overriden on next reboot.
    • Admin
      Admin over 11 years
      Will this work when booted from the CD in rescue mode?
    • Admin
      Admin over 11 years
      I've never used rescue mode. But if you have connection to modem but having dns issues, this should work. For example, if you can ping your IP, but can't ping google, this should work.
    • Admin
      Admin over 11 years
      I got this to work...I have no idea why it worked. I wiped the install and reinstalled without network connectivity (I disabled the virtual network interface). The boot loader installed without issue. After rebooting, Ubuntu Server came up. I shut it down, reconnected the virtual NIC, brought it back up, and we're good!
  • Donal Lafferty
    Donal Lafferty almost 11 years
    So why not accept the correct answer by @J.Porter?
  • Prasun Jajodia
    Prasun Jajodia about 7 years
    Connecting to a network worked for me. But 'm curious as too why
  • user1708042
    user1708042 about 4 years
    I had a similar problem: I was installing Parrot in virtualbox: my network went off while installing and I got this same error. I forund a video on youtube (youtube.com/watch?v=eM023W7D6OQ) by I guy who suggested to manually install grub-pc via apt-get in terminal. I did give a try to that but the network did not work. So I repeated the installation from scratch. When I got the error I switched to a terminal renenabled dhcp (issuing the command 'dhclient') added manually 8.8.8.8 to /etc/resolf.conf and next I could complete the installation. I guess it simply downloads grup-pc