mount vhdx linux

sudo pacman -S  libguestfs

guestmount --add yourVirtualDisk.vhdx --inspector --ro /mnt/anydirectory
 
 
or 
sudo pacman -S qemu-headless nbd
https://gist.github.com/allenyllee/0a4c02952bf695470860b27369bbb60d

          
          

              mount_vhdx.sh

       
  
#!/bin/bash

VHDX_IMG="$1"
MOUNT_POINT="$2"

# [ubuntu] How do you mount a VHD image
# https://ubuntuforums.org/showthread.php?t=2299701
#

# Load the nbd kernel module.
sudo rmmod nbd;sudo modprobe nbd max_part=16

# mount block device
sudo qemu-nbd -c /dev/nbd0 "$VHDX_IMG"

# reload partition table
sudo partprobe /dev/nbd0

# mount partition
sudo mount -o rw,nouser /dev/nbd0p1 "$MOUNT_POINT"




#!/bin/bash

MOUNT_POINT="$1"

#unmount & remove nbd module
sudo umount "$MOUNT_POINT" && sudo qemu-nbd -d /dev/nbd0 && sudo rmmod nbd
  

Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

fix idm integration on chrome

Hidden Wiki