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
#!/bin/sh | |
function getsym() { | |
KMOD=$1 | |
KDIR=/lib/modules/$(uname -r)/kernel/ | |
KSYS=/sys/module/${KMOD} | |
KPATH=$(find ${KDIR} -name ${KMOD}.ko -o -name ${KMOD/_/-}.ko) | |
KFILE=${KPATH/$KDIR/./} | |
echo -n "add-symbol-file $KFILE" | |
for SEC in .text .bss .data .rodata |
#!/bin/bash | |
# | |
# Copyright (c) 2015, Intel Corporation | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above copyright |
#!/usr/bin/env bash | |
# Open file on a remote Emacs server. | |
# https://andy.wordpress.com/2013/01/03/automatic-emacsclient/ with added sudo. | |
# /usr/local/bin/ecl -> ecc | |
# /usr/local/bin/ecr -> ecc | |
# /usr/local/bin/ecs -> ecc | |
EMACS_HOME=/1/emacs/bin/ | |
params=() | |
sudo=0 |
initrd内init: scripts/liveをkickする存在 | |
maybe_break mount | |
log_begin_msg "Mounting root file system" | |
. /scripts/${BOOT} | |
parse_numeric ${ROOT} | |
maybe_break mountroot | |
mountroot | |
log_end_msg |
# INSTALL INSTRUCTIONS: save as ~/.gdbinit | |
# | |
# DESCRIPTION: A user-friendly gdb configuration file. | |
# | |
# REVISION : 7.3 (16/04/2010) | |
# | |
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit, | |
# truthix the cyberpunk, fG!, gln | |
# | |
# FEEDBACK: https://www.reverse-engineering.net |
#!/bin/bash | |
# | |
# For latest version please check https://github.com/doomedraven/Tools/blob/master/Virtualization/kvm-qemu.sh | |
# | |
# https://www.doomedraven.com/2016/05/kvm.html | |
# Use Ubuntu 18.04 LTS |
#!/bin/bash | |
INTERVAL="1" # update interval in seconds | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 [network-interface] | |
echo | |
echo e.g. $0 eth0 | |
echo |