VMWare-Mount 无法识别虚拟磁盘

发布于 2024-08-23 06:45:00 字数 1157 浏览 6 评论 0原文

我有两个磁盘作为 .vmdk 文件,四个磁盘作为 .vdi 文件。我可以使用 Sun xMV VirtualBox 在其上启动虚拟机,并且它们工作得很好。但是,我想将它们安装在本地计算机上,这样我就可以在不启动虚拟机的情况下读取其中的一些文件。我下载了 vmware-mount 实用程序,但收到此错误:

Unable to mount the virtual disk. The disk may be in use by a virtual
machine, may not have enough volumes or mounted under another drive
letter. If not, verify that the file is a valid virtual disk file.

我认为这是该实用程序的问题,因此下载了 SDK 并用 C 语言编写了自己的简单程序来尝试挂载磁盘。它只是初始化 API,连接到它,然后尝试打开磁盘。我收到此错误,再次声称它不是虚拟磁盘:

**LOG: DISKLIB-DSCPTR: descriptor above max size: I64u
**LOG: DISKLIB-LINK  : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-CHAIN : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-LIB   : Failed to open 'f:\programming\VMs\windowstrash.vdi' with flags 0x1e (The file specified is not a virtual disk).
** FAILURE ** : The file specified is not a virtual disk

不过,这些文件显然是虚拟磁盘,因为我实际上可以在虚拟机上安装和使用它们。我尝试将它们与任何虚拟机分离并重试,但得到了相同的结果。

有什么想法吗?也许“描述符高于最大大小”是一个提示?

I have two disks as .vmdk files, and four as .vdi files. I can boot virtual machines on them with Sun xMV VirtualBox, and they work just fine. However, I want to mount them on my local computer so I can read some files off of them without starting a virtual machine. I downloaded the vmware-mount utility, but I get this error:

Unable to mount the virtual disk. The disk may be in use by a virtual
machine, may not have enough volumes or mounted under another drive
letter. If not, verify that the file is a valid virtual disk file.

Thinking it's a problem with the utility, I downloaded the SDK and made my own simple program in C to try to mount a disk. It just initializes the API, connects to it, then attempts to open the disk. I get this error, once again claiming it is not a virtual disk:

**LOG: DISKLIB-DSCPTR: descriptor above max size: I64u
**LOG: DISKLIB-LINK  : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-CHAIN : "f:\programming\VMs\windowstrash.vdi" : failed to open (The file specified is not a virtual disk).
**LOG: DISKLIB-LIB   : Failed to open 'f:\programming\VMs\windowstrash.vdi' with flags 0x1e (The file specified is not a virtual disk).
** FAILURE ** : The file specified is not a virtual disk

The files are clearly virtual disks, though, since I can actually mount and use them with a virtual machine. I tried detaching them from any VMs and trying again, but I got the same results.

Any ideas? Maybe the "descriptor above max size" is a hint?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

殤城〤 2024-08-30 06:45:00

.vdi 是 VirtualBox 支持的格式,但 VMWare 不支持。

.vmdk 文件是 VMWare 映像 - 您应该能够使用 vmware 工具很好地加载它们(VirtualBox 也支持这些文件,但反之则不然)。

.vdi is a VirtualBox supported format, but not supported by VMWare.

The .vmdk files are VMWare images - you should be able to load them fine using the vmware tool (VirtualBox supports these too, but the converse is not true).

明媚殇 2024-08-30 06:45:00

如果您尝试仅挂载 VDI 映像,请尝试 http://bethesignal.org/blog/2011/01/05/how-to-mount-virtualbox-vdi-image/ :

  • 成为超级用户,使用sudo su

  • 加载 nbd 内核模块(网络块设备模块),使用 modprobe nbd

  • 使用 qemu-nbd -c /dev/nbd0 运行 qemu-nbd。这是用于 QEMU 支持的磁盘映像的用户空间环回块设备服务器。基本上,它知道所有奇怪的磁盘映像格式,并通过 nbd 将它们呈现给内核,并最终呈现给系统的其余部分,就像它们是普通磁盘一样。

该命令会将整个映像公开为名为 /dev/nbd0 的块设备,并将其中的分区公开为子设备。例如,映像中的第一个分区将显示为 /dev/nbd0p1

例如,现在您可以在块设备上运行 cfdisk,但您很可能希望挂载单个分区:

mount /dev/nbd0p1 /mnt

完成后,卸载文件系统并关闭 qemu-nbd 服务:

umount /mnt
qemu-nbd -d /dev/nbd0

If you are trying to just mount the VDI image, try these steps as described at http://bethesignal.org/blog/2011/01/05/how-to-mount-virtualbox-vdi-image/ :

  • Be the super user, using sudo su

  • Load the nbd kernel module (the network block device module), using modprobe nbd

  • run qemu-nbd using qemu-nbd -c /dev/nbd0 <vdi-file>. This is a user space loopback block device server for QEMU-supported disk images. Basically, it knows all about weird disk image formats, and presents them to the kernel via nbd, and ultimately to the rest of the system as if they were a normal disk.

That command will expose the entire image as a block device named /dev/nbd0, and the partitions within it as subdevices. For example, the first partition in the image will appear as /dev/nbd0p1.

Now you could, for instance, run cfdisk on the block device, but you will most likely want to mount an individual partition:

mount /dev/nbd0p1 /mnt

When you’re done, unmount the filesystem and shut down the qemu-nbd service:

umount /mnt
qemu-nbd -d /dev/nbd0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文