How do you install Cubic and use it to create a customized Ubuntu live CD *.iso file that can be burned to CD/DVD or copied to a bootable USB?

up vote 17 down vote accepted

Cubic (Custom Ubuntu ISO Creator) is a GUI wizard to create a customized bootable Ubuntu Live CD (ISO) image. Cubic features an integrated command-line chroot environment, to make the customizations, and permits effortless navigation, backward and forward, through the ISO generation steps. You can create new customization projects or modify existing projects, and important parameters are automatically populated with intelligent defaults to simplify the customization process.

(Note: Cubic uses Xorg and does not work on Wayland, if you get an error like "ls: cannot access '~/.Xauthority': No such file or directory" then try installing/switching to Xorg. Particularly since Artful Aardvark uses Wayland by default)

Installing Cubic

To install Cubic, add the PPA, and install using apt.

sudo apt-add-repository ppa:cubic-wizard/release
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6494C6D6997C215E
sudo apt update
sudo apt install cubic

Using Cubic

Launch Cubic from the dock or application menu.

On the Cubic Introduction Page, select a directory to keep all your project files. You can have multiple customization projects, but you must pick a different directory for each project.

enter image description here

Information on the New Project page will be automatically filled out for you. You can accept the recommended defaults. If you chose to change some of the values, related parameters will automatically be updated as you type.

enter image description here

enter image description here

The next page will display progress as the compressed Linux file system is extracted.

enter image description here

The Terminal Page automatically appears once the Linux file system has been extracted. This is where you can make customizations. You will need to use the command line. Note that this is a chroot environment in which you are logged in as a root user, so you do not need to use sudo when typing commands. (Note in Ubuntu 14.04, if you do not see the terminal prompt, press the Enter key a few times).

Use command line tools to customize Ubuntu.

enter image description here

Note, while customizing Ubuntu 17.10, DNS lookups may not work in the chroot environment and you may not be able to use apt ("Name or service not known" error). This is because the link /etc/resolv.conf points to /run/systemd/resolve/stub-resolv.conf. But stub-resolv.conf does not exist. To resolve this, execute the following command in the Cubic chroot terminal window...

ln -sr /run/systemd/resolve/resolv.conf /run/systemd/resolve/stub-resolv.conf

To verify DNS resolution works, execute...

cat /etc/resolv.conf
ping google.com

Here are a few examples of customizing Ubuntu using the command line...

You may use the nano text editor to edit files. For example, to edit the sources repositories list, type

nano /etc/apt/sources.list

To exit nano, type Ctrl-X and you will be prompted to save the file. To not save the file, type N. To save the file, type Y, and press Enter to accept the default file name.

enter image description here

After editing the sources list, remember to update the list of available packages using:

apt update

You can use apt to update sources and install applications. For example, you can install other Linux kernels.

apt install linux-image-extra-4.10.0-24-generic

You may click the Back button to change some of your the project parameters you entered on the New Project Page. If you quit the application, you can always open your project and continue making customizations on the Terminal Page, where you left off.

enter image description here

You can copy files or directories into the current directory by dragging them onto the terminal window. You can also copy files using the right-click context menu. This context menu also allows you to cut-and-paste text in the terminal.

Here is an example to copy additional wallpapers into your customized environment.

cd /usr/share/backgrounds

Then simply drag the new wallpapers onto the Cubic window.

Tip: Be sure to list the new wallpapers in an XML file under /usr/share/gnome-background-properties, so they will be listed in the Change Background dialog when the user right-clicks on his/her desktop.

Note that the Cubic GUI currently does not support copying files over the network, but you can use the rcp or scp commands from within the terminal environment.

enter image description here

enter image description here

When you are done making your changes, click the Next button. Remember, you can always come back to the terminal environment for this project to make additional customizations in the future.

On the next page, you will see a list of additional kernels you may have installed to your customized Linux system, in the chroot environment. You can chose to use one of these as the boot kernel for your new live iso. (Note: On this page you are not selecting the kernel that is used inside your customized Linux system, nor are you selecting the kernel that will be installed onto a computer, using your new live iso). It's a good idea to just accept the recommended default on this page.

enter image description here

After you click the Next button, you will see a list of all packages installed in your customized Linux system. The packages with a check mark next to them are flagged to be automatically removed by the "Ubiquity live CD installer". If you do not want Ubiquity to remove a package after installing your customized Linux system, simply un-check that package. Be careful when selecting packages for removal, because additional dependent packages may also be removed, and these will not be indicated in the list. Again, it's a good idea to just accept the recommended defaults on this page.

