- make sure you have qemu-nbd available (can be found in the qemu-kvm package)
- load the nbd module through ' sudo modprobe nbd '
- let qemu-nbd provide a loopback block device for the vdi ' sudo qemu-nbd -c /dev/nbd0 <vdi-file> ' and find your .vdi in the device /dev/nbd0 and its partitions in /dev/nbd0p1, /dev/nbd0p2 and so on.
- mount your desired partition(s) or do whatever you want with these devices (format, change partitions...)
- when done, remove the blockdevices (after unmounting etc) through ' sudo qemu-nbd -d /dev/nbd0 '.