[英]How to fix 'hdiutil: attach failed - image not recognized' error when using vboximg-mount on macOS
I'm unable to mount a VHD file even though I can mount the DMG it was made from and file
seems to think both the vhdd
and .dmg
file are the same kind of file.即使我可以挂载制作它的 DMG,我也无法挂载 VHD 文件,而且
file
似乎认为vhdd
和.dmg
文件是同一种文件。 I'm on macOS 10.14.6 with VirtualBox 6.0.12r133076.我在带有 VirtualBox 6.0.12r133076 的 macOS 10.14.6 上。
Here's a transcript of what I'm trying to do (ending with the error):这是我正在尝试做的事情的记录(以错误结尾):
$ hdiutil create -megabytes 2 -fs ExFAT foo.dmg
created: /Users/matt/tmp/foo.dmg
$ vboxmanage convertfromraw --format vhd foo.dmg foo.vhd
Converting from raw image file="foo.dmg" to file="foo.vhd"...
Creating dynamic image with size 2097152 bytes (2MB)...
$ mkdir foo_mnt
$ vboximg-mount --image=$(pwd)/foo.vhd foo_mnt
$ file foo.dmg
foo.dmg: DOS/MBR boot sector; partition 1 : ID=0x7, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 1, 4095 sectors, extended partition table (last)
$ file foo_mnt/vhdd
foo_mnt/vhdd: DOS/MBR boot sector; partition 1 : ID=0x7, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 1, 4095 sectors, extended partition table (last)
$ hdiutil attach foo.dmg
/dev/disk3 FDisk_partition_scheme
/dev/disk3s1 Windows_NTFS /Volumes/Untitled 1
$ hdiutil attach foo_mnt/vhdd
hdiutil: attach failed - image not recognized
Update : Could it really just be the file extension?更新:真的只是文件扩展名吗? If I do
ln -s foo_mnt/vhdd something.dmg
I can then mount with如果我执行
ln -s foo_mnt/vhdd something.dmg
我可以安装
$ hdiutil attach something.dmg
I got this error too.我也遇到了这个错误。 It turned out that I was in the wrong folder.
原来我在错误的文件夹中。 It should have said "file not found".
它应该说“找不到文件”。 Maybe they will fix it one day.
也许他们有一天会修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.