This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.
Step 1 - Enable NBD on the Host
modprobe nbd max_part=8
#/etc/mactab | |
--- | |
lan0 00:11:22:33:44:01 | |
wan0 00:11:22:33:44:02 |
# vim: set ft=python: | |
# see the README at https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645 | |
# source: https://github.com/mpv-player/mpv/issues/2149 | |
# source: https://github.com/mpv-player/mpv/issues/566 | |
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy | |
import vapoursynth | |
core = vapoursynth.get_core() |
#!/bin/bash | |
set -e | |
function cleanup() { | |
# clean up our temp folder | |
rm -rf "${TMPDIR}" | |
} | |
trap cleanup EXIT |