Do you want to create your own customised version of Ubuntu? This article shows you how to use VirtualBox and PinguyBuilder to do that!
This post is kind of a sequel to Create Your Own Debian-based Linux Distro that I posted some years ago. At that time I wanted an operating system (OS) that would be just sufficient to support VirtualBox (VB). VB is a way to host other operating systems on a computer already having an OS. I was able to get a very small OS by using a minimal version of Debian. But for my present purposes (hosting some AI programs) I want more functionality, but not all the ‘usual stuff’ like office suites, graphics editors etc.
I settled on a minimal version of Ubuntu Gnome. I think this would be a good starting point for almost any domain-specific distro. I found, both previously and this time, that Debian is less forgiving than Ubuntu. Debian is lower-level than Ubuntu, but Ubuntu (itself built on Debian) proved to be relatively painless to work with. So here, I want to save you the hassle of Googling (or Binging…) all the error messages you could encounter, because I’ve reduced the task of building a simple Linux distro/respin to this:
- Download the Ubuntu mini.iso
- Install VirtualBox and start it.
- Click on New.
- Type in a name for your distro.
- Select Linux for Type, and Ubuntu (64 bit) for Version.
- Click Next all the way through, accepting all defaults.
- In Settings, put the mini.iso into the CD drive.
- Click Start, this will bring you to the Ubuntu installer.
- In Ubuntu installer:
- Select your language.
- Accept the defaults all the way through (unless you want to change something such as the hostname), except where you’re asked if you want to write the partition changes to disk; tab or arrow over to Yes.
- Installing the base system takes a while. Go get a nice cuppa tea or coffee.
- At Software selection, select any items you want, e.g. a desktop environment (DE). Note that a DE may bring in a lot of stuff that you might not want. It may be better to install any GUI stuff after this install (e.g. xinit xorg gnome-shell). Press enter and wait again (more tea?)
- When the installation is about to finish, it’s suggested you remove the installation CD; click on the other VB window to bring it forward and…
- Back in VB, click on Settings, then Storage, and click on ‘mini.iso’; to the right click on Optical Drive and select Remove. Now go back to the other VB window and hit Enter to complete the process. Click Start. Hopefully you’ll see the Ubuntu login screen! Enter your password (that you gave during the installation). Delete any packages you don’t want (e.g. sudo apt remove <package>). I strongly recommend the use of snapshots to provide rollback points so if you change your mind about any installed packages, e.g. desktop environments etc., you don’t have to discover every dependency that was also installed. Now is a good time to take the first one. Type Host-T (usually Host is the rightmost Ctrl).
-
Remaster the basic system. There was once a fine program called Remastersys (now taken over as ‘Linux Respin’) which enabled you to create an ISO file for burning to CD or thumb drive. Sadly it exists no more, but there are a few forks of it. I like PinguyBuilder (with caveats). Now, before you start adding a lot of goodies to your new distro, is a good time to make sure you can actually create a distributable ISO, and that it works. For me, this was by far the hardest and most time-consuming phase.
- Download PB and ideally install with gdebi, or be prepared to use apt install -f
- Read this comment and do the command shown.
- Edit (as root) /usr/bin/PinguyBuilder and comment/delete the line with ‘autoremove’
- Run PinguyBuilder
- Read this to understand the underlying machinery.
- In your new system: you’d probably like it to occupy Full Screen.
- Go to the Devices tab on VB, and select Insert Guest Additions CD.
- A dialogue box should inform you that a Removable medium was inserted; elect to run it, then reboot.
- When you return to your new distro, select Full Screen for the View tab. It might not immediately display in full screen mode, but hopefully will do eventually…
- Take a snapshot: this is a copy of your new distro that you can revert back to later if necessary.
- Install more software (e.g. a web browser). In command-line, type ‘sudo apt install synaptic’ When that’s done, you can find it in the Gnome menu under Preferences. Start it, then click Search and type in ‘ubuntu software center’. Find it in the search results and right click on it; select Mark for installation, then click on Apply. Synaptic is kind of ‘expert mode’, while the Ubuntu Software Center is best for exploring various categories and subcategories. And there’s many more ways to install software but those should get you started.
- Take snapshots after every significant change, but be aware they take up a lot of disk space! Snapshots are extremely useful when you make mistakes or change your mind, and can save a lot of work…