Dual Boot System: Booting Fedora 32 under Hyper-V failing to find disks

So I have freshly installed Windows 10 2004 and Fedora 32 last night. What I want to do is have My Fedora Install run in the background under Windows, so that my docker containers and any services (like Emby Server) I have continue to function. I do the same with Windows inside Fedora using KVM and that part is working great.

The part that I am having trouble with is booting the Fedora disk. I keep running into Warning: /dev/disk/by-uuid/<hash> does not exist upon booting (it is for my / mount point partition). I tried changing from UUID’s to PARTUUID’s in /etc/fstab and then rebuilding the initramfs image but that seemed to have no effect.

I’m using Hyper-V Gen 2.0 VM with Secure Boot disabled and Physical Drive Passthrough. The Boot drive for Fedora is NVMe - however Hyper-V passes it through as a SCSI device which I believe is the root of the problem, but I’m unsure.

Anyone know how to overcome this problem?

Update: I got it to try and boot using the partuuid but it fails with the same error Warning/disk/by-partuuid/<uuid> does not exist

I check the logs and they don’t seem to contain any useful details

Update 2:

Have made the discovery that it is related to the initramfs image. The rescue image works all the time - Both bare metal and in Hyper-V. If i boot into Rescue from Hyper-V and recompile the initramfs using dracut -f -v then the normal boot image will begin working, however if I go back to bare metal, the image will no longer boot. Again - recompile the image and bare metal will work and hyper-V will not. Need to find a way to configure it to work in both situations.

1 Like

I’ve never seen booting a physical disk to a HyperV VM supported (I’m guessing because of bare metal driver issues and checkpoint support, but I don’t know).

There are sites online that show how to convert a physical disk to a VHD, such as (https://www.nakivo.com/blog/convert-physical-machine-hyper-v-vm/).

If I find some documentation supporting what you’ve described I’ll post that too. Unless you have already found this somewhere?

You can add physical slave disks, if memory serves me.

It does work - You have to disable checkpoints in Hyper-V. It it booting from the drive but it now seems to me that for some reason it is dropping the drives at some point. Maybe it is a kernel issue?

Just discovered that the rescue boot option does work and boots - strange that the normal boot option doesn’t (and the UUID/PARTUUIDs are unchanged from bare metal when in rescue system)

Is that formally supported in HyperV?

I’m surprised to see that, what with so many ppl with instructions on doing the conversions and, even in that case, saying that only Windows OS’s were covertable.

Nice work!

Yup - It definitely works - If I get it all working, I’ll be sure to do a write up as I could see this being useful for more people.

1 Like

I solved it!

Building the initramfs image with the --no-hostonly option fixed it. This flag apparently includes all available drivers in the image instead only the ones need to boot the system. This is why rescue mode worked.

So the only thing need to prepare Fedora 32 is run…

dracut -f --no-hostonly -v

… And then you can configure Hyper-V to boot from the raw disk.

1 Like