New to Linux and the open source world? We have compiled a huge list of resources to help you go through Linux and its distributions. Visit the full Linux guide page right now.
There are many Linux distributions out there, and each one of them has its own features and programs. You may have asked yourself before about how to create a Linux distribution, we are explaining how to do it in our series about “Creating a Linux Distribution“, and today’s topic is about Ubuntu, previously we had:
Ubuntu is the most popular Linux distribution, featuring a lot of features that make life easier on end users, therefore creating a distribution based on it will be a good choice if you are beginner and want to learn a new thing, or share your own copy of the operating system with the world.
Why We Don’t Build a Distribution From Scratch?
Why should it always be based on other distributions instead of building everything from zero, just like the main major distributions? Well, that’s a possible approach you can take alone using Linux from Scratch, but it’s very hard and non-effective; you will need to do tons of work by yourself if you use this method.
You will have to maintain the main repositories holding at least 20000 packages for your users, you will have to fix any possible incompatibility between the components that you choose to ship in your distribution, you will have to create a very big community around you to keep the project up and running, you will have to hire a lot of people in order to ensure quality and security of your operating system.
That’s why people are always building their distributions on Debian, Ubuntu, openSUSE, Fedora… etc, no one is ready to take such effort to create another distributions with some extra features, that’s why we have building on other distributions, don’t re-invent the wheel, unless you will make a difference!
Create a Linux Distribution Based on Ubuntu
You have many ways to do that actually, from using normal building software to manual building and customizing process and passing by combination of two:
The Easy Way
Just use programs; they are there for a reason, you know, to make life easier, you can use some already available special programs to build the ISO file you want from your local installed system and distribute it later.
For that, you can use PinguyBuilder, it’s a program that was originally forked of Remastersys (One of the first re-mixing software for Ubuntu) and developed by the PinguyOS team, it’s working well with Ubuntu 16.04 LTS and up.
I have personally tested it on Linux Mint 18 (Which is based on Ubuntu 16.04) to see how things will go, and it worked great, just choose the settings and files you want to ship in your distribution and wait the program while it builds the ISO file.
For installation, download the latest .deb file and install it, or run the following commands in terminal:
wget https://kent.dl.sourceforge.net/project/pinguy-os/ISO_Builder/pinguybuilder_5.1-7_all.deb sudo dpkg -i pinguybuilder_5.1-7_all.deb
Then open the program from the applications menu:
- The first option will create a file combining all your files and programs (Will be so big and may not work with huge data).
- The second option will create an ISO combining the installed programs and the settings you choose only, not all your data, just the ones you choose from the settings to include.
- The third option will create a file-system tree only, no ISO file, you can include files or packages in that file system manually using “chroot” command and then use the 4-th option.
- The fourth option will create an ISO file from the file-system tree. You should have already used option 3 to do this.
As you can see also, you can choose the Plymouth theme (the graphics after the boot loader directly), edit the Live CD boot menu or choose whom user data you want to include. All files that you place under /etc/skel will be there by default in the users’ home directory who will use your distribution.
Switch for the settings tab for more option:
The options here are explaining themselves I guess.. After you finish, return to the main tab and choose whatever build option you want to start, you will see the ISO file beside the checksums in /home/PinguyBuilder/ folder:
The Hard Way
You can create your distribution based on Ubuntu by extracting the components of the ISO file of Ubuntu to a folder, modify them and then re-build the ISO file. This is how it works theoretically.
You can use this complete official guide from the Ubuntu community to learn how to do so, as you can see, it takes a lot of effort to do the same results, your time will be wasted between downloading packages and compressing and extracting file-systems, copying and modifying all the files manually, which is why people use programs.
If you want, you can use UCK (Ubuntu Customization Kit), it’s a tool that will do all the mentioned work in that article using graphical interfaces with less-need to tune things, it’s free and available to install from the repositories:
sudo apt install uck
If you want to be a first class-citizen in the Ubuntu family, you may consider building a distribution based on Ubuntu from the source ISO files for Ubuntu, you will have to download all the ISO files, combine them and then build your distribution manually using them.
Testing the Distribution
Don’t ever release a thing to the world without testing; it’s an essential thing today if you don’t want to get insults from users who will download your distribution and use it on their own.
You have a lot of methods to do so, like:
- Using KVM, a virtual technology implemented in the kernel itself to run virtual systems. You can use many interfaces available to it like QEMU or GNOME Boxes. Read our guide on how to use QEMU to test your distribution.
- VirtualBox, a famous program developed by Oracle to run and test virtual systems.
All are available from the official repositories for Ubuntu:
sudo apt install gnome-boxes qemu
Or to install VirtualBox:
sudo apt install virtualbox virtualbox-qt
Then just search in the applications menu for the program and launch it to start testing.
There are a lot of ways to build a customized Linux distribution based on Ubuntu, you may choose any one of them that fits your needs, but don’t forget testing; it’s a very important step in order to insure that your system is error-free and working well on any hardware that a user may have.
Have you ever built a distribution before? What methods did you use and how was your experience?