VirtualBox安装别人给的镜像时需要先转成vdi格式,VBoxManage本身提供了转换功能,VBoxManage.exe convertfromraw image_file.img target_file.vdi --format VDI但是转换失败了,本篇记录转换失败的解决方案
PS E:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe convertfromraw openwrt-ext4.img openwrt-ext4.vdi --format VDI
Converting from raw image file="openwrt-ext4.img" to file="openwrt-ext4.vdi"...
Creating dynamic image with size 285736960 bytes (273MB)...
VBoxManage.exe: error: VDI: cannot create image 'openwrt-ext4.vdi'
VBoxManage.exe: error: Error code VERR_ACCESS_DENIED at D:\tinderbox\win-rel\src\VBox\Storage\VDI.cpp(700) in function int __cdecl vdiImageCreateFile(struct VDIIMAGEDESC *,unsigned int,struct VDINTERFACEPROGRESS *,unsigned int,unsigned int)
VBoxManage.exe: error: Cannot create the disk image "openwrt-ext4.vdi": VERR_ACCESS_DENIED
原因是权限不够,需要用管理权限执行命令
现在执行成功能了