Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Minimal Debian Virtual Machine
- #required host tools
- sudo apt install libguestfs-tools qemu-system
- #get small debian image
- wget -c "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2" -O debian_small.qcow2
- #create 10G image and copy/resize small image to 10g image
- echo "Creating a 10G img file..."
- sleep 1
- qemu-img create -f qcow2 -o preallocation=metadata debian.qcow2 10G
- echo "Copying and Expanding Image"
- sleep 1
- virt-resize --expand /dev/sda1 debian_small.qcow2 debian.qcow2
- #run virtual machine
- qemu-system-x86_64 -enable-kvm -m 4G -hda debian.qcow2
- # once in VM here is a helper script
- https://filmsbykris.com/scripts/debian_setup.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement