I want to Distribute my software as an ISO build from a VM system based on ubuntu server

I have developed a web application that should be deployed on-premises. The application includes several services running inside Docker Compose, a Django server running on the host machine, MongoDB, systemd services, a syslog server, and a frontend based on Angular hosted through Nginx at /var/www/html.

I need to create a live ISO image of my entire system, making it bootable. The challenge is that I have data stored in MongoDB and Docker volumes (including data for Elasticsearch, etc.), and I want to ensure all of this is included in the ISO image so that it can be booted and the system can function as it does currently.

How can I generate a bootable ISO image that includes the entire system setup (including Docker containers and volumes, MongoDB data, and system services) so that it can be deployed on other machines?

I initially tried using Cubic to create a bootable live ISO of my entire system, but I found that Cubic is mainly designed for customizing a base Ubuntu ISO rather than capturing an existing system as it is. It allows modifications, but it does not preserve installed services, data, or configurations exactly as needed.

I also attempted to use Bulifs, but I couldn’t achieve the desired results with it either. My expectation was to generate a bootable ISO that would, when installed, replicate my entire configured environment, including all services running on the host, Docker containers with their volumes, systemd services, and MongoDB data. While I was using bulifs it generated the ISO of the machine but when I booted the ISO it was asking for the user password but it was not expecting my user password from the source system.

In one of my attempts, I tried modifying a Cubic-generated ISO by manually configuring the system inside it. However, this led to multiple installation errors, and the ISO would break, failing to install properly. The installation process encountered unexpected issues, possibly because the modifications were not being applied correctly or certain dependencies were missing.

I am currently using Ubuntu Server 24 and looking for a proper method to create a full system ISO that captures everything, including data from MongoDB, Docker volumes, and services like Elasticsearch.

Are you familiar with or have you tried using xorriso or mkisofs as described at the links below? As described in the first link, using mkisofs would be run from another installed Linux or from a ‘live’ Linux usb where you would need to create a directory as a mount point for the partition you want to use. The second link also describes mkisofs but the bottom of the pages discusses xorriso. Have you tried clonezilla?

https://www.wikihow.com/Create-an-ISO-File-in-Linux

https://unix.stackexchange.com/questions/90793/create-iso-image-from-folder-via-terminal-commands

Let me try and get back to you, I saw some documentation and tutorials and I noticed that these only make ISO of some particular directories but not the whole system.

Perhaps Linux Live Kit is also something to consider?

From the same developer who maintains Slax.

Perhaps qt-fsarchiver is another option?

I believe you can also clone a drive using it.

But, you would then likely need to figure out how to make a bootable ISO.

Caveat: I have not tried either of these methods, just trying to offer some suggestions to look at.

I tried using xorisso level 3 of ISO but there was some bootloader configuration issue in GRUB. The ISO wasn’t able to find any bootloader configurations so I am trying again now with some fixes hope that works
 :slightly_smiling_face:

As a simple easy alternative you could try the live bootable USB QT-fsarchiver as a base with the system backed up onto the same (largish) usb stick.

Then in a totally different machine run the live system and then the built-in QT-fsarchiver to restore the system.
It involves a few more steps than a simple clone, but it will install a working system onto a drive that has a smaller size disc than the original, most cloning software only allows the recipient drive to be exactly the same size or bigger.

Cheers Tony.

1 Like

I tried using the mkisofs and xorriso and first it showed me the error that it could not find the bootloader
I fixed the path in the ISO but still when I booted the ISO it showed black screen only. Below are the steps which I followed, looking for advice and suggestions. Feel free to correct me if I have done any step wrong.

Step 1: Prepare Directories

mkdir -p iso/{boot/grub,boot/efi,EFI/BOOT,live}

→ Sets up the folder structure for GRUB, EFI, and the live system files.

Step 2: Create GRUB Config

nano iso/boot/grub/grub.cfg

→ Opens the editor to create grub.cfg with boot entries (paste below):

set timeout=3

menuentry “Boot Software System” {

insmod part_gpt

insmod ext2

insmod iso9660

insmod linux

set root=(hd0,gpt1)

linux /live/vmlinuz boot=live toram

initrd /live/initrd.img

}

Step 3: Copy System Files

