Preseed proxmox without internet connection

RobinDBL

New Member
Jan 18, 2023
5
1
3
Hi

I'm having some difficulties with installing Proxmox with my requirements.

I'm trying to create a custom installer image based on debian with Proxmox on top of it.

Why?
I need to be able to install Proxmox automatically without an internet connection.

What I can't use
As far as I know, I can't use the official Proxmox installer because this does not support any preeseeding.
I also cannot install Debian and then Proxmox on top, because both those solutions require an internet connection.
I cannot use the proxmox offline mirror since I have a space constraint of max 5 GB on the share.

My imperfect and problematic solution

Right now, I'm trying to create a custom installer image with all the debian and proxmox packages included, which would result in an image smaller than 2GB.
My nodes will have an internet connection eventually, so they will be updated to the latest software as soon as they are connected to the internet.

I'm using debian live config to create the image. However, there are some issues when installing the proxmox kernel.
Since the installation is done in chroot, a policy-rc is setup to not restart any service.
It looks like the pve-kernel is failing to install, but I cannot figure out why.

Here is the output of the build:

Code:
Running in chroot, ignoring command 'daemon-reload'
Created symlink /etc/systemd/system/multi-user.target.wants/pvedaemon.service → /lib/systemd/system/pvedaemon.service.
Created symlink /etc/systemd/system/multi-user.target.wants/pveproxy.service → /lib/systemd/system/pveproxy.service.
Created symlink /etc/systemd/system/multi-user.target.wants/spiceproxy.service → /lib/systemd/system/spiceproxy.service.
Created symlink /etc/systemd/system/multi-user.target.wants/pvestatd.service → /lib/systemd/system/pvestatd.service.
Created symlink /etc/systemd/system/getty.target.wants/pvebanner.service → /lib/systemd/system/pvebanner.service.
Created symlink /etc/systemd/system/multi-user.target.wants/pvescheduler.service → /lib/systemd/system/pvescheduler.service.
Created symlink /etc/systemd/system/timers.target.wants/pve-daily-update.timer → /lib/systemd/system/pve-daily-update.timer.
Created symlink /etc/systemd/system/sysinit.target.wants/pvenetcommit.service → /lib/systemd/system/pvenetcommit.service.
Created symlink /etc/systemd/system/pve-manager.service → /lib/systemd/system/pve-guests.service.
Created symlink /etc/systemd/system/multi-user.target.wants/pve-guests.service → /lib/systemd/system/pve-guests.service.
Backing up lvm.conf before setting pve-manager specific settings..
'/etc/lvm/lvm.conf' -> '/etc/lvm/lvm.conf.bak'
Setting 'global_filter' in /etc/lvm/lvm.conf to prevent zvols from being scanned:
global_filter=["a|.*|"] => global_filter=["r|/dev/zd.*|"]
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pvedaemon.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pveproxy.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start spiceproxy.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pvestatd.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pvebanner.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pvescheduler.service'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'start pve-daily-update.timer'
Processing triggers for libc-bin (2.31-13+deb11u5) ...
Processing triggers for rsyslog (8.2102.0-2+deb11u1) ...
Running in chroot, ignoring request.
All runlevel operations denied by policy
invoke-rc.d: policy-rc.d denied execution of try-restart.
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.15.85-1-pve
live-boot: core filesystems devices utils udev blockdev iscsi dns.
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
unshare: cannot change root filesystem propagation: Invalid argument
run-parts: /etc/initramfs/post-update.d//proxmox-boot-sync exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for pve-ha-manager (3.5.1) ...
Running in chroot, ignoring command 'is-active'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'reload-or-try-restart pve-ha-lrm.service'
Running in chroot, ignoring command 'is-active'
All runlevel operations denied by policy
/usr/sbin/policy-rc.d returned 101, not running 'reload-or-try-restart pve-ha-crm.service'
Errors were encountered while processing:
 pve-kernel-5.15.85-1-pve
 pve-kernel-5.15
 proxmox-ve
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
E: An unexpected failure occurred, exiting...
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...

Can someone help?
If there are other solutions to my problem, I am open to suggestions :)
 
That's a very interesting scenario you got there. Could you share some more details on how you're creating your custom ISO? E.g. what procedures you're following, how you're adding those packages, etc. I'm curious to look into this.
 
I'm using Debian live to create the ISO.
So, I'm following their documentation (lb_config.html and lb_build.html).

I cloned this repo, and adjusted where needed:

