Last active
October 27, 2024 22:15
-
-
Save peterschristoph/4c0e75f694aab41b093f2bc7d1612efe to your computer and use it in GitHub Desktop.
Proxmox create VM by Ubuntu 24 Cloud Image
This file contains hidden or 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/bash | |
| # username: root | |
| # password: 123456 | |
| # resize of the file system is not necessary, this is apparently already done by cloud-init | |
| # PLEASE CUSTOMIZE TO YOUR OWN NEEDS | |
| wget https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-amd64.img | |
| qm create 105 \ | |
| --name "ubuntu-2404" \ | |
| --ostype l26 \ | |
| --memory 2024 \ | |
| --agent 1 \ | |
| --bios ovmf \ | |
| --machine q35 --efidisk0 local-zfs:0,pre-enrolled-keys=0 \ | |
| --cpu host --socket 1 --cores 1 \ | |
| --vga serial0 --serial0 socket \ | |
| --net0 virtio,bridge=vmbr0 | |
| qm importdisk 105 ubuntu-24.04-server-cloudimg-amd64.img local-zfs | |
| qm set 105 --scsihw virtio-scsi-pci --virtio0 local-zfs:vm-105-disk-1,discard=on | |
| qm set 105 --boot order=virtio0 | |
| qm set 105 --scsi2 local-zfs:cloudinit | |
| #qm set 105 --cicustom "user=local:snippets/ci-ubuntu.yml" | |
| qm set 105 --ipconfig0 ip=dhcp | |
| qm set 105 --ciuser=root --cipassword="123456" | |
| qm cloudinit update 105 | |
| qm resize 105 virtio0 +35G |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment