If I have 2 image files (one EFI and one ROOT) can I put them in virtmanager and boot up? They are both RAW disk files
Gemini
Yes, but not directly with default settings.
Because your operating system components are split into two separate raw image files (one containing the UEFI bootloader/FAT32 boot partition and one containing the root filesystem), simply attaching both drive files to virt-manager will usually fail to boot automatically.
When virt-manager starts a VM, the firmware (UEFI) looks at the EFI disk for a bootloader, but that bootloader's configuration (like GRUB) will typically expect the root partition to exist on the same virtual drive or look for specific UUID s.
Here is how to get it working in virt-manager, listed from easiest to most reliable:
Method 1: Mount Both Disks + Configure UEFI Firmware
Gemini
2. Create Partition 1 for EFI (1 MiB to 2 GiB)
qemu-img create -f raw combined.raw 1000G
parted -s combined.raw mkpart primary fat32 1MiB 2048MiB
parted -s combined.raw set 1 esp on
3. Create Partition 2 for ROOT (2 GiB to 100% of the drive)
parted -s combined.raw mkpart primary ext4 2048MiB 100%
*Verification:* Run `parted -s combined.raw print` to confirm the partition layout:
Number Start End Size File system Name Flags
1 1048kB 2147MB 2146MB fat32 primary boot, esp
2 2147MB 1074GB 1072GB ext4 primary
### Step 3: Map the New Partitions to Loop Devices
Re-attach `combined.raw` to `kpartx`:
sudo kpartx -av combined.raw
*Verification:* Run `ls -l /dev/mapper/loop*` to ensure `loop0p1` and `loop0p2` appear.
### Step 4: Stream efi.raw and root.raw to the Partitions
Now write the raw images into their respective loop partitions:
Copy EFI partition (~1 GiB)
sudo dd if="./efi.raw" of=/dev/mapper/loop0p1 bs=4M status=progress conv=fsync
Copy ROOT partition (~885.5 GiB)
sudo dd if="./root.raw" of=/dev/mapper/loop0p2 bs=4M status=progress conv=fsync
*Verification:* Both `dd` commands will complete without "No space left on device" errors, reporting the full byte counts written matching `efi.raw` and `root.raw`.
### Step 5: Sync and Detach
Flush writes to disk and remove loop bindings:
sync
sudo kpartx -dv combined.raw
`combined.raw` is now fully assembled and ready to boot in `virt-manager`.
