Understanding the LSB Sample Implementation

Note: The following information is out of date, and is preserved here for posterity. Developers interested in testing LSB compliance should use at least two LSB-compliant operating systems in their testing instead.

Why another Linux build? Aren't there enough Linux distributions already?

The LSB Sample Implementation is not a general-purpose distribution; it's a limited test environment, and a proof-of-concept of building to the LSB specifications.

Most Linux distributions supply lots of packages, and which of them gets installed, and later added, removed, or upgraded is in the local user's control. This is as it should be, except when you're trying to build a portable application. After all, how can you be sure you haven't linked your application to something that is not guaranteed to be present on every system where your application will be installed?

If you as an application developer take advantage of the LSB, that problem becomes greatly minimized: a core set of libraries and interfaces will be present in each LSB-certified distribution, and will work in the way documented in the LSB.

The LSB Sample Implementation is a minimal implementation of that core set, which can be used to test programs before releasing them to the field.

For example, some software has auto-detecting build scripts (such as GNU configure), which will enable the build to make use of many things installed on a system, whether those are part of the LSB. Running the resulting binary in the LSB Sample Implementation will help detect cases where non-LSB features have crept in.

Note that the primary testing tool for an LSB application is lsbappchk. lsbappchk is a static tool, however, and so cannot catch runtime issues, such as calling out to another program. The LSB Sample Implementation provides a way to run the application in a conforming environment.

The LSB Sample Implementation also serves as a proof-of-concept of building an LSB conforming system. The policy is to use released packages from the package maintainers, with a truly minimal set of patches. Some patches are necessary to build in the LSB Sample Implementation environment (often to account for the absence of some tool assumed by the build). A few patches are supplied to fix bugs or add LSB conformance, but generally the preference is for such patches to be picked up by the upstream maintainers and folded into their next release.

Finally, the LSB Sample Implementation is able to stay in lock-step with the evolving LSB specification. New features appear in test versions of the LSB Sample Implementation as they are finalized into the specification. The LSB Sample Implementation aims to release versions matching fully approved new specifications at roughly the same time as the LSB specification. This gives developers the opportunity to preview new features before they become a fully-supported part of their favorite distributions.

The LSB Sample Implementation is not designed as a standalone Linux distribution. It is mainly an example and a test environment--the LSB project does not have the resources to track and fix performance and security issues that is part of the value-add of a true distributor.


The LSB Sample Implementation (SI) tool set contains two packages:

  • lsbsi-chroot provides the core file system for the SI chroot.
  • lsbsi-tools provides the tools for running and configuring the SI chroot.

Every package is avaliable in rpm, deb, and tarball formats. These two packages can be installed independently from each other; in fact, it's possible to install them on different machines and have them work together, if the need arises.

Rpm and Deb Installation

Depending on the type of package file you downloaded, you will need to install the rpm or deb package using rpm, dpkg, or another package manager. For example:

 rpm -i lsbsi-chroot-3.2.0-3.i586.rpm lsbsi-tools-3.2.0-3.i586.rpm 


By default, lsbsi-chroot is installed into /opt/lsb/si/chroot and lsbsi-tools is installed into /opt/lsb/si/tools. After installing lsbsi-chroot, the lsbsi group will be added to your system.

It is important to note that you add your username into lsbsi group. Only users from lsbsi group or root can run the Sample Implementation tools. Also, /etc/sudoers will be modified to allow chroot and mount for all users from the lsbsi group.

If xdg-utils is installed in your system, then the menu item for running SI will appear in the desktop menu after installing the lsbsi-tools package. Otherwise, please use /opt/lsb/si/tools/si for running LSB SI.

Tarball Installation

  1. Extract the file lsbsi-chroot-3.2.0-3.i586.tar.gz:

     sudo tar xzfv lsbsi-chroot-3.2.0-3.i586.tar.gz 

  2. Navigate to the lsbsi-chroot-3.2.0 folder and execute this command:

     sudo ./install.sh. 

    This script adds the lsbsi group and modifies the /etc/sudoers file.

  3. Extract lsbsi-tools-3.2.0-3.i586.tar.gz:

     tar xzfv lsbsi-tools-3.2.0-3.i586.tar.gz 

Navigate to the lsbsi-tools-3.2.0 folder and execute this command:

 sudo ./install.sh. 

During installation you have to specify the path to the chroot (which is to the folder where lsbsi-chroot was extracted).


Running LSB SI Tools


You can run SI via the desktop menu or by executing [lsbsi-tools-path]/si-GUI. If you used rpm or deb, then [lsbsi-tools-path] is /opt/lsb/si/tools. If you used tarball to install, then it's the path to the folder where lsbsi-tools was extracted. This will launch the GUI interface for adjustment and launching the chroot environment. There is another way for launching the chroot environment: using the non-GUI [lsbsi-tools-path]/si script. It's useful in case of absence of the Qt4 library on your system.

Configuration Launching

The grpahical interface is used to set some of the options for launching the chroot environment. Some of options, for example, are only used for ssh connections for remote access to the chroot environment.

There are the options:

  • path--path to the chroot environment on the local or remote system.
  • host--hostname of the server with lsbsi-chroot.
  • port--number of port for ssh demon on the server.
  • user--the user name for ssh connection.
  • PreferredAuthentications--the mode of authentication: publickey, keyboard-interactive, password, and hostable.
  • X11forwading--X11 forwading options: normal or trusted.

The graphical interface is the easiest way for adjustment of options for launching chroot. But there are other ways. It's possible to specify all options in the si_run.conf file or, if you are using the si script, to specify arguments in the si script itself (see ./si --help).

After setting all options click the Run SI button. This will launch a terminal window (i.e., gnome-terminal or konsole) with a shell running in the SI chroot environment.

Troubleshooting SI

  • The current version doesn't support SE Linux, so we recommend you disable SE Linux before launching LSB SI.
  • If, after launching LSB SI via desktop menu, nothing happens run it from terminal ([lsbsi-tools-path]/si) and look at error messages to determine what might be the problem.
  • Running via desktop menu can lead to an invalid chroot environment (this is particularly the case with Fedora Core 9). The reason is that /etc/sudoers contains Defaults requiretty string, which prevents the sudo command from being run anywhere but from within a terminal. There are several ways to avoid this problem:
    • Comment out the Defaults requiretty string in /etc/sudoers.
    • Change the type of application in Launcher Properties for the corresponding menu item. Set type as Application in Terminal (this is avaliable in GNOME).
    • Launch LSB SI via terminal. Use /opt/lsb/si/tools/si in case of rpm or deb installation or run ./si in the folder where you extracted the lsbsi-tools.tar.gz file.

Uninstall SI

To uninstall with rpm or deb use the rpm -e or dpkg -r commands. For uninstalling the tarball version, navigate into the corresponding folder and run sudo ./uninstall.sh.