You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.8 KiB

  1. ---
  2. type: docs
  3. title: "Customize .qcow2 image"
  4. ---
  5. Tired of Debian Installer ):
  6. On Proxmox VE i had to go through the Debian Installer if i want to spin up a new VM,taking a lot of time and effort.
  7. 1. Download the .qcow2 image from cloud.debian.org
  8. https://cloud.debian.org/images/cloud/bookworm/20230910-1499/debian-12-genericcloud-amd64-20230910-1499.qcow2 ,this is a generic cloud image which can be easily imported onto proxmox.
  9. 2. Reset the root password on the disk image
  10. ```$ virt-customize -a debian-10-genericcloud-amd64.qcow2 --root-password password:debian```
  11. By default the .qcow2 doesn't have any root password,so the disk image has be customized using virt-customize to add root password.
  12. 3. Increase size of .qcow2 disk image.
  13. By default the size of Debian Generic Cloud is 2GB, using qemu-img we can resize the disk image.
  14. ```
  15. qemu-img resize image.qcow2 +SIZE
  16. ```
  17. 4. Import the disk image on Proxmox VE.
  18. Copy the image to ```/var/lib/vz/template/qemu/```.
  19. Create a VM on Proxmox VE without any media (do not attach any physical media) and delete any existing disk on proxmox.
  20. ```
  21. qm importdisk 114 /var/lib/vz/template/qemu/debian-12-genericcloud-amd64-20230910-1499.qcow2 amogha -format qcow2
  22. ```
  23. Execute the above ```qm importdisk``` on the proxmox server where ```114```is the VM id where in your case will be different.
  24. Refreshing the Proxmox GUI on the browser,attach the ```unused Hard Disk``` under ```Hardware```, also add a cloudInit drive and set ```IP address to dhcp``` to automatically assign IP address for both IPv4 and IPv6.
  25. Under ```Options``` update the boot order and check whether the hard disk which was added to be checklisted and prioritize it to first.
  26. ```bash
  27. Another alternative way is to use Preseed file at boot which automates
  28. debian installer,haven't tried that yet.
  29. :wq #for now
  30. ```