挂载VMDK磁盘镜像

标签 mount computer-forensics virtual-disk vmdk

我有一个带有 vmdk 扩展名的 vmware 磁盘镜像文件

我正在尝试安装它并探索所有分区(包括隐藏的分区)。

我尝试遵循几个指南,例如:http://forums.opensuse.org/showthread.php/469942-mounting-virtual-box-machine-images-host

我可以使用 vdfuse 挂载镜像

vdfuse -w -f windows.vmdk /mnt/

此后我可以看到一个分区和整个磁盘暴露

# ll /mnt/
total 41942016
-r-------- 1 te users 21474836480 Feb 28 14:16 EntireDisk
-r-------- 1 te users  1569718272 Feb 28 14:16 Partition1

继续本指南,我尝试使用挂载 EntireDisk 或 Partition1

mount -o loop,ro /mnt/Partition1 mnt2/

但这给了我错误“挂载:您必须指定文件系统类型”

在尝试找到正确的类型时,我尝试了

dd if=/mnt/EntireDisk | file -
which outputs a ton of information but of note is:
/dev/stdin: x86 boot sector; partition 1: ....... FATs ....

所以我厌倦了作为 vfat 安装,但这给了我

mount: wrong fs type, bad option, bad superblock ...etc

我做错了什么?

最佳答案

对于较新的 Linux 系统,您可以使用 guestmount 挂载 VMDK 镜像中的第三个分区:

guestmount -a xyz.vmdk -m /dev/sda3 --ro /mnt/vmdk

或者,要自动检测并安装图像(不太可靠),您可以尝试:

guestmount -a xyz.vmdk -i --ro /mnt/vmdk

请注意,标志 --ro 只是将镜像安装为只读;要将镜像挂载为可读写,只需将其替换为标志 --rw

安装

guestmount 包含在每个发行版的以下软件包中:

  • Ubuntu:libguestfs-tools
  • OpenSuse:guestfs-tools
  • CentOS/Fedora:libguestfs-tools-c

疑难解答

错误:无法通过 libvirt 创建组件

$ guestmount -a file.vmdk -i --ro /mnt/guest
libguestfs: error: could not create appliance through libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: Cannot access backing file '/path/to/file.vmdk' of storage file '/tmp/libguestfssF6WKX/overlay1.qcow2' (as uid:107, gid:107): Permission denied [code=38 int1=13]

解决方案:按照建议使用LIBGUESTFS_BACKEND=direct:

LIBGUESTFS_BACKEND=direct guestmount -a file.vmdk -i --ro /mnt/guest

fusermount:用户没有对挂载点的写入权限

LIBGUESTFS_BACKEND=direct guestmount -a file.vmdk -i --ro /mnt/guest/
fusermount: user has no write access to mountpoint /mnt/guest
libguestfs: error: fuse_mount failed: /mnt/guest/, see error messages above

解决方案:使用sudo,或更改挂载点上的文件权限

关于挂载VMDK磁盘镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22327728/

相关文章:

android - 如何使用JNI在Android中读取/写入文件slacks?

sql-server - 旧数据存储在数据库文件中

microsoft-graph-api - 以编程方式检索所有 Office 365 统一审核日志

c# - 错误 : Access denied when using the function 'CreateVirtualDisk' in WIN7

linux - 需要将 azure VM OS 磁盘大小从 32 GB 调整为 16 GB

linux - fuse 错误 : Transport endpoint is not connected

docker - 如何将Docker容器的根目录作为NFS挂载点挂载

linux - linux/systemd 中是否有可编程的 automount/autofs Hook ?

delphi - CreateVirtualDisk 给出错误 87(参数不正确。)

linux - 如何在/etc/fstab 中指定带有空格的标签/路径?