使用 Linux 挂载 VHD/VHDX 磁盘映像

使用 Linux 挂载 VHD/VHDX 磁盘映像

如何在 Linux 中安装.vhd/ .vhdx,正如我在 Raspberry Pi 上尝试以下操作一样:

guestmount --add "MYDISK.vhdx" --inspector --ro "/media/pi/MYDISK"
  • 日志:
    guestmount --add MYDISK.vhdx --inspector --ro /media/pi/MYDISK/
    libguestfs: trace: set_verbose true
    libguestfs: trace: set_verbose = 0
    libguestfs: create: flags = 0, handle = 0x1ac5c78, program = guestmount
    libguestfs: trace: set_recovery_proc false
    libguestfs: trace: set_recovery_proc = 0
    libguestfs: trace: add_drive "MYDISK.vhdx" "readonly:true"
    libguestfs: creating COW overlay to protect original drive content
    libguestfs: trace: get_tmpdir
    libguestfs: trace: get_tmpdir = "/tmp"
    libguestfs: trace: disk_create "/tmp/libguestfsdUvGee/overlay1" "qcow2" -1 "backingfile:/media/pi/BACKUP/ARCHIVES/MYDISK.vhdx"
    libguestfs: command: run: qemu-img
    libguestfs: command: run: \ create
    libguestfs: command: run: \ -f qcow2
    libguestfs: command: run: \ -o backing_file=/media/pi/BACKUP/ARCHIVES/MYDISK.vhdx
    libguestfs: command: run: \ /tmp/libguestfsdUvGee/overlay1
    Formatting '/tmp/libguestfsdUvGee/overlay1', fmt=qcow2 size=1099511627776 backing_file=/media/pi/BACKUP/ARCHIVES/MYDISK.vhdx encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
    libguestfs: trace: disk_create = 0
    libguestfs: trace: add_drive = 0
    libguestfs: trace: launch
    libguestfs: trace: version
    libguestfs: trace: version = <struct guestfs_version = major: 1, minor: 34, release: 6, extra: , >
    libguestfs: trace: get_backend
    libguestfs: trace: get_backend = "direct"
    libguestfs: launch: program=guestmount
    libguestfs: launch: version=1.34.6
    libguestfs: launch: backend registered: unix
    libguestfs: launch: backend registered: uml
    libguestfs: launch: backend registered: libvirt
    libguestfs: launch: backend registered: direct
    libguestfs: launch: backend=direct
    libguestfs: launch: tmpdir=/tmp/libguestfsdUvGee
    libguestfs: launch: umask=0022
    libguestfs: launch: euid=1000
    libguestfs: is_openable: /dev/kvm: No such file or directory
    libguestfs: trace: get_backend_setting "force_tcg"
    libguestfs: trace: get_backend_setting = NULL (error)
    libguestfs: trace: get_cachedir
    libguestfs: trace: get_cachedir = "/var/tmp"
    libguestfs: begin building supermin appliance
    libguestfs: run supermin
    libguestfs: command: run: /usr/bin/supermin
    libguestfs: command: run: \ --build
    libguestfs: command: run: \ --verbose
    libguestfs: command: run: \ --if-newer
    libguestfs: command: run: \ --lock /var/tmp/.guestfs-1000/lock
    libguestfs: command: run: \ --copy-kernel
    libguestfs: command: run: \ -f ext2
    libguestfs: command: run: \ --host-cpu arm
    libguestfs: command: run: \ /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d
    libguestfs: command: run: \ -o /var/tmp/.guestfs-1000/appliance.d
    supermin: version: 5.1.17
    supermin: package handler: debian/dpkg
    supermin: acquiring lock on /var/tmp/.guestfs-1000/lock
    supermin: build: /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d
    supermin: reading the supermin appliance
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/base.tar.gz type gzip base image (tar)
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/daemon.tar.gz type gzip base image (tar)
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/excludefiles type uncompressed excludefiles
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/hostfiles type uncompressed hostfiles
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/init.tar.gz type gzip base image (tar)
    supermin: build: visiting /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/packages type uncompressed packages
    supermin: /usr/lib/arm-linux-gnueabihf/guestfs/supermin.d/packages-hfsplus: unknown file type in supermin directory
    libguestfs: error: /usr/bin/supermin exited with error status 1, see debug messages above
    libguestfs: trace: launch = -1 (error)
    libguestfs: trace: close
    libguestfs: closing guestfs handle 0x1ac5c78 (state 0)
    libguestfs: command: run: rm
    libguestfs: command: run: \ -rf /tmp/libguestfsdUvGee
    

相关内容