8

I'm trying to install CentOS 7 using Hyper-V and it's failing with the following error message:

tsc: Fast TSC calibration failed
PCI: Fatal: No config space access function found
i8042: No controller found

[long waiting period...]

dracut-initqueue[475]: Warning: Could not boot.
dracut-initqueue[475]: Warning: /dev/disk/by-label/CentOS-7-livecd-x86_64 does not exist
dracut-initqueue[475]: Warning /dev/mapper/live-rw does not exist
Warning: /dev/disk/by-label/CentOS-7-livecd-x86_64 does not exist
Warning: /dev/mapper/live-rw does not exist

Generating "/run/initramfs/rdsosreport.txt"

I have created a Generation 2 virtual machine and disabled Secure Boot so it would at least start booting.

Giovanni Tirloni
  • 5,693
  • 3
  • 24
  • 49

3 Answers3

7

CentOS 7 currently does not support running on Hyper-V Generation 2 virtual machines, as can be seen here. You have to recreate the VM and specify Generation 1 as the VM type.

Linux Virtual Machines on Hyper-V provides a comprehensive list of which distributions are supported and any limitations associated with them.

For a list of the differences between Gen1 and Gen2 virtual machine, check this page. You'll notice Legacy BIOS is gone in favor of UEFI.

Giovanni Tirloni
  • 5,693
  • 3
  • 24
  • 49
  • I've ran RHEL/CentOS/Oracle Linux as a Gen2 VM since 7.0 Beta. Before 7, then yea stick with gen 1, but why run anything that archaic anyways. The link that was provided if read towards the bottom #14. I believe states: Generation 2 virtual machines have secure boot enabled by default and Generation 2 Linux virtual machines will not boot unless the secure boot option is disabled. You can disable secure boot in the Firmware section of the settings for the virtual machine in Hyper-V Manager or you can disable it using Powershell: – Brad Jan 24 '16 at 03:00
6

You don't need to switch back to a Generation 1 virtual machine. You can use a Generation 2 virtual machine, so long as you disable Secure Boot.

To quote from Microsoft:

Generation 2 virtual machines have secure boot enabled by default and Generation 2 Linux virtual machines will not boot unless the secure boot option is disabled. You can disable secure boot in the Firmware section of the settings for the virtual machine in Hyper-V Manager or you can disable it using Powershell:

Set-VMFirmware –VMName "VMname" -EnableSecureBoot Off

Supporting Secure Boot is still a work-in-progress in most Linux distributions.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • I've also gotten it to boot with Secure Boot *ON* by changing the Template option underneath the checkbox to "Microsoft UEFI Certificate Authority". – RobinHood70 Aug 02 '16 at 23:02
  • This is an older thread. Just to clarify as of 05/2018, you can create CentOS 7 VMs in Hyper-V. I have a bunch. You still have to disable secure boot though. – Adam May 04 '18 at 15:58
2

I suspect more recent versions of CentOS will eventually no longer have the issue you faced (see https://bugzilla.redhat.com/show_bug.cgi?id=1192030 for the same issue in Fedora)

Anon
  • 1,210
  • 10
  • 23
  • Could you please check if that's the case? – Deer Hunter Oct 10 '15 at 13:42
  • 1
    @DeerHunter: I'm not a CentOS user so I can't check but if your CentOS LiveOS ISO's initrd.img doesn't have hv_vmbus.ko.xz inside you're going to see breakage. I wasn't saying it is already fixed at the time of writing (10th Oct 2015) because the Bugzilla link says it's still broken today (11th) in Fedora 23 Beta (and Fedora generally gets fixes quicker than CentOS). However this issue is the same as Fedora's and fixing it there should eventually help CentOS (I suspect the gap between the two will be smaller if a CentOS user raises a separate bug report pointing to the Fedora one hinthint :-). – Anon Oct 11 '15 at 15:41
  • This issue is now fixed in Fedora 23 (3rd November 2015) - if you're CentOS person it should be easy to open a bugzilla bug pointing at the Fedora one to have the fix ported over! – Anon Nov 04 '15 at 06:32
  • 1
    It's a bit more complicated, livecd-tools needs to be patched and then used in brew/koji buildroot. I created backport request into RHEL7: https://bugzilla.redhat.com/show_bug.cgi?id=1595574 – lzap Jun 27 '18 at 07:55