Skip to content

Instantly share code, notes, and snippets.

@kekneus373
Last active December 30, 2025 16:39
Show Gist options
  • Select an option

  • Save kekneus373/a12d79604e518b8499ae53e481012290 to your computer and use it in GitHub Desktop.

Select an option

Save kekneus373/a12d79604e518b8499ae53e481012290 to your computer and use it in GitHub Desktop.
[FIX Illegible/Scrambled Screen] Build your own Clonezilla with enabled modesetting

Making custom CloneZilla "Pro" ISO image w/o nomodeset option for better support on modern hardware

After numerous fails and hours of scouting the web, I finally resolved all the issues related with Clonezilla on modern hardware. You may call me dumb for not just pressing "K" in the scrambled Clonezilla GRUB screen to enable kernel modesetting but whatever idc I found that out only while inspecting GRUB config y'know. πŸ™‚

For more info why that may be relevant in your case skip here

Step 1. Get and mount the latest ISO

Download the latest version (here I used Debian stable) β†’ official link

Step 2. Mount it as a loop device β†’ sudo mount /path/to/your.iso /mnt/image -o users,ro,loop

Step 3. Create a temp dir β†’ mkdir /tmp/czpro

Step 4. Copy the contents β†’ cp -r /mnt/image /tmp/czpro

Step 5. The original ISO is no longer needed, so unmount it β†’ sudo umount /mnt/image

Step 6. Give yourself write permission in grub.cfg β†’ chmod 0644 /tmp/czpro/boot/grub/grub.cfg

Step 7. Modify Grub config β†’ vim /tmp/czpro/boot/grub/grub.cfg

Step 8. To delete all occurrences of "nomodeset" in vi or Vim, use the following command β†’ :%s/nomodeset//g

This command replaces all instances of nomodeset in the entire file with nothing, effectively deleting them. The % specifies the entire file, s stands for substitute, nomodeset is the pattern to search for, and g ensures all occurrences on each line are replaced.

Step 9. Write and quit with :wq

Step 10. (OPTIONAL) Set permissions back β†’ chmod 0444 /tmp/czpro/boot/grub/grub.cfg

I don't think it's needed πŸ—Ώ

Step 11. Open a Nix environment for generating the new image (or install them in your distro correspondingly) β†’ nix-shell -p libisoburn syslinux. libisoburn provides xorriso, syslinux - isohybrid

Step 12. Once in shell, look for the xorriso command in /tmp/czpro/.disk/mkisofs reference file.

You may ask your fellow AI to explain what it does - I'm not here for that though. We need to modify it, because some files were moved around by the devs:

  • Replace isolinux/ with syslinux/: β†’ :%s/isolinux\//syslinux\//g
  • Replace binary with $(pwd): β†’ :%s/binary/$(pwd)/g

MY COMMAND BELOW IS FOR REFERENCE ONLY.

Again, prepare the command you have in /tmp/czpro/.disk/mkisofs! Below is just an example of what I did to get it working:

xorriso -as mkisofs \
  -R -r -J -joliet-long -l -cache-inodes -iso-level 3 \
  -A "CloneZilla Pro Live v1" \
  -p "live-build 20250814.drbl1; https://salsa.debian.org/live-team/live-build" \
  -publisher "Debian Live project; https://wiki.debian.org/DebianLive; debian-live@lists.debian.org" \
  -V "Debsid 20251017-1630" \
  --modification-date=2025123016000000 \
  -b syslinux/isolinux.bin \
  -c syslinux/boot.cat \
  -no-emul-boot \
  -boot-load-size 4 \
  -boot-info-table \
  -eltorito-alt-boot \
  -e boot/grub/efi.img \
  -no-emul-boot \
  -o czprolive-30122025_1-amd64.iso \
  $(pwd)

Lil AI explanation as well:

Yes, you can still run isohybrid separately β€” and it's actually recommended if you're on NixOS or any system where /usr/lib isn't easily accessible.

Here’s how to do it safely:

1. Use xorriso to create the ISO first

