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
export TOKEN=$(curl --silent https://ghcr.io/token\?scope\=repository:wolfv/artifact:pull | jq -r .token) | |
curl \ | |
--silent \ | |
--request 'GET' \ | |
--header "Authorization: Bearer $TOKEN" \ | |
--header "Accept: application/vnd.oci.image.manifest.v1+json" \ | |
'https://ghcr.io/v2/wolfv/artifact/manifests/1.0' | |
echo "\n\nFetching image content now:\n\n" |
#!/bin/busybox sh | |
# 1) Download a prebuilt BusyBox binary here: | |
# https://busybox.net/downloads/binaries/ | |
# | |
# 2) Prepare your kernel | |
# cp /boot/vmlinuz vmlinuz | |
# | |
# 3) Copy the files | |
# install -Dm0755 busybox-x86_64 initramfs/bin/busybox |