https://github.com/nodiscc/debian-live-config

I removed the DE, unnesesary packages etc.
Then, I added the proxmox repositories to download all the required packages.

So, the config/archives has the proxmox repository and gpg key
then, the config/package-lists has the following proxmox packages to install:

Code:
proxmox-ve
postfix
open-iscsi

as specified in the documentation Debian installation

There were a lot of issues with the default Debian kernel, so I removed this. lb config --linux-packages "none"

The Debian live system Downloads all the packages, And then installs them in a chroot environment. I included the entire output of the build script. (it is to large to add in code here).

If you want I can add the entire configuration as a tar file
 

Attachments

Thanks a bunch! I will look into this and report back as soon as I know more.
 
  • Like
Reactions: RobinDBL
So, I've taken a thorough look at the entire Debian Live build process and whatnot; it should be feasible to create a custom ISO according to your needs, but... it's not really worth it and overcomplicates the entire procedure, in my opinion.

However, there's an alternative I would recommend instead: Install Debian Bullseye, transfer the .deb packages required for PVE via a USB stick or similar, and then just follow the Debian Bullseye installation tutorial for PVE.

A little mini-tutorial on how you'd do this:

DISCLAIMER: This tutorial wasn't tested thoroughly, proceed at your own discretion.
NOTE:
You need to be working on an existing Debian Bullseye Host with internet connection for this to work.

1. Adapt your apt sources like in the wiki article:
Bash:
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list

2. Add our GPG key like in the wiki article:
Bash:
wget https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
# verify
sha512sum /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
7fb03ec8a1675723d2853b84aa4fdb49a46a3bb72b9951361488bfd19b29aab0a789a4f8c7406e71a69aabbc727c936d3549731c4659ffa1a08f44db8fdcebfa  /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg

3. Update your repository:
Bash:
apt-get update

4. Install apt-rdepends
Bash:
apt-get install apt-rdepends

5. Mount your USB stick and create the kernel/ and pve/ directories

6. In the kernel/ directory, execute the following command:
Bash:
apt-get download $(apt-rdepends pve-kernel-5.15 | grep -v '^ ' | grep -v -E '^(debconf-2\.0|perlapi-5\.32\.1|perl-openssl-abi-1\.1|perlapi-5\.32\.0|libtime-local-perl|libpmg-rs-perl|libgcc1|cron-daemon|mail-transport-agent|libgfdb0|libc-dev)$' | uniq)
This command will recursively determine all packages required by PVE's kernel and download them to the current (kernel/) directory. Packages that are included by others during the installation are excluded.

7. In the pve/ directory of your USB stick, execute the following command:
Bash:
apt-get download $(apt-rdepends proxmox-ve postfix open-iscsi | grep -v '^ ' | grep -v -E '^(debconf-2\.0|perlapi-5\.32\.1|perl-openssl-abi-1\.1|perlapi-5\.32\.0|libtime-local-perl|libpmg-rs-perl|libgcc1|cron-daemon|mail-transport-agent|libgfdb0|libc-dev)$' | uniq)

8. Copy the GPG key from point 2. to your USB stick as well

9. Install Debian Bullseye on the host you want to install PVE on

10. Follow the wiki article
10.a When installing the kernel, install the packages you downloaded into your USB stick's kernel/ directory:
Bash:
apt-get install ./kernel/*.deb
10.b Similarly, when installing the PVE packages, install the downloaded packages in the pve/ directory:
Bash:
apt-get install ./pve/*.deb

NOTE: If you get an error regarding ifupdown2 conflicting with ifupdown during installation, you can remove the ifupdown_*.deb package from the pve/ directory and then try point 10.b again. (You can't install both ifupdown and ifupdown2 at the same time, obviously).

11. Finish the tutorial from the wiki article

12. Remove the changes made in 1. and 2. from your original Debian host



I managed to set up PVE in a VM without a NIC this way. With a little tinkering you might even be able to make a collection of scripts that install PVE using this method. Let me know if any of the steps need correcting.

I hope this helps, even if it isn't the most straightforward way. But in my opinion, it's much easier than building a custom ISO.
 
  • Like
Reactions: RobinDBL
Thank you for the awesome response!
The final combination included some of my suggestions and some of yours.

I did create a custom (debian) installer, since there are a few modifications there I needed to make.
I downloaded the packages as you described, and included them in the installer, but didn't install them.
A post installation script then runs to install pve.
 
  • Like
Reactions: Max Carrara

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!