DEV Community

Cover image for (Not So) Simple Plain Cubic Tutorial
Alex M. Schapelle for Otomato

Posted on • Edited on

(Not So) Simple Plain Cubic Tutorial

Welcome back dear reader. for your notice, I am Silent-Mobius, A.K.A. Alex M. Schapelle, your cybernetic writer that can write these letters without help of chatGPT, because AI systems are heresy of high level

It has occurred to me that providing complex tutorials in regards to ISO's has somewhat discouraging effect, thus, in today's discussion, we'll delve into a tool named Cubic.
Cubic, an anagram of "Custom Ubuntu ISO Creator", is a graphical wizard tool that can aid to create a customized Live ISO image for Ubuntu and Debian based distributions.

Cubic permits effortless navigation through the ISO customization steps and features an integrated virtual command line environment to customize the Linux file system. You can create new customization projects or modify existing projects. Important parameters are dynamically populated with intelligent defaults to simplify the customization process.

Let's plan our steps in order to provide you some guidance:

  • lets see how we proceed installation
  • initial run and setup
  • example of custom ISO generation

Installation

Surprisingly to me, Cubic is usable in most Debian based systems yet support for Debian itself, although added, is still a struggle, even with acclaimed Cubic version 2022.11.73.

Why surprised ? My first use of cubic was in its early stages and at that point of time, it was usable with Ubuntu distribution only and even there it had bugs. At leaset with Ubuntu 22.04 those bugs are gone, yet I am afraid same pleasure can not bet stated with Debian itself.

The install process on Ubuntu is standard launchpad repository addition to your device:



$ sudo apt-add-repository universe
$ sudo apt-add-repository ppa:cubic-wizard/release
$ sudo apt update
$ sudo apt install --no-install-recommends cubic


Enter fullscreen mode Exit fullscreen mode

For Debian though, this is where the knots are dropped. My install suggestion would be to get the package manually from launchpad repository and try to repackage it with small script I found on the github by @DeeDeeRanged in hopes that it will work for you as it worked for me:

the script is :



#!/bin/bash

DEBPACKAGE="${1%.deb}"

[[ -z "$1" ]] && echo "Usage: $0 <package.deb>" && exit 1

set -e
ar x $DEBPACKAGE.deb
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
ar -m -c -a sdsd "$DEBPACKAGE"_repacked.deb debian-binary control.tar.xz data.tar.xz
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst



Enter fullscreen mode Exit fullscreen mode

Save it - It will provided the repackaging assistance once we'll get cubic.deb package.

How do we get the package you may ask ? follow me:



$ echo 'deb https://ppa.launchpadcontent.net/cubic-wizard/release/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/cubic.list
$ curl -fsSL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xb7579f80e494ed3406a59df9081525e2b4f1283b' | sudo apt-key add - # keep in mind that apt-key will soon be removed
$ sudo apt-get update
$ sudo apt-get install --download-only cubic
$ sudo mv /var/cache/apt/archives/cubic_2023.02-75-release~202302190210~ubuntu22.04.1_all.deb ~/cubic.deb


Enter fullscreen mode Exit fullscreen mode

One might notice that it is somewhat overkill to install package, yet it is necessary if you need that package.
Once the package is in your home directory, let us use the script from before to repackage it.



$ sudo apt-get install -y zstd # required dependency to repack the deb package
$ script.sh cubic.deb # script.sh is an arbitrary name, you may use what ever you wish
$ ls 
  cubic.deb cubic_repacked.deb
$ sudo apt-get install -y ./cubic_repacked.deb


Enter fullscreen mode Exit fullscreen mode

If you have not lost at this point dear reader, then please go to your menu and seek for cubic software on your Debian or Ubuntu device.

Setup

In order to continue with our custom ISO build, I'd suggest to get ourselves with clean Ubuntu distro, which we'll customize with various changes later on.



curl -L https://releases.ubuntu.com/22.04.2/ubuntu-22.04.2-desktop-amd64.iso -o ~/Downloads/ubuntu_22.04.iso


Enter fullscreen mode Exit fullscreen mode

Once the ISO is downloaded, we'll start the Cubic software which should prompt us with initial folder of generation as a prompt that looks like this:

Cubic Prompt

Please keep in mind that folder that you provide must be local drive and NOT network based drives.

Generation

It must be emphasized, that despite hardships of cubic's install on Debian, the tool itself, provides easy-to-use user interface that enables us to reach the goal of custom Debian/Ubuntu Iso for later use. Down below are illustration of such ease :

  • Start by opening Cubic and choosing folder where all the Cubic operations will perform: I have chosen to work under my ~/Download/ISOs folder and press Next

Choose the folder

  • On the next page, we'll need to choose Ubuntu ISO, we downloaded before, and edit parts such as output file names and naming convention of the ISO that will be generated. Once chosen use Next button

Before choosing the ISO file

After choosing the ISO file

  • Once Next is pressed, Cubic will disassemble the Ubuntu ISO in chose folder, and the screen will change to next menu.

Disassembling ISO

  • Cubic tries to provide shell access for user to configure kernel configuration. My suggestion:if you do not know what to do keep on pressing Next
    • In case you do know what to do : Please remember to generate initramfs for any change you will do for kernel, or it will not be saved and default configuration will be loaded instead. Once done, press Next

Terminal Kernel configuration

  • In the next menu screen, you'll be forwarded to package installation. Here you may add any software you'd like to have installed on your device. All and all, you can install what ever you wish. Please remember that Cubic or not, ISO is a standard based on ISO-9660, which max size is usually either 2Gib or 4Gib max. Meaning that in case you'll install too many software package, ISO will not boot, under the claim that ISO is not standard and it will not boot.

Transition screen

Package Choice

  • After choosing the packages, kernel choice screen is provided, in case you have installed new kernel and configured. In case there is only one option, choose to press Next

Kernel Choice

  • One of the ways to reduce ISO-9660 size, is to choose correct type of compression, xz being the best choice, yet it takes a lot of time to compress and de-compress, which might be some what in-convenient. Choose and press Next

Compression

  • Once pressed Next, Cubic will start generating the Custom ISO. Please Note That It Will Put Your CPU To Work

Generation

Eventually you'll be presented with Custom ISO you've configured, and can use, whether in Virtual-Machine engine or in Hardware of your choice.

Conclusion

Thank you dear reader, for staying with me to this part. In this (not so) simple tutorial, I've tried to answer request for Debian and Debian based distributions, in relation to install and use Cubic.

I have tested, run and executed each provided command in hopes to answer every question you might have, as you go through use case of Cubic.

In case you would like to do all the same steps without Cubic, then you should read this tutorial
Hope that you've enjoyed and would appreciate like and repost.

Either way: Please Try To Have Some Fun.

Top comments (3)

Collapse
 
nicoschiavo profile image
Nicola Schiavottiello

Hi Alex, would you recommend this tool if I just want to create a new Debian distro for including custom software? I saw your comment on not having the possibility of putting too much software due to iso restriction

Collapse
 
silent_mobius profile image
Alex M. Schapelle

Hi Nicola,
Depends on what on size of the software. ISO 9660 has size restrictions up to GiB, and Cubic uses it as a standard and I am not aware if it has any bypassing parameters. I have other tutorial with ubuntu20, where I use tool called xorriso, which has flag -s that can allow bypassing that restriction. Check it out

Collapse
 
rajprajapati profile image
Raj Prajapati

I have used Thanks for sharing