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?
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)
To install Cubic, add the PPA, and install using
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
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.
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.
The next page will display progress as the compressed Linux file system is extracted.
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.
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
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, 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.
After editing the sources list, remember to update the list of available packages using:
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.
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.
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
scp commands from within the terminal environment.
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.
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.
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.
After generating the new customized disk image, Cubic will also generate an MD5 checksum file that can be used to verify your customized
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).
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
Start Cubic, and select an existing project directory on the Introduction Page. Click the Next button, and you will be presented with three options:
- Create a new ISO image containing customizations you previously made
- Continue customizing your project to make additional changes
- Delete the project and start over. The project files take up disk space, so you may want to delete old files.
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.
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.