Convert VM on physical disk to physical machine


Recommended Posts

I realize this is a bit of a strange thing to want to do... I have a Red Hat VM that I installed to a physical disk (using the VirtIO driver) and have been running under UnRAID. I would now like to boot the physical machine from that physical disk directly. My system doesn't find anything bootable on the disk though. What am I missing? Is this possible at all? Thanks.

Link to comment
2 hours ago, moldyviolinist said:

I realize this is a bit of a strange thing to want to do... I have a Red Hat VM that I installed to a physical disk (using the VirtIO driver) and have been running under UnRAID. I would now like to boot the physical machine from that physical disk directly. My system doesn't find anything bootable on the disk though. What am I missing? Is this possible at all? Thanks.

Need additional information.
When using VirtIO did you use the RawDISK or did you create a disk image on a partition on that disk?

Is the target machine using BIOS or EFI?
What's the VM configuration look like?

In theory, with a RawDISK you should be able to yank it from the VM environment and transplant it into a physical machine with no headaches. In fact I use VMs for testing disks that I image rather than a physical box as it simplifies my workflow. Most likely you are trying to boot a UEFI disk with a legacy BIOS or a legacy BIOS compatible disk with UEFI only.

Link to comment
16 minutes ago, Xaero said:

Need additional information.
When using VirtIO did you use the RawDISK or did you create a disk image on a partition on that disk?

Is the target machine using BIOS or EFI?
What's the VM configuration look like?

In theory, with a RawDISK you should be able to yank it from the VM environment and transplant it into a physical machine with no headaches. In fact I use VMs for testing disks that I image rather than a physical box as it simplifies my workflow. Most likely you are trying to boot a UEFI disk with a legacy BIOS or a legacy BIOS compatible disk with UEFI only.

 

I used the raw disk. Here's my VM configuration. The disk path is the disk itself, not a partition.

 

vmcfg.thumb.png.208bb40d6671d58f6a42c48d4a28273b.png

 

I believe OVMF is UEFI only, right? So the VM must be using UEFI.

 

That does sound likely, that it's some UEFI/legacy BIOS issue, but my motherboard supports UEFI, in fact I boot the UnRAID USB in UEFI mode. Yet it won't boot the disk.

Link to comment
2 hours ago, moldyviolinist said:

I believe OVMF is UEFI only, right? So the VM must be using UEFI.

 

That does sound likely, that it's some UEFI/legacy BIOS issue, but my motherboard supports UEFI, in fact I boot the UnRAID USB in UEFI mode. Yet it won't boot the disk.

What does fdisk -l /dev/disk/by-id/ata-KINGSTON.... look like?
If I'm not mistaken, you'd need to be booting UEFI only or have the UEFI boot order entry for the disk in question before the legacy options for all devices. My experience with UEFI booting is fairly limited.

I do see you are using the raw disk (or at least, think you are, the node is cut off) It's possible to treat the first partition of a disk as the disk with VirtIO and then you end up with a disk image stored as a partition.

Link to comment
10 hours ago, Xaero said:

What does fdisk -l /dev/disk/by-id/ata-KINGSTON.... look like?
If I'm not mistaken, you'd need to be booting UEFI only or have the UEFI boot order entry for the disk in question before the legacy options for all devices. My experience with UEFI booting is fairly limited.

I do see you are using the raw disk (or at least, think you are, the node is cut off) It's possible to treat the first partition of a disk as the disk with VirtIO and then you end up with a disk image stored as a partition.

 

# fdisk -l /dev/disk/by-id/ata-KINGSTON_SV300S37A120G_50026B773B022F76
Disk /dev/disk/by-id/ata-KINGSTON_SV300S37A120G_50026B773B022F76: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SV300S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D8836FFA-50DF-4C2E-8204-CCC00C6A0363

Device                                                              Start       End   Sectors   Size Type
/dev/disk/by-id/ata-KINGSTON_SV300S37A120G_50026B773B022F76-part1    2048    514047    512000   250M EFI System
/dev/disk/by-id/ata-KINGSTON_SV300S37A120G_50026B773B022F76-part2  514048   2050047   1536000   750M Microsoft basic data
/dev/disk/by-id/ata-KINGSTON_SV300S37A120G_50026B773B022F76-part3 2050048 234440703 232390656 110.8G Microsoft basic data

 

Right, my motherboard doesn't give me any specific option to boot the disk as UEFI... It does give me both options with the UnRAID USB. Wondering if it's just a motherboard problem.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.