xorriso -as mkisofs \
  -R -r -J -joliet-long -l -cache-inodes -iso-level 3 \
  -A "Debian Live" \
  -p "live-build 20250814.drbl1; https://salsa.debian.org/live-team/live-build" \
  -publisher "Debian Live project; https://wiki.debian.org/DebianLive; debian-live@lists.debian.org" \
  -V "Debian sid 20251017-16:30" \
  --modification-date=2025101708301800 \
  -b isolinux/isolinux.bin \
  -c isolinux/boot.cat \
  -no-emul-boot \
  -boot-load-size 4 \
  -boot-info-table \
  -eltorito-alt-boot \
  -e boot/grub/efi.img \
  -no-emul-boot \
  -o live-image-amd64.iso \
  binary

Note: We removed the hybrid options (-isohybrid-*) because xorriso's hybrid features are not available in genisoimage/mkisofs.

2. Run isohybrid separately

You can use isohybrid from the syslinux package (available in NixOS):

# Install syslinux (if not already available)
nix-shell -p syslinux

# Run isohybrid on the created ISO
isohybrid --uefi live-image-amd64.iso

This will add the necessary hybrid boot code to make the ISO bootable from USB.

3. Final result

After running isohybrid, your ISO will be bootable on:

  • BIOS systems (via MBR)
  • UEFI systems (via EFI)
  • USB drives (as a hybrid ISO)

Why this works on NixOS:

  • isohybrid is part of syslinux, which is available in NixOS.
  • You don’t need /usr/lib/ISOLINUX/isohdpfx.bin β€” isohybrid will generate the correct MBR boot code.
  • The isohybrid tool can work with any ISO, even if it was created without hybrid support.

βœ… Summary:
Yes, you can and should use isohybrid separately on NixOS. It’s the cleanest way to make your ISO bootable from USB without relying on system-specific paths like /usr/lib.

Let me know if you'd like a NixOS-specific shell script to automate this!


Step 13. Run isohybrid on the created ISO β†’ isohybrid --uefi live-image-amd64.iso

And there you have it! Perfectly bootable ISO.

HTH

Sources: https://askubuntu.com/a/1199911, https://sourceforge.net/p/clonezilla/discussion/Help/thread/d13d00de/, https://xcp-ng.org/forum/post/39147, https://bbs.archlinux.org/viewtopic.php?pid=2243131#p2243131, Leo AI πŸ’€

Why this is useful (AI)

Removing nomodeset from the boot parameters in Clonezilla (or similar live Linux environments) is often necessary for better compatibility with modern PCs. Here's a clear explanation:

Why nomodeset is used by default:

  • nomodeset is a kernel boot parameter that disables kernel mode setting (KMS).
  • It prevents the Linux kernel from initializing the graphics driver during boot.
  • This is done as a safety measure to avoid graphical glitches, freezes, or crashes caused by incompatible or buggy GPU drivers β€” especially on older or poorly supported hardware.

Why it's problematic on modern PCs:

  1. Modern GPUs expect KMS:

    • Most modern CPUs and GPUs (Intel HD, AMD Radeon, NVIDIA) support KMS.
    • KMS enables high-resolution displays, proper screen scaling, and full graphical performance.
    • With nomodeset, the system falls back to a basic VGA mode, which limits usability.
  2. User experience suffers:

    • The desktop appears in low resolution (e.g., 640x480).
    • Mouse cursor may be slow or unresponsive.
    • No proper desktop effects or scaling.
    • This makes the live environment harder to use, especially for tasks requiring visual feedback.
  3. It's not needed on most modern hardware:

    • Since ~2010, Linux kernel graphics drivers (like i915 for Intel, amdgpu for AMD, nouveau for NVIDIA) have matured significantly.
    • These drivers work reliably on most consumer-grade hardware.
    • Disabling KMS unnecessarily degrades the user experience.
  4. Only relevant for problematic hardware:

    • Older or low-end devices (like Intel GMA in Atom processors) may still have issues with KMS.
    • But for modern PCs, removing nomodeset allows:
      • Full resolution display
      • Smooth UI rendering
      • Proper touchpad and input handling
      • Better overall usability

When to keep nomodeset:

  • On older machines with poor GPU support
  • If you experience graphical corruption or system freezes
  • With certain integrated graphics (e.g., Intel GMA 500, early AMD APU)

Summary:

Removing nomodeset improves compatibility and usability on modern PCs by enabling full graphics support. It’s safe for most users today, but should be avoided only if you encounter display issues. This change makes Clonezilla more usable in real-world scenarios where users expect a responsive, high-resolution interface.

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment