#!/bin/bash

virt-install \
    --connect "qemu:///session" \
    --name "debian12.virt-install" \
    --ram "4096" \
    --vcpus "4" \
    --disk "size=20,path=debian12.virt-install.qcow2,format=qcow2,bus=scsi,discard=unmap,cache=unsafe" \
    --controller "type=scsi,model=virtio-scsi" \
    --initrd-inject "preseed.cfg" \
    --initrd-inject "late_command.sh" \
    --location "http://deb.debian.org/debian/dists/bookworm/main/installer-amd64/" \
    --noautoconsole \
    --os-variant "debian11" \
    --virt-type "kvm" \
    --controller usb,model=none \
    --graphics "none" \
    --network "user,model=virtio" \
    --noreboot \
    --extra-args "auto=true hostname=debian domain= console=ttyS0,115200n8 serial"
