Forked from Jimmy-Z/pve-cloud-init-template-debian.sh
Created
March 22, 2024 08:22
-
-
Save cdseoo/05ba75a95903a0518637868daf9c8c35 to your computer and use it in GitHub Desktop.
create a Debian VM template for Proxmox VE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# apt install curl | |
# obviously change this per your needs | |
VMID=9001 | |
STOR=local-lvm | |
VER=20230124-1270 | |
URL_PATH=https://cloud.debian.org/images/cloud/bullseye/$VER/ | |
IMG=debian-11-genericcloud-amd64-$VER.qcow2 | |
curl -L -o $IMG -C - $URL_PATH$IMG | |
# https://pve.proxmox.com/wiki/Cloud-Init_Support | |
# https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines | |
qm create $VMID --cores 4 --cpu cputype=host --memory 4096 --net0 virtio,bridge=vmbr0 --ostype l26 --serial0 socket --vga serial0 | |
qm importdisk $VMID $IMG $STOR | |
qm set $VMID --scsihw virtio-scsi-single --scsi0 $STOR:vm-$VMID-disk-0,discard=on,iothread=true | |
qm set $VMID --ide2 $STOR:cloudinit | |
qm set $VMID --boot c --bootdisk scsi0 | |
qm template $VMID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment