Building My Own Ubuntu
You probably don’t need to build your own distribution of Linux. There are already so many to choose from and with a bit of research, I bet you can find one all prepackaged and ready to download that will do what you want it to. Right? Then again, why shouldn’t you? Even well seasoned Linux users tend to forget just how modular Desktop Linux really is. People also tend to think that the only folks who can put together their own distros are natural-born hackers who live in a terminal all day. Not true at all! Anyone who has a good basic understanding of what a Linux Desktop is made of and can execute a few simple commands in the right order can build their own Ubuntu based Linux Desktop. It’s easier than you think and it can be a great learning experience too.
Even if your build doesn’t turn out to be what you needed, you’ll have a better understanding of Linux. Plus a deeper respect for the folks who develop and maintain the popular ready-to-install distros we have to choose from today. Yeah, you really ought to build your own Linux distro after all.
Let’s start with a few principles first, shall we?
What we call a Linux Desktop Operating System is actually just a set of programs that work together to give us the illusion of a cohesive computing experience. The name Linux refers to the kernel only. The same Linux kernel can run a TV, router, smartphone or even your refrigerator. To understand this a bit better, let’s take a moment or two and go through what actually happens when you boot up your computer. I’m going to way oversimplify this; there are actually thousands of steps in the process, but we’ll only talk about the big ones.
Step one is to load the Kernel and the bootloader, which is what gets that accomplished when you first turn on your computer. The GRUB (Grand Unified Bootloader) is pretty standard for Linux these days. It lets you choose between different OS’s that might be installed on your machine and it also has some options to boot into special kernel modes for troubleshooting issues or running diagnostics. Most Ubuntu users don’t even see GRUB unless they are running a dual boot. The bootloader starts the process that initializes the system and loads the kernel. Now we can talk to the computer, but with just a kernel we can’t do much.
Next we need a shell. You’re familiar with the Bash shell that runs in a terminal emulator on your desktop? Same thing here. It has a few built-in commands but is really only useful if it’s bundled with utilities and programs that are designed to work with it to get the actual work done. The shell plus these utilities from what is known as a base system. Most server implementations of Linux are nothing more than a base system with a few server type applications installed. Servers are just robots that run in a rack somewhere sharing files or managing databases, they have very little interaction with their masters and don’t need any kind of GUI (Graphic User Interface.) Boring as hell, if you ask me.
To make our Linux system a bit more exciting and useful, we’ll need to add some more stuff to the system. We’ll need a Display Server to actually put something other than text on the screen and let us use touchpads and mice to interact with our computer. Xorg has been the standard display server for decades and most Linux heads just call it ‘X.’ There are newer display servers on the horizon that premise more speed and functionality like Mir and Wayland. What does the display server do? Basically, it draws pictures that other applications tell it to on your screen. It is what talks to your graphics card and tells it what to do. Fortunately, X is pretty much setup automatically these days and the average user should never have to deal with any manual configuration. X won’t do anything by itself, though. We need more stuff to get anything useful out of it.
The next thing a modern desktop needs in the boot order is a Display Manager. If you log into a system with no X installed, you’ll be presented with a very simple login prompt and once you provide your user name and password it will dump you at a prompt and wait for you to type in a command. You could install Xorg and then install a Desktop Environment (DE) and skip the display manager entirely but that would mean that you’d have to start X and load the desktop manually every time you logged in. It would probably get really old after a while because most of us just wanna jump right into a GUI and start pointing and clicking away. The Display Manger takes care of the login stuff and it adds extra features like the ability to use more than one desktop environment and allows you to do fancy things like switch users.
Most Linux DE’s use their own DM’s: Ubuntu’s Unity uses LightDM, Gnome uses GDM, Linux Mint uses MDM, KDE uses KDM and so on. There are actually many to choose from and the main reason I’m taking the time to talk about them is because some desktops don’t have a default and you would have to choose one if you were doing your own install from scratch. For instance, XFCE doesn’t pull in a DM automatically when you install it and you may find yourself scratching your head, wondering what went wrong. Typing in the command ‘startx’ will get you XFCE, but you don’t wanna do that every time. Or, maybe you do! What if you’re working with a server and you don’t plan on running it in graphics mode all the time? Well, easy-peasy, just don’t install a display manager with XFCE. Done.
While we’re on the subject of Linux and DM’s, it’s interesting to note how it integrates into the shell. When you boot Linux without any GUI, you are dumped into what’s called a TTY. This is a virtual terminal. You’ll notice that it usually says that you are in ‘tty1’ There are several TTYs available at startup and you can move from TTY to TTY by pressing Alt and Ctrl keys and selecting the TTY by pressing the cosponsoring function key.
TTY1 is F1, TTY2 is F2, TTY3 is F3 and so on. How many TTY’s there are depends on the distribution and you can be logged in on several TTY’s at once.
The DM usually is assigned to TTY7 or TTY8 and the shell automatically switches to that one at startup once the DM is installed and auto-configured. If you’re using a Linux computer to read this article, you can try it right now. Don’t worry, you won’t lose your place. Try pressing Alt+Ctrl+F1 right now and you should go to a text login. To get back, press Alt+Ctrl+F7 or F8. See how it works? How cool is that?
The full super-simplified boot process looks like this: GRUB + Kernel + Shell + Desktop Manager + Desktop Environment.
This brings us to the Desktop Environment and we have many to choose from here. You could opt for a super simple Window Manager like OpenBox or install KDE’s latest Plasma Desktop Environment. Here’s where you need to do a bit of research because the waters get a bit murky once you’ve chosen your DE. First off, you gotta decide from where it is your desktop environment that packages will come. Ubuntu has most of them already in the standard repositories and installing them can be as simple as issuing a command to install one package that will pull in most of what you need, including Xorg and a Display Manager. Nice.
The only problem is that the DE’s in the repos are sometimes older versions and you may want the latest greatest in your custom install. This most likely means that you’ll have to add a PPA or two to your base system to get those packages. Whatever you decide, you need to do a bit of reading to determine the best path for you. A great place to start is the Desktop Project’s website. Most have pretty comprehensive instructions on how to get started from a base system. There are a lot of great blog posts and videos out there too. Just keep looking until you feel confident you can do it.
Getting a base install of Ubuntu is easy. You can do one of two things: use the Network Installer to build a base system by not installing any desktops when it asks you what flavor of Ubuntu you want. Or you can also get the Server version, install it and then use a tool called ‘tasksel’ to remove all the server components, leaving you with a base Ubuntu system. I think using the Network Installer is probably the best way to go but it does take some time and a good, solid Internet connection is a must.
To get it you must first go to Ubuntu.com and then go to the Downloads tab. Click on ‘Alternative Downloads’ in the menu. You’ll find all kinds of links to different versions of Ubuntu, but the network rattlers will be listed right up at the top. Chose your version and then choose the download that you want. You can pick different kernel versions here too. Once you’ve made your choice, you’ll be taken to an FTP menu that offers a bunch of files to download. The one you want is called ‘mini.iso.’ This is your installation media and all you have to is boot your machine from it and then follow the prompts.
When it asks you what software to install, the only thing you might consider is a print server. If you choose a listed version of Ubuntu from here, it will install a prepackaged spin, not just a simple desktop. It is important to keep in mind that you’ll need a wired connection for all of this to work.
Once you’re desktop selected a desktop and it is up and running, you’ll probably need to edit a file to get the Network Manager applet to control the network on your machine. This is also necessary if you need to activate wireless access. Here’s a good source of info on how you do this at Help.Ubuntu.com.
Now that your basic desktop is installed, the fun really begins because it won’t include all of the things you’re used to getting. Every app, every utility and even a web browser will have to be installed manually. You’ll most likely have to get your own icon themes, backgrounds and window decorations as well. You can make it as tricked out as you like or just install the basic stuff you need and leave it at that. The main thing is that it will be what you want, nothing more and nothing less. Now, that’s what I call freedom! Now, watch my video and see what I came up with. It might give you an idea or two.
OK, OK… I see some of you are chomping at the bit and can’t wait to try this, so here’s a command you can use on a fresh base Ubuntu install to get a very basic XFCE DE to play with:
sudo apt install xfce4 xfce4-goodies slim firefox software-center
To get all of the third party multimedia codecs and fonts, run this command before you restart:
sudo apt install ubuntu-restricted-extras
When the EULA comes up, use the tab key to select OK and then use the arrow keys to choose ‘yes.’ After you are all done, restart your system and start playing!