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
| package nospike | |
| import ( | |
| "bufio" | |
| "errors" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "path/filepath" |
| # ~/.zshrc file for zsh non-login shells. | |
| # see /usr/share/doc/zsh/examples/zshrc for examples | |
| setopt autocd # change directory just by typing its name | |
| #setopt correct # auto correct mistakes | |
| setopt interactivecomments # allow comments in interactive mode | |
| setopt ksharrays # arrays start at 0 | |
| setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’ | |
| setopt nonomatch # hide error message if there is no match for the pattern | |
| setopt notify # report the status of background jobs immediately |
| deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse | |
| deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse | |
| deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse | |
| deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse | |
| deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse | |
| deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse | |
| deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse | |
| deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse |
| import re as _re | |
| import json as _json | |
| JSON_EXTENSION = '.json' | |
| def find_json_for_file(file: Path): | |
| try: | |
| if file.with_name(file.name + JSON_EXTENSION).is_file(): | |
| # file.jpg -> file.jpg.json | |
| the_json_path = file.with_name(file.name + JSON_EXTENSION) |
| By default, EBPF programs will not run on WSL2 due to required kernel modules missing. The following example error is an | |
| indication of this problem: | |
| modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.84-microso | |
| ft-standard/modules.dep.bin' | |
| modprobe: FATAL: Module kheaders not found in directory /lib/modules/4.19.84-microsoft-standard | |
| chdir(/lib/modules/4.19.84-microsoft-standard/build): No such file or directory | |
| To fix this you need to rebuild the WSL2 kernel with the missing kernel modules. The below instructions are for Ubuntu 18.04 WSL2. | |
| 1. git clone https://github.com/microsoft/WSL2-Linux-Kernel.git |
| unbindall | |
| // - button | |
| bind BACK "toggleconsole" | |
| // + button | |
| bind START "escape" | |
| // Left stick press | |
| bind STICK1 "+speed" | |
| // Right stick press | |
| bind STICK2 "" | |
| // L button |
| "C:\Program Files\Transmission\transmission-remote.exe" 192.168.x.x:9999 -a %1 | |
| pause |
| #!/bin/sh | |
| [ "$table" != "filter" ] && exit 0 | |
| /opt/sbin/ipset create knockd hash:ip -exist | |
| /opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 1701 -j DROP | |
| /opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 500 -j DROP | |
| /opt/sbin/iptables -I _NDM_IP_PUBLIC -p udp --dport 4500 -j DROP | |
| /opt/sbin/iptables -I _NDM_IP_PUBLIC -m set --match-set knockd src -p udp --dport 1701 -j ACCEPT | |
| /opt/sbin/iptables -I _NDM_IP_PUBLIC -m set --match-set knockd src -p udp --dport 500 -j ACCEPT |
This is my guide for a successful PCI-Passthrough from Linux (Arch Linux) to QEMU/KVM via virt-manager and libvirtd into a Windows 10 Home guest.
NOTE: This is a guide for Intel only. I do not own an AMD machine, and will not add AMD information this guide until such time that I do, which could be never.
| Device Type | Device |
|---|---|
| CPU | Intel Core i7 7700K Quad-Core, Hyperthreading |
| Motherboard | Gigabyte Z270X-Gaming 5 |