【问题标题】:How to convert a qemu image (2 pflash + ide) to virtualbox vdi?如何将 qemu 映像(2 pflash + ide)转换为 virtualbox vdi?
【发布时间】:2020-06-17 15:28:23
【问题描述】:

我以这种方式使用 QEMU 启动 VM:

qemu-system-x86_64 \
    -m 512M \
    -drive file=ovmf.qcow2,if=pflash,format=qcow2,unit=0,readonly=on \
    -drive file=ovmf.vars.qcow2,if=pflash,format=qcow2,unit=1 \
    -nographic \
    -drive file=file.uefiimg,if=ide,format=raw

fdisk -l file.uefiimg 输出:

Disk file.uefiimg: 2 GiB, 2147483648 bytes, 4194304 sectors
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: DC9B048E-91D0-4DD0-BD7A-4D6130AA726F

Device          Start     End Sectors  Size Type
file.uefiimg1   16384   49151   32768   16M EFI System
file.uefiimg2   49152 1589247 1540096  752M Linux filesystem
file.uefiimg3 1589248 3129343 1540096  752M Linux filesystem
file.uefiimg4 3129344 4177919 1048576  512M Linux filesystem

现在棘手的部分是我想在 Virtualbox 上启动它。如果不可能,vmware 也是一种选择。我尝试使用 VBoxManage 将 uefiimg 转换为原始图像,然后再转换为 vdi,但没有成功。我认为主要问题是我需要包含 qcow2 文件。我读到了这 2 个文件,作为 pflash 插入,但我不明白如何在 VirtualBox 中加载它们(或者如果可能的话)

【问题讨论】:

    标签: virtualbox qemu uefi


    【解决方案1】:

    我将图像转换为 vdi

    VBoxManage convertfromraw file.uefiimg --format vdi file.vdi

    然后,加载这个 vdi 并完美运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      相关资源
      最近更新 更多