rsync -aAX --delete
–exclude={/dev/,/proc/,/sys/,/tmp/,/run/,/mnt/,/media/*,/lost+found,/iso,/swap.img}
/ iso/live/

→ Backs up the full system (excluding transient directories) into the live folder.

Step 4: Copy Kernel & Initramfs

cp /boot/vmlinuz-$(uname -r) iso/live/vmlinuz
cp /boot/initrd.img-$(uname -r) iso/live/initrd.img

→ Ensures the ISO boots with the current kernel and initramfs.

Step 5: Install GRUB for UEFI

grub-mkstandalone -O x86_64-efi
–modules=“part_gpt iso9660 ext2 linux normal”
–locales=“”
–themes=“”
–fonts=“”
-o iso/EFI/BOOT/BOOTX64.EFI
“boot/grub/grub.cfg=iso/boot/grub/grub.cfg”

→ Generates the UEFI bootloader using the pre-created grub.cfg.

Step 6: Create EFI Boot Image

dd if=/dev/zero of=iso/boot/efi.img bs=1K count=2880
mkfs.vfat iso/boot/efi.img
mcopy -i iso/boot/efi.img iso/EFI/BOOT/BOOTX64.EFI ::

→ Creates, formats, and populates an EFI boot image with BOOTX64.EFI.

Step 7: Build the ISO

xorriso -as mkisofs
-volid “Software-LiveISO”
-iso-level 3
-full-iso9660-filenames
-eltorito-boot boot/efi.img
-eltorito-alt-boot
-e boot/efi.img
-no-emul-boot
-boot-load-size 4
-boot-info-table
-o software-live.iso
iso/

→ Compiles all files into a bootable ISO image with the correct boot configuration.

I saw the websites you mentioned but those were only about making the ISO from particular directories but I need the whole system ISO. Thanks for Help in advance

1 Like

I don’t know if this will resolve your issue but the command you used to create the various directories creates the EFI directory in the / of the filesystem while it should be under /boot/efi. The command below will create the EFI directory under /boot/efi.

mkdir -p iso/{boot/grub,boot/efi/EFI/BOOT,live}

Haven’t done this in years so don’t really have any other suggestions.

I first tried the mkisofs-xorisso from the advice of yancek but it failed now I am trying from Linux Live Kit. It created the iso but when booting the ISO from VM it shows failed to load ldlinux.c32.
I tried using some fixes but it still shows the same error. Any suggestions? The Github of this project marks this issue as closed but the issue was not solved


Have you tried the recovery-iso-zip option in Clonezilla?

You can use this after you have made a Clonezilla image of your system.
In effect, it bundles the Clonezilla image into an ISO, together with the necessary Clonezilla software to allow the image to be restored (i.e. not running a live test session)to a disk .

I used mkusb to make a bootable iso and restored a 32GB image to an external disk.

I tested with a bare-metal system rather than a VM.

Sorry, do not have an answer for you.

Probably best to open your own ticket?

1 Like

Found this systemback but it is old and has disappeared in the mists of time.

I am developing Ubuntu “proof of concept” environments into remote incubator beds. I start with dev desktop here, dual boot Dell, create a remote hosting environment account, sync between dev desktop and remote hosting environment , then like a launchpad clone environment into remote new homes (users on-premises). Described here. The hosting environment can support all your listed requirements and it is pay as you go (you can shut down the environment) so costs are minimal. But delivery is not a bootable ISO image.

That would indicate an MBR boot. Do you have that file in the created iso? You are using Syslinux to boot if you need that file. Some discussion of using that file at the link below. On Ubuntu, that file should be in /usr/lib/syslinux/modules/bios and the various syslinux files are in /usr/lib/syslinux.

https://unix.stackexchange.com/questions/501487/will-any-ldlinux-c32-work-for-creating-a-live-iso

Will give it a shot thanks for the input👍

Is there some rationale for not putting everything in a container, rather than some inside, and some outside? It’s highly weird to distribute software of a running system. The whole purpose of docker was born from “It works on my machine, ship my machine” but inside a container. This feels like a solved problem, being made way more complex with the ISO requirement.

Can it really not be done as a container?

Yeah I opened the ticket on the GitHub of the Live-Kit and now I will be trying CloneZilla. Failed to load ldlinux.c32 · Issue #284 · Tomas-M/linux-live · GitHub here is the link to the issue.

so popey my usecase of the software product bounds me to use the ISO and from what I learnt services from docker compose are better running on different containers rather than a single container. And the django can’t control the services inside the compose file while itself being inside the compose file. Hope you understand my issue


Thanks yancek for your continued support. I tried this as well but sadly no luck. I have opened the issue on Github of Live Kit for Mr Tomas to check and hopefully I will get a reply soon. Here is the Link of the issue if you wanna check that: Failed to load ldlinux.c32 · Issue #284 · Tomas-M/linux-live · GitHub

What virtualization technology have you used? If its VMWare then you can make an OVA of the server and distribute it that way. People can spin up a new VM using the files you have and replicate the VM over and over

1 Like