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/bash | |
rm -rf /home/yen3/ubuntu.qcow2 | |
qemu-img create -f qcow2 /home/yen3/ubuntu.qcow2 10G | |
virsh undefine ubuntu1604arm64 --nvram | |
install_from_localtion() { | |
virt-install -n ubuntu1604arm64 --memory 1024 --arch aarch64 --vcpus 1 \ | |
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \ |
/******************************************************************************* | |
* Copyright 2017 Andrew Domaszek | |
* | |
* All rights reserved. | |
* This program made available under BSD-new. | |
*******************************************************************************/ | |
/** | |
* This example is designed for Linux, using such calls as setsockopt and gettimeofday. | |
* On embedded, it's likely that all of the mbedtls_net_* functions would need to be |
--[[ | |
redis_factory.lua | |
Redis factory method. | |
You can also find it at https://gist.github.com/karminski/33fa9149d2f95ff5d802 | |
@version 151019:5 | |
@author karminski <code.karminski@outlook.com> | |
@license MIT |
/* exec-notify, so you can watch your acrobat reader or vim executing "bash -c" | |
* commands ;-) | |
* Requires some 2.6.x Linux kernel with proc connector enabled. | |
* | |
* $ cc -Wall -ansi -pedantic -std=c99 exec-notify.c | |
* | |
* (C) 2007-2010 Sebastian Krahmer <krahmer@suse.de> original netlink handling | |
* stolen from an proc-connector example, copyright folows: | |
*/ | |
/* |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. |