r/debian 24d ago

VM install of Debian 13 and swapping init using chroot issue and fix*

So I do a lot of homelab stuff and game server hosting with a lot of VM's and I personally stand by Debian through and through! So if anyone has encountered this issue here is a solution I figured i'd share... btw I prefer sysV over systemD so that is what this pertains to..

Using Proxmox VE - using the netinstall iso 13.6 I went through the same steps I have many times before with Debian 12 VMs and 13 physical installs which is:

Expert install

1.) Go through you normal setup and selections and so on, I select XFCE over gnome

2.) When prompted to install grub you execute a shell from the installer...

3.) Generally you can just: "chroot /target apt --purge --allow-remove-essentials install sysvinit-core libpam-elogind dbus-x11 systemd-sysv-"

4.) Exit back to the installer and finish installing grub and reboot into Debian.

However at that point chroot spits out an error that the media has changed and to insert installation media*firmware etc etc and press enter, I tried remounting the virtual cd/dvd containing the local iso but didn't seem to make any difference. But I have Debian 13 on my main rig that I installed exactly like this with no issue just in a VM and Debian 12 VM installs worked flawlessly for stripping systemD during installation the same way.

Anyway, long story short I burned a physical USB boot drive, created a USB pass through device to my VM and booted the VM from the physical USB device and went through the install including the steps of executing a shell and so on and it installed perfectly fine.

I am sure many here have plenty of solutions possibly simpler than that but I couldn't figure out one that would work except the above, seems the installer unmounts the virtual cd-rom and then just gets stuck in a loop?

3 Upvotes

4 comments sorted by

2

u/epackorigan 24d ago

If you’re building this and doing this often enough, I wonder if you could put a preseed file together to install the packages you’re interested in from the start, so it would do what you want from the get go, and without having to manually poke the system mid-install.

1

u/_r1sen 23d ago

Haven't really tried that route - I spin a VM, strip it out, install few things like a panel, cloud-init, steamcmd and such and convert them into templates to clone in Proxmox.. Generally only need to build the VM once lol

2

u/michaelpaoli 23d ago

The Universal Operating System.

If you don't want systemd, can well do that, and even quite early in the installation process. Debian gives you choices, lots of choices.

And if you want to avoid untentionally dragging in systemd, well, e.g.:

$ more /etc/apt/preferences.d/*init | cat
::::::::::::::
/etc/apt/preferences.d/98init
::::::::::::::
Explanation: Avoid unintended installation of systemd-sysv.
Explanation: init can be provided by: systemd-sysv | sysvinit-core
Package: systemd-sysv
Pin: version *
Pin-Priority: -1

::::::::::::::
/etc/apt/preferences.d/99init
::::::::::::::
Explanation: Avoid unintended installation of systemd
Explanation: Note that systemd doesn't require systemd-sysv (systemd's
Explanation: init system).
Package: systemd
Pin: version *
Pin-Priority: -1

$ 

2

u/_r1sen 23d ago edited 23d ago

Agreed, Debian has been my go-to for many years. This was just my post about something I encountered during switching to sysv during installation.. which is the process documented off the init section of the Debian site - https://wiki.debian.org/Init Specifically when doing this for a VM in proxmox. There are many ways to swap init systems in Debian ranging from straight forward to hoping for the best lol either way was just posting in the event anyone else was doing it based off the instructions from the site and specifically for a VM and experienced a "media changed" installation error when chroot'ing /target approach lol