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
| # http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer | |
| # http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D | |
| sudo -s | |
| apt-get -y install mdadm | |
| apt-get -y install grub-efi-amd64 | |
| sgdisk -z /dev/sda | |
| sgdisk -z /dev/sdb | |
| sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda | |
| sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda |
| #!/usr/bin/python3 | |
| # vim:fileencoding=utf-8:sw=4:et | |
| # Convert between pygobject Pixbuf and PIL/Pillow image format | |
| # Also a function to do fast gamma correction with Pillow image | |
| from __future__ import print_function, unicode_literals, absolute_import | |
| import sys | |
| from gi.repository import GLib, GdkPixbuf |
| #include <iostream> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <opencv2/imgproc/imgproc.hpp> | |
| #include <opencv2/highgui/highgui.hpp> | |
| #include <X11/Xlib.h> |
| #!/usr/bin/env python | |
| """python-xlib example which reacts to changing the active window/title. | |
| Requires: | |
| - Python | |
| - python-xlib | |
| Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib | |
| for Python 3.x. |