Create Your Own Ubuntu-respin Linux Distro

4Jul - by Alan - 0 - In Linux
VirtualBox
VirtualBox

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.

Ubuntu Gnome
Ubuntu Gnome

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:

  1. Download the Ubuntu mini.iso
  2. Install VirtualBox and start it.
    1. Click on New.
    2. Type in a name for your distro.
    3. Select Linux for Type, and Ubuntu (64 bit) for Version.
    4. Click Next all the way through, accepting all defaults.
    5. In Settings, put the mini.iso into the CD drive.
    6. Click Start, this will bring you to the Ubuntu installer.
  3. In Ubuntu installer:
    1. Select your language.
    2. 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.
    3. Installing the base system takes a while. Go get a nice cuppa tea or coffee.
    4. 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?)
    5. 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…
  4. 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).
  5. PinguyBuilder
    PinguyBuilder

    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.

    1. Download PB and ideally install with gdebi, or be prepared to use apt install -f
    2. Read this comment and do the command shown.
    3. Edit (as root) /usr/bin/PinguyBuilder and comment/delete the line with ‘autoremove’
    4. Run PinguyBuilder
    5. Read this to understand the underlying machinery.
  6. In your new system: you’d probably like it to occupy Full Screen.
    1. Go to the Devices tab on VB, and select Insert Guest Additions CD.
    2. A dialogue box should inform you that a Removable medium was inserted; elect to run it, then reboot.
    3. 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…
    4. Take a snapshot: this is a copy of your new distro that you can revert back to later if necessary.
  7. 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.
  8. 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…

If you have any questions please ask on the forums.

Leave a Reply