Rocky Linux 9.5/blue onyx & custom ISO

I am trying to create an ISO of a custom installed Rocky 9.5/blue onyx.
I tried image builder in cockpit which seems to work but doesn’t keep the installed software, users, details, 3rd party software, login gui etc.
What could i be doing wrongly please?

I tried “linux live kit” which created an iso but the bootinst.sh did not work; so the iso wasn’t bootable. I didn’t use any bootable creators (rufus-like tools) as that could make it worse.

Read through livemedia-creator but i am a bit confused on how to start.
Also if “/root/anaconda-ks.cfg” has all the basic installation; could i use that with a standard downloaded iso & let the installation pick up the cfg via webGUI?
The only problem is what if the new device isn’t online or on a network?

Would be grateful; if there was a simpler way to create the custom iso without selecting too many options - please? :slight_smile:

Cheers

I believe xorriso should be used, see this forum search: Search results for 'xorriso order:latest' - Rocky Linux Forum since a lot of people have had similar issues for building custom iso.

…but xorriso is only for extraction not customised iso; iwalker ? :thinking:

Thank you

See also this particular post from the results I listed: Getting checksum error while installing Rocky Linux 8 from generated ISO from original ISO - #6 by nazunalika

It lists the tools being used, not only extract, but for recreating after. Since plenty of people have experienced problems making custom ISO’s, and the issue has already been addressed on the forums, read the results to see if it helps :wink:

Here’s another: Custom Rocky ISO for Post Production - #2 by nazunalika using livemedia-creator with a link as well to how it’s being used for Rocky ISO’s.

If none of those results help, you’ll have to wait until someone else jumps in on the thread.

okay, got your point, thank you iwalker :slight_smile:

Dear All,

  1. Trying to use linux-live-kit to build a custom ISO
  2. I get a different problem every bloody time !
    Some times it work but the ISO fails, other times something else occurs.
  3. Now my current problem is; when i run ./build; i get the results below …
  4. Thus i checked the build path but i am not sure how to edit the “build file” to match the shell script.
  5. How do i edit “C” (export path) by looking at “A” ?
  6. Please help - unless someone has a better tool to build a custom ISO with Rocky 9.5 ?

(A) ->Path on ROCKY 9.5:
[root@LinuxCoder linux-live-2.12]# which genisoimage
/usr/bin/which: no genisoimage in (/root/.local/bin:/root/bin:/home/coder/.local/bin:/home/coder/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)

(B)->Error after running ./build from /tmp/…
#./build
Changing current directory to /tmp/linux-live-2.11
/usr/bin/which: no mkisofs in (.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/)
/usr/bin/which: no genisoimage in (.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/)

(C) → sample shell script for build file.
#!/bin/bash
export PATH=.:./tools:../tools:/usr/sbin:/usr/bin:/sbin:/bin:/

CHANGEDIR=$(dirname $(readlink -f $0))
echo “Changing current directory to $CHANGEDIR”
cd $CHANGEDIR
CWD=“$(pwd)”

Thank you

To preface, I do not know what “linux-live-kit” is. It sounds as though this tool is making assumptions while checking for (or using) deprecated tools. If the script that you’re running is looking for mkisofs, install xorriso. If it’s asking for genisoimage, you will need to install epel-release and then install genisoimage after.

With that said, kickstarts and livemedia-creator are what we support as that is how we create our live images. Our kickstarts repo contains quite a few kickstarts which you can modify and instructions on making live images using livemedia-creator. The live kickstarts are any of these:

  • Rocky-9-Workstation.ks
  • Rocky-9-Workstation-Lite.ks
  • Rocky-9-XFCE.ks
  • Rocky-9-KDE.ks
  • Rocky-9-MATE.ks
  • Rocky-9-Cinnamon.ks

You can add packages under %packages and run arbitrary commands/scripts in %post as you desire. Follow the instructions on the README on building the ISO and then you can test it.


As an example, let’s say I wanted to build a workstation live image, but I wanted to make sure I had a few extra packages available.

I install epel-release and mock

$ dnf install epel-release -y
$ dnf install mock -y

I need to add my user to the mock group so I can use mock. After adding myself to the group, I have to logout and back in.

$ sudo usermod -a -G mock user

Now I can run mock and create the build environment. Note that selinux has to be temporarily disabled for the live process to work properly.

$ mock -r rocky-9-x86_64 --init
$ mock -r rocky-9-x86_64 --install lorax-lmc-novirt vim-minimal pykickstart git
$ setenforce 0

Now I can enter the build environment.

$ mock -r rocky-9-x86_64 --shell --isolation=simple --enable-network

Once I’m in, I clone the git repo.

$ git clone https://github.com/rocky-linux/kickstarts -b r9

I’ll modify the kickstart using vi. I’ll add the packages I want to the end of the packages section, right before %end.

$ cd kickstarts

# Open the kickstart and look for %packages
$ vi Rocky-9-Workstation.ks

%packages
. . .
epel-release
thunderbird
tmux
zsh

%end

Now I can create the live image.

$ livemedia-creator --ks Rocky-9-Workstation.ks \
  --no-virt \
  --resultdir /var/lmc \
  --project="Rocky Linux" \
  --make-iso \
  --volid Rocky-Workstation-9 \
  --iso-only \
  --iso-name Rocky-Workstation-9-x86_64.iso \
  --releasever=9 \
  --nomacboot

The ISO can then be found in: /var/lib/mock/rocky-9-x86_64/root/var/lmc.

2 Likes

Stupendous reply, grateful for this - God bless you :slightly_smiling_face:
Going to try this tool. Cheers

Sir,
Appreciate your reply. Just have a few more question please?

Almost there: (failed)
2025-04-10 11:40:42,984: The installer will now terminate.
2025-04-10 11:43:44,198: Running anaconda failed: process ‘[‘unshare’, ‘–pid’, ‘–kill-child’, ‘–mount’, ‘–propagation’, ‘unchanged’, ‘anaconda’, ‘–kickstart’, ‘/builddir/kickstarts/Rocky-9-Workstation.ks’, ‘–cmdline’, ‘–dirinstall’, ‘–remotelog’, ‘127.0.0.1:46963’]’ exited with status 1
2025-04-10 11:43:44,198: Shutting down log processing
2025-04-10 11:43:44,221: Install failed: novirt_install failed
2025-04-10 11:43:44,221: Removing bad disk image
2025-04-10 11:43:44,222: ERROR: Image creation failed: novirt_install failed
2025-04-10 11:43:44,222: Image creation failed: novirt_install failed

Question please:

  1. Could one use a downloaded ks file (Rocky-9-Workstation.ks), i couldn’t find a way to point to a manually edited file dir without using git?
  2. Also if i were to add a 3rd party software, such as those installed in /opt, would the ks be able to recognise those please? - Eg brave browser
  3. Where is this location please?: /builddir/kickstarts - wanted to manually dump ks without downloading via git.
  4. Deleted the generated dir: /var/lib/mock; rm -R -f mock* & enforced SElinux to start again - when i check your new reply :slight_smile:
  5. Changed the locale to UK (# System language lang en_GB.UTF-8), but it still showed US in the initial summary before it failed.

Cheers

I’m not sure I understand your question. You can use any kickstart that you either download, modify, or create. You would just need to copy it into the mock chroot via another terminal.

Yes, as long as they are packages. So for example with brave, I’d add a repo line, a line under %packages for the browser, and a %post command to add the repo file for future updates.

repo --name="Brave" --baseurl=https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo

%packages
...
brave-browser

%post
...
dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo

It’s in the mock chroot. The full path is /var/lib/mock/rocky-9-x86_64/root/builddir/kickstarts.

Without a lot to go off of, I can’t tell you why you had a failure. It’s very limited in information on what lead up to the error. If you can provide more context, then we can determine where the issue is.