SUSE Studio: Create a custom Linux distribution with an openSUSE core

INTRODUCTION

openSUSE is one of the most robust and thus respected Linux distributions. It is a very polished and professional distro. There are many options available when it comes to downloading openSUSE, but the most exciting feature that is available to the user is the ability to create a custom distribution with an openSUSE core. Yes, it is true. The user can create a distribution with all the packages he needs and nothing more. I am talking about the venerable SUSE Studio. This is not a new feature but not many know about this. SUSE Studio provides the infrastructure for the user to create, test and distribute the custom distro.

I have been a diehard fan of openSUSE from the 11.x days. openSUSE has never let me down. openSUSE’s KDE implementation is one of the most seamless and beautiful work of art.

I like KDE but it is just too huge. I have many physical and virtual machines. I update all of them twice a month. With Desktop Environments (DE) like KDE and GNOME, I would end up with huge downloads during updates. This is not a trivial issue in countries like India. I had to look for a better DE or a very capable Window Manager (WM). I tested openbox, Xfce, Lxde and Enlightenment. I liked Xfce the most. Xfce is an excellent DE. It has a small disk and RAM footprint while providing a rich set of features. It is based on GTK+ 2. It is very customizable too.

The only problem is that openSUSE has no official spin for Xfce. What are my options?

  • Get Xfce from the openSUSE repositories and have it installed alongside KDE
  • Get Xfce from the openSUSE repositories and remove KDE. This is pure pain in the rear. Never do this.
  • Use the Net install and choose the DE to be installed
  • Use SUSE Studio and create own distro

The last option is by far the best one for any student of Linux. Thus, I decided to create one. There are many other reasons, apart from the one I mentioned above, for creating a custom distro based on openSUSE:

  • to learn
  • for fun
  • to create an ownCloud server or any other type of server for that matter
  • to scratch any other itch 🙂

What follows is a detailed explanation of how to create a custom distro, using the great SUSE Studio and based on openSUSE core. I am logging whatever I did for getting an Xfce system for my personal use. The packages to be selected may be different for creating other types of distros but the general principles will remain unchanged. I am detailing as much as possible so that even enthusiastic newbies can go ahead and play with SUSE Studio. This was a great learning experience for me.

SUSE STUDIO

SUSEStudio_SignInPage

Sign in or create a new account. One can login in many ways.

SUSEStudio_SigninORCreateNewAccount

Once the login is taken care of one enters the beautiful greenish world of SUSE Studio. The adventure is about to begin. So, be ready for it 🙂

SUSEStudio_Home

On the Home page, under the heading Actions, is the link to the real adventure. Click on the **Create new appliance **link and the following page opens up. The options available are very clearly explained.

**CHOOSE A BASE TEMPLATE

**

As I  had decided to have the latest openSUSE as base, openSUSE 13.1 Just enough OS (JeOS), was the best choice. A light minimalistic DE is what I was looking for. Thus, there was no point in choosing the GNOME desktop or the **KDE 4 desktop. **One should avoid **Server **option because it is more suited for building a server, but can be used as base for creating a desktop too! Anything is possible in the FOSS world.

SELECT YOUR ARCHITECTURE

The architecture should be chosen based on what hardware we intend to target. The really old PCs may not have 64-bit CPUs. This restricts one’s choice to 32-bit. I have a Pentium D dual core 64-bit CPU with a chipset that supports 4 GB DDR2 RAM only. Thus, there is not much that I gain from having a 64-bit OS on that machine. I have many other modern machines too. They are all 64-bit. Thus, I benefit from having just one 64-bit distro ISO that would be capable of getting installed on all my PCs. Such things need to be considered while choosing the architecture.

NAME YOUR APPLIANCE

This is the most difficult thing to do. Wasting too much time here is not good for society.

CREATE APPLIANCE

The green enticing button needs to be pushed and a brand new base appliance is ready for further modifications.

SUSEStudio_CreateNewAppliance

Now that a base template appliance is ready for further tweaking, one should just move ahead without wasting any time. Let me get my custom distro ready before earth stops spinning. SUSE Studio took me to a page where one can edit the base template appliance. There are six tabs available on this page. I will move through all of them but let me first jot down a few words about each:

  • Start

The welcome tab where one can name/rename the appliance

  • Software

The tab where one can select packages from the openSUSE repositories. There is so much to choose that it can be a bit overwhelming.

  • Configuration

As the name suggests, here is where one can configure the various aspects of the system

  • Files

Files added here will be copied into the appliance after packages are installed. Adding files is optional. Single files will be copied to the specified directory. Archives (.tar, .tar.gz, .tar.bz2, .tgz, or .zip) will be extracted into the directory specified. Permissions and hierarchy will be preserved. Using archives is a great way to add many files at one time.

  • Build

Well, this tab helps build the appliance.

  • Share

Let the world know.

START TAB

Nothing much to do here apart from naming/renaming the appliance and viewing/reviewing the choices made till now. Only choices made on SUSE Studio can be reviewed here. Life’s choices can only be reviewed after death if the notion of God has any truth in it and if that God is really hell bent on doing a post-mortem of my life 😉

SUSEStudio_EditBaseAppliance

SOFTWARE TAB

This is where most of my time was spent. There are just too many packages to choose from. SUSE Studio has made it easy for the user by categorizing the packages and arranging everything in an intuitive way. Still, a new comer may be distracted. There is a logical way of breaking down the whole task of choosing the packages. The desktop distro needs the following components to work:

X Windowing System or X11 is a client-server system. X Server provides a mechanism for the X Clients to create GUI elements and manage them. A Desktop Environment like Xfce or KDE or GNOME has a X Client component known as the Window Manager that works in tandem with the X Server.

[![X_client_server_example](http://localhost:8080/wordpress/wp-content/uploads/2014/04/x_client_server_example.jpg)](http://localhost:8080/wordpress/wp-content/uploads/2014/04/x_client_server_example.jpg)
Image taken from Wikipedia: https://en.wikipedia.org/wiki/X_Window_System
- [A Desktop Environment](https://en.wikipedia.org/wiki/Desktop_environment). I chose Xfce. - Package management/system administration tools. The command-line package management tool, [**zypper**](http://en.opensuse.org/Portal:Zypper), is available by default. This may not be enough for all. [**Yast – Yet Another Setup Tool**](https://en.wikipedia.org/wiki/Yast), the openSUSE system administration infrastructure can be added. Yast has many other system administration tools apart from package management. - Drivers - Network tools - [Firefox Browser](https://www.mozilla.org/en-US/firefox/new/) - [VLC audio/video player](https://www.videolan.org/vlc/) - Office suite. [Libre Office ](https://www.libreoffice.org/)has very little competition here. - A Display Manager for graphical login. I chose **[LightDM](https://en.wikipedia.org/wiki/LightDM). **Without this component one would have to type in commands to login to the machine and launch the Desktop Environment.** **

This break-up made the task easier for me.

There are many ways of getting the packages. There is a search box that allows user to input search pattern strings. Also, there are various package groups available. When a package is selected, SUSE Studio does a good job of including all the required dependencies for the user. This makes the whole job very easy. Imagine if the user had to manage dependencies too. That would have been hell.

SUSEStudio_ChooseSoftwareOptions

The X Server packages

Type **X11 **in the search box and hit enter. SUSE Studio will list all packages matching the X11 pattern. The **X11 X Window System **package is the most important one. A lot of dependencies will be auto selected. The good thing about the table generated after during the search is that it can be sorted based on various parameters. Just click on the column name and the column can be sorted. Popularity column is the most interesting because that helps in understanding what package has the most popularity for a particular search pattern. This is a good indicator but not the absolute one:

SUSEStudio_ChooseX11Packages

Desktop Environment, Xfce packages

There are a lot if packages to be selected. The good thing is, the whole Xfce package set is very light. 70-100 MB would be enough to have a fully functioning DE. So, search for **xfce4 **pattern and add all the packages OR go through each package and choose what really is needed. The latter option may consume some time but helps in avoiding unnecessary packages. Once Xfce packages are selected, make sure that the following packages are also selected:

  • gtk2-engine-murrine
  • gtk2-engines

How do we know what package to choose from the list?

It needs some research and some experimentation. The package names are really self-explanatory and that helps a lot. The SUSE Studio Testdrive option also comes to the user’s assistance. To know about Testdrive keep reading…

The Xfce DE is extremely configurable. Xfce is based on GTK2 and needs the above-mentioned engines for proper working of external GTK2 themes. Now, these themes are easy to get from deviantArt and GNOME-LOOK.org. Installing these themes is easier still. That is the beauty of Xfce.

Yast, Yet Another Setup Tool

A one-stop shop for configuring everything on an openSUSE system. The following image shows yast2 in action. The complete openSUSE system can be managed from this application:

openSUSE_Yast2

Now search for yast2. Again, one can add all the packages OR go carefully through the list and add what is needed.

I had a lot of trouble getting the GUI for yast2 working. Whatever I did, yast2 would only run using **ncurses **after throwing the following error:

qt gui wanted, but not found, falling back to ncurses

I struggled a lot and found that the **libyui-qt5 **is necessary for yast2 to run with a GUI.

Drivers

This needs further breaking down:

Input drivers

The keyboard and mouse drivers:

  • xf86-input-keyboard
  • xf86-input-synaptics (This is needed for the laptop touchpad)
  • xf86-input-mouse
Video drivers

The display/monitor driver and graphics (ATI/AMD Radeon and NVIDIA etc.) driver:

  • xf86-video-intel
  • xf86-video-vesa
  • xf86-video-ati (opensource ATI/AMD Radeon)
  • xf86-video-nv (opensource NVIDIA)
  • xf86-video-fbdev

Network tools

The following packages should be enough:

  • NetworkManager
  • NetworkManager-gnome
  • wireless-tools
  • wpa_supplicant
  • wpa_supplicant-gui
  • yast2-network (this should already be in the selected list)

Firefox Browser

There are many choices when it comes to browsers. Firefox is the one that I use mostly. I have Midori too. Chromium is good too, but Google cannot be kept out of it. Search for firefox.

VLC audio/video player

There is not much competition for VLC on the desktop irrespective of the platform. Search for vlc.

Office suite

Libre Office is really good. Search for libreoffice.

Desktop Manager

There are just too many choices here. LightDM is light and beautiful. Search for lightdm.

CONFIGURATION TAB

This tab obviously helps the user to configure the distro being created 🙂

SUSEStudio_Configuration

There are many options available here:

  • General

Choose Default locale,** Default time zone**,  Network,** Firewall** and Users and groups

  • Personalize

Choose Appliance logo and** Appliance background:**

SUSEStudio_Configuration_Personalize

  • Startup

Choose the Default runlevel. A desktop distro is being created and a Graphical Login would be the best option. The EULA option is mostly for corporate environment but an ordinary mortal too can include an EULA:

SUSEStudio_Configuration_Startup

  • Server

Skip this.

  • Desktop

Nothing really to write in detail here.SUSEStudio_Configuration_Desktop

  • Appliance

The Appliance can be created in various formats. That is, one can have a VMWare image, for example. Here one can configure how much RAM and Disk space should be allocated to the VMWare image:

SUSEStudio_Configuration_Appliance

  • Scripts

One can create scripts and:

Run script at the end of the build OR Run script whenever the appliance boots

For a normal user, nothing needs to be done here but this is really a cool feature:

SUSEStudio_Configuration_Script

FILES TAB

This is where one can add custom files and archives to the appliance. The single files will go to the destination the user mentioned while the archive gets extracted to the desired location after the installation of the package. In case of VMWare images, the appliance will have these files already extracted as part of the build process:

SUSEStudio_AddFilesORArchive

BUILD TAB

Well, what else would one want to do after all that he has been through till now :)?

SUSEStudio_BuildApplianceThere are options here too:

  • Live CD/DVD (.iso)
  • USB stick / hard disk image
  • Preload ISO (.iso)
  • VMware / VirtualBox (.vmdk)
  • OVF virtual machine
  • Xen guest
  • Hyper-V (.vhd)
  • SUSE Cloud / OpenStack / KVM

These options are fully explained in the Selecting Appliance Formats article. Reading that is really essential for an easy life in the SUSE Studio world.

One can select a default format to build while also selecting multiple additional formats. What did I choose?

I chose **Live CD/DVD (.iso) **and USB stick / hard disk image. Why?

Live CD/DVD is basically what one gets from the official download locations of almost all distros. The Live CD/DVD helps the user get a feel of the complete system without really installing the distro.

USB stick / hard disk image is really helpful during SUSEStudio Testdrive. It has other purposes but its utility stands out during the Testdrive.

So, choose the correct formats and hit the big green build button SUSEStudio_BuildButton

A progress bar appears and indicates the build progress. The build process can build only one format at a time.

SUSEStudio_BuildProgressOnce the build is done the image is ready for Testdrive and Download. The Build additional button appears if other formats were selected in addition to the default format. Hit that button and the other format gets built.

SUSEStudio_BuildDone

SUSE STUDIO TESTDRIVE

Testdrive lets the user test the appliance in the browser using Flash plugin. No downloads at all. This test can be done using any format but the **USB stick / hard disk **image is the most important format. One can modify system files during test drive and get it included in the Files Tab only if one uses the USB stick / hard disk. So, test drive using the USB stick / hard disk and get the system properly running and then build other formats.

SUSEStudio_Testdrive

I had a problem with the LightDM Display Manager. I could not get it to work. I found that the /etc/sysconfig/displaymanager file needs to be modified. Just make sure that the beginning of the file looks like below:

Path:    Desktop/Display manager

Description:    settings to generate a proper displaymanager config

Type:    string(kdm,kdm3,kdm4,xdm,gdm,wdm,entrance,console)

Default:    “”

Here you can set the default Display manager (kdm/xdm/gdm/wdm/entrance/console).

all changes in this file require a restart of the displaymanager

DISPLAYMANAGER=”lightdm”

I modified the file while test driving the USB stick / hard disk image and got it included in the Files Tab. Now LightDM greets me when I try to login to my machine.

SUSEStudio_displaymanagerFile

SHARE TAB

After all the hardwork, let the world know about it:

SUSEStudio_ShareAppliance

My appliances:

The package list can be found here.

The package list can be found here.