简体   繁体   English

如何在 macOS 上使用 vboximg-mount 时修复“hdiutil:附加失败 - 图像无法识别”错误

[英]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.

相关问题 std::process::Command 无法在 macOS 上运行 hdiutil(挂载失败 - 没有此类文件或目录),但该命令在终端中运行时运行良好 - std::process::Command cannot run hdiutil on macOS (mount failed - No such file or directory) but the command works fine when run in the terminal hdiutil:创建失败-错误-5342 - hdiutil: create failed - error -5342 在OS X上使用hdiutil分离卷时出错 - Error when detaching volume using hdiutil on OS X 如何在没有 hdiutil flatten 和 unflatten 动词的情况下,在 macOS 11.0 Big Sur 上向磁盘映像添加软件许可条款 - How to add software license terms to a Disk Image on macOS 11.0 Big Sur without the hdiutil flatten and unflatten verbs 如何使用mount(2)挂载映像 - How to mount image using mount(2) 如何在macOS Mojave上安装eventmachine时修复“错误:无法构建gem原生扩展。” - How to fix “ERROR: Failed to build gem native extension.” when installing eventmachine on macOS Mojave MacOS:如何使用 docker-compose.yml 和 Dockerfile 挂载卷? - MacOS: How to mount volumes using docker-compose.yml and Dockerfile? 如何修复 Python 3 PyAutoGUI 屏幕截图错误? (苹果系统) - How to fix Python 3 PyAutoGUI screenshot error? (macOS) 使用Homebrew-cask安装DMG文件时,hdiutil无响应 - hdiutil not responsive when installing DMG files using homebrew-cask 在MacOS上使用gfortran时出错 - Error when using gfortran on MacOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM