Create custom PVE iso from original PVE iso

devis

New Member
Mar 2, 2023
25
2
3
Hello.

Please tell me how the process of building the official image of Proxmox VE

The fact is that I need to create my own image based on the official one, adding the patches I need to work with my infrastructure to it, these patches must be inside the installation image.

However, I ran into a problem that the Proxmox VE image markup scheme is different from the Debian image markup scheme.

fdisk -l ~/proxmox-ve_7.3-1.iso
Disk /home/evgeniy/proxmox-ve_7.3-1.iso: 1.03 GiB, 1108862976 bytes, 2165748 sectors
Units: 1 * 512 sectors = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes
Drive label type: gpt
Disk ID: 88365C9B-F9CD-426F-85BE-F6F44EBDD0DA

Device Start End Sectors Size Type
/home/evgeniy/proxmox-ve_7.3-1.iso1 64 511 448 224K Microsoft basic data
/home/evgeniy/proxmox-ve_7.3-1.iso2 512 6271 5760 2.8M EFI
/home/evgeniy/proxmox-ve_7.3-1.iso3 6272 2165099 2158828 1G Apple HFS/HFS+
/home/evgeniy/proxmox-ve_7.3-1.iso4 2165100 2165699 600 300K Microsoft basic data

fdisk -l ~/Downloads/debian-11.6.0-amd64-netinst.iso
Disk /home/evgeniy/Downloads/debian-11.6.0-amd64-netinst.iso: 388 MiB, 406847488 bytes, 794624 sectors
Units: 1 * 512 sectors = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimum): 512 bytes / 512 bytes
Disk label type: dos
Disk ID: 0x256ed913

Device Boot Start End Sectors Size ID Type
/home/evgeniy/Downloads/debian-11.6.0-amd64-netinst.iso1 * 0 794623 794624 388M 0 Empty
/home/evgeniy/Downloads/debian-11.6.0-amd64-netinst.iso2 4064 14079 10016 4.9M ef EFI (FAT-12/16/32)

Of the many instructions everywhere, when building your iso image, you need to specify the path to the isolinux.bin bootloader, but I did not find such a file as part of the original Proxmox VE image.

Perhaps someone can tell me how to correctly assemble a boot image from the original one?
 
I have no answer to your question, but one for question you:

Have you considered installing Debian via PXE/netboot and install the PVE stuff on top? This is a very easy process and handling ISO files (or even physical disks or disk emulators) is not every good to automate.
 
I have no answer to your question, but one for question you:

Have you considered installing Debian via PXE/netboot and install the PVE stuff on top? This is a very easy process and handling ISO files (or even physical disks or disk emulators) is not every good to automate.
I use pxe, but not everywhere it can be used for this reason and you need to build iso yourself
 
I use pxe, but not everywhere it can be used for this reason and you need to build iso yourself
Just an idea: so why don't you build your Debian Iso yourself? The preseed part is the same and you can just mirror the PVE repository onto the iso and do the same scripting you would do in PXE on your iso. I know this is not what you want, but Proxmox staff has already pointed out (I have not found a link, yet I do know that I was at least subscribed to the posts) that there is no plan or current way to automate the installation via ISO nor editing it directly. I don't know if those plans changed. There is no activity in bugzilla either regarding the installer. I guess it just don't affect so many people.

Another idea is to have a PVE system image than you can roll out via a live disk and customize via your favorite automation tool. I used it a couple of times while installing PVE on dedicated consumer hardware in "datacenters" like Hetzner. I booted a live linux via their robot tool, connected via SSH and dd'ed the precreated image on the disks, chrooted into it an manually set it up. I never bothered to automate, it was just twice.
 
  • Like
Reactions: _gabriel
Hello @devis, I have the exact same problem!
Using ISO Master I achieved to boot in VirtualBox while I was writing the changes to the proxinstall file. But when I wrote the image on a USB (using dd, unebootin, etcher... ) I didn't find a way to boot.
Please if you find a way to do this let me know.

Valerio
 
Hi @devis,
I FINALLY SOLVED IT! I was not understanding how a bootable iso works!
Thanks to a reply from 2015 by @scdbackup here https://forum.proxmox.com/threads/custom-pve-iso.21986/

Here the steps I followed:

Bash:
sudo apt install mkisofs
sudo su -

#location where the original iso of proxmox is
cd /home
#copy into proxmox.mbr the mbr from original iso (first 512byte)
dd if=proxmox-ve_7.3-1.iso bs=512 count=1 of=proxmox.mbr

mkdir /tmp/prox
cd /tmp/prox
mount -t iso9660 -o loop /home/proxmox-ve_7.3-1.iso /mnt/
cd /mnt
tar cf - . | (cd /tmp/prox; tar xfp -)

#Then i unsquashed the pve-installer.squashfs:
cd /tmp/prox
unsquashfs pve-installer.squashfs

#Here I edited the files

#Then I squashed it back

rm pve-installer.squashfs
mksquashfs squashfs-root/ pve-installer.squashfs

#After that I repacked with

xorriso -as mkisofs \
     -o repacked.iso \
     -r -V 'PVE' \
     --modification-date=2023030619475500 \
     --grub2-mbr /home/proxmox.mbr \
     --protective-msdos-label \
     -efi-boot-part --efi-boot-image \
     -c '/boot/boot.cat' \
     -b '/boot/grub/i386-pc/eltorito.img' \
       -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
     -eltorito-alt-boot \
     -e '/efi.img' -no-emul-boot \
     /tmp/prox

#the key part is passing to --grub-mbr the path of the mbr I copied from the original
#I obtained 'repacked.iso' and it's bootable like the original one (I used etcher but I think dd should be ok )

I hope it will be useful to someone
 
Last edited:
  • Like
Reactions: RobinDBL and anaxma
Just an idea: so why don't you build your Debian Iso yourself? The preseed part is the same and you can just mirror the PVE repository onto the iso and do the same scripting you would do in PXE on your iso. I know this is not what you want, but Proxmox staff has already pointed out (I have not found a link, yet I do know that I was at least subscribed to the posts) that there is no plan or current way to automate the installation via ISO nor editing it directly. I don't know if those plans changed. There is no activity in bugzilla either regarding the installer. I guess it just don't affect so many people.

Another idea is to have a PVE system image than you can roll out via a live disk and customize via your favorite automation tool. I used it a couple of times while installing PVE on dedicated consumer hardware in "datacenters" like Hetzner. I booted a live linux via their robot tool, connected via SSH and dd'ed the precreated image on the disks, chrooted into it an manually set it up. I never bothered to automate, it was just twice.
I customized the installer because I need to replicate similar configuration to hundreds of devices (in some case without an internet connection or really bad satellite connection). Also because I need a single usb stick that tecnicians without specific knowledge in proxmox/linux can install.
So, using the custom installer and some scripts I can choose what type of configuration will be installed to a particular device restoring backups of different virtual machine/containers.
 
Last edited:
Hello, first of all @ValerioBob thanks a lot!
Thanks to your reply I was able to edit an ISO but your method didn't work for me so I had to tweak a thing or two I post what I did here so it might help others encountering the same issues as me with your method:

Code:
Bash:

sudo apt install mkisofs
sudo su -

#location where the original iso of proxmox is
cd /home
#copy into proxmox.mbr the mbr from original iso (first 512byte)
dd if=proxmox-ve_8.2-1.iso bs=512 count=1 of=proxmox.mbr

mkdir /tmp/prox
cd /tmp/prox
mount -t iso9660 -o loop /home/proxmox-ve_8.2-1.iso /mnt/
cd /mnt
tar cf - -C /mnt . | tar xfp - -C /tmp/prox

# Until here everything is fine but when I edit pve-installer.squashfs the modification are not saved and when I boot I don't see them
# To fix that I edited pve-base.squashfs instead of pve-installer.squashfs:

cd /tmp/prox
unsquashfs pve-base.squashfs

#Here I edited the files

#Then I squashed it back

rm pve-base.squashfs
mksquashfs squashfs-root/ pve-base.squashfs
# Don't forget to remove squashfs-root
rm -rf squashfs-root/

#Your repacking command didn't work for me, I get stuck when I boot here the command I used instead:

xorriso -as mkisofs \
-o repacked.iso \
-r -V 'PVE' \
--modification-date=2024042411311000 \
-isohybrid-mbr /home/proxmox.mbr \
-partition_offset 16 \
--protective-msdos-label \
-appended_part_as_gpt \
-efi-boot-part --efi-boot-image \
-c '/boot/boot.cat' \
-b '/boot/grub/i386-pc/eltorito.img' \
-no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
-eltorito-alt-boot \
-e '/efi.img' -no-emul-boot \
/tmp/prox
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!