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
| import { diskStorage } from "multer"; | |
| import { FileInterceptor } from "@nestjs/platform-express"; | |
| import { ApiResponse, ApiConsumes, ApiBody } from "@nestjs/swagger"; | |
| import { | |
| Res, | |
| Get, | |
| Post, | |
| Param, | |
| Controller, |
| # after the virtual disk has already been expanded (e.g. in proxmox) | |
| apk add --no-cache cfdisk e2fsprogs-extra | |
| # choose partition then "Resize" > "Write" (to finalize) | |
| cfdisk | |
| # replace * with partition you are resizing | |
| resize2fs /dev/* |
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "fmt" | |
| "strings" |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi |
Sources:
http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
https://www.raspberrypi.org/documentation/linux/kernel/building.md
https://wiki.osdev.org/Why_do_I_need_a_Cross_Compiler%3F
https://wiki.osdev.org/GCC_Cross-Compiler
https://wiki.osdev.org/Building_GCC
| # - inc/ | |
| # - *.h | |
| # - src/ | |
| # - *.c | |
| # - *.cpp | |
| # - obj/ | |
| # - *.o | |
| # - main | |
| TARGET := main |