enter image description here

Cubic will automatically package your customizations into a new *.iso disk image. The progress and results of each step are shown. Note that Cubic uses maximum compression, and the "Compress the customized Linux filesystem" step may take a long time, depending on your system hardware. (You may want to open System Monitor to track your CPU utilization during this step).

At any time during this process, you can click the Back button to immediately go back to the chroot environment, and make additional changes or customizations you may have overlooked.

enter image description here

After generating the new customized disk image, Cubic will also generate an MD5 checksum file that can be used to verify your customized *.iso file.

enter image description here

Click the Finish button, and information about the customized disk image will be displayed.

If you want to continue customizing this project in the future, you must uncheck the "Delete all project files..." checkbox. Otherwise, all working project files will be deleted (in order to save disk space).

enter image description here

Finally, use your favorite disk burning program, such as Braseo, to burn a copy of the *.iso image to CD or DVD, or use USB boot program, such as Startup Disk Creator or mkusb, to create a bootable USB.

Tip: If you are distributing your customized Linux, the corresponding MD5 checksum file can be used to verify that it has not been altered. For example, ensure both files are in the same directory, and type the following…

md5sum --check ubuntu-gnome-17.04.0-2017.06.24-desktop-amd64.md5

ubuntu-gnome-17.04.0-2017.06.24-desktop-amd64.iso: OK

Making Changes

Start Cubic, and select an existing project directory on the Introduction Page. Click the Next button, and you will be presented with three options:

  1. Create a new ISO image containing customizations you previously made
  2. Continue customizing your project to make additional changes
  3. Delete the project and start over. The project files take up disk space, so you may want to delete old files.

enter image description here

If you chose to delete the project, ALL project working files will be deleted. If the generated *.iso image is in the project directory, it will also be deleted, unless you manually move it.

enter image description here

  • What do you mean with "Outside the chroot environment"?? Execute the command outside cubic?? – Gabriel Sandoval Oct 25 '17 at 22:18
  • This means, open a terminal window on your local machine, and type the above command. (Technically, you could also type this command inside the chroot environment, without using sudo, and it will have the same effect). To avoid confusion, I am jut going to recommend executing this command inside Cubic's chroot terminal window. Also, note that the resolv.conf problem only occurs when customizing a Ubuntu 17.10 ISO while running Cubic from a 16.10 (or <) system; this issue does not occur when customizing 17.10 from Cubic running in 17.10. – PJ Singh Oct 26 '17 at 3:57
  • Note: Due to Wayland's security restriction on running graphical applications using root privileges, Cubic will only work in an Xorg session. – PJ Singh Oct 26 '17 at 4:14
  • How much free space do I need to have in order to edit a Lubuntu 16.04.2 LTS i386 ISO in Cubic? Probably more than 4,1 GiB, right? – Bajiru Dec 16 '17 at 21:17
  • @Bajiru, you will need 5090 MB minimum. This does not include additional packages or files you might add. Here is how I calculated: 921MB (lubuntu-17.10-desktop-amd64.iso) + 3387MB (uncompressed working files) + 782MB (new lubuntu iso) = 5090 MB. Cubic uses maximum compression, which is why the new iso is smaller than the original iso in the calculation. Cubic will not work with the 32 bit version of Lubuntu; only use 64 bit. Also, if you are doing this on a lower spec machine, be prepared for the uncompressing and compressing steps to take a while and to max out your CPUs. – PJ Singh Dec 17 '17 at 5:55

Installation:

  1. sudo apt-add-repository ppa:cubic-wizard/release
  2. sudo apt-get update
  3. sudo apt-get install cubic

Creating an ISO image:

enter image description here

enter image description here

enter image description here

enter image description here

  • Yeah I was working on the same thing and I have also added at least the essentials – Jay T. Mar 3 '16 at 20:53

Just adding to the great answer in the top.

In order for resolv.conf to work for me (at the time of writting) on 17.10 and 18.04 I'm using the following:

mkdir /run/systemd/resolve/
echo "nameserver 127.0.1.1
search network" | tee /run/systemd/resolve/resolv.conf
ln -sr /run/systemd/resolve/resolv.conf /run/systemd/resolve/stub-resolv.conf

Hope it helps others.

  • It's being fixed on latest Cubic release. Can omit this answer. – Ark74 Aug 25 at 17:49

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.