尝试从 .img 转换为 .vdi:VERR_VD_INVALID_SIZE

zii*_*web 3 virtualbox

尝试将 .img 文件转换为 .vdi 文件时出现以下错误。

VBoxManage convertfromraw file.img file.vdi
Converting from raw image file="file.img" to file="file.vdi"...
Creating dynamic image with size 814188811483 bytes (776471MB)...
VBoxManage: error: VD: The given disk size 814188811483 is not aligned on a sector boundary (512 bytes)
VBoxManage: error: Error code VERR_VD_INVALID_SIZE at /home/vbox/vbox-6.0.10/src/VBox/Storage/VD.cpp(6231) in function int VDCreateBase(PVDISK, const char*, const char*, uint64_t, unsigned int, const char*, PCVDGEOMETRY, PCVDGEOMETRY, PCRTUUID, unsigned int, PVDINTERFACE, PVDINTERFACE)
VBoxManage: error: Cannot create the disk image "file.vdi": VERR_VD_INVALID_SIZE
Run Code Online (Sandbox Code Playgroud)

我使用“dd”命令获取了 .img。

我在 Ubuntu 14.04 上使用 VB 6.0.10。

Kwa*_*wan 9

根据此链接,https://forum.openwrt.org/t/error-convert-img-to-vdi/1521。我终于找到解决办法


dd if=original.squashfs.combined.img of=padded.img bs=100m conv=sync
在将图像转换为虚拟机图像之前, 您需要使用类似的方法来填充图像。