The Zero Install system

Thomas Leonard

University of Southampton

http://0install.net

Overview

Problems with traditional systems

Zero Install example: running ROX

Libraries and the cache

Security

Packaging for Zero Install

Current state and future work

Problems with traditional installation

Ease of use

Find package for your system

Enter root password

Unclear what changes are being made

Security

Install scripts execute as root

One package for each distribution

Unnecessary extra work

Getting ROX-Filer with Zero Install

If you don’t have ROX-Filer, run it like this:

$ cd /uri/0install/rox.sourceforge.net

$ ./rox

or

ROX-Filer is downloaded, cached and executed.

Root access is not required.

Getting the rest of ROX

To the user, all applications appear available.

When clicked, they are cached and run.

Running ROX

Libraries

Dependencies loaded by globally unique paths.

“Web of software”

Memo loads ROX-Lib from:

/uri/0install/rox.sourceforge.net/lib/ROX-Lib2

ROX-Lib loads pygtk from:

/uri/0install/zero-install.sourceforge.net/libs/pygtk-2

Multiple versions

All software is available.

All versions (‘latest’ symlinks).

All platforms (mainly Python code, though).

Source code.

Debugging symbols.

Download-on-demand: can include everything!

The network and the cache

Simple cache structure:

/uri/0install/rox.sourceforge.net/rox

/var/cache/zero-inst/rox.sourceforge.net/rox

Safe to delete anything from the cache.

Running cached programs doesn’t use the net.

Conceptually similar to web caches (squid).

Unix filesystem interface

Faster for cached data: mmap

Site-at-a-time updating

Updating the cache

0refresh updates a site’s index:

gimp.org $ ls

gimp-1.2

gimp.org $ 0refresh

gimp.org $ ls

gimp-1.2

gimp-2.0

Programs can update the cache if needed.

#!/bin/0run python.org/python2.3 2004-01-01

print “Hello from Python!”

Slow connections

You need broadband, right?

Getting ROX-Filer over GPRS (mobile phone):

1m48s

265 K received, 13 K sent

Normal ROX-Filer binary release is over 1Mb.

Didn’t need translations, manual or icon theme.

No global index (apt-get update).

Security

Anyone can run any software.

Nothing is run as root.

Uses GPG signatures and MD5 sums.

Does not listen for incoming connections.

No SUID binaries. Use sudo.

Nothing run on updates.

Future security possibilities

Basis for sandboxing systems:

Subterfugue, Systrace, Java, UML.

Other trust schemes:

https, web-of-trust, key-servers, certificate authorities.

Whitelists and blacklists.

Packaging for Zero Install

Need good binary compatibility.

See http://autopackage.org

Create and populate the directory structure.

$ ./configure --prefix=/uri/0install/...

Run 0build:

$ alias 0build=/uri/0install/zero-install.sourceforge.net/bin/0build

$ 0build /var/www myhost.com

Use any web server (e.g. apache).

Architecture

Future work

Better support for mirrors / peer-to-peer.

Better cancelling of downloads.

Intelligent cache cleaning.

Port lazyfs to other OS kernels.

Limits to prevent local DoS attacks.

Summary

ROX is using Zero Install successfully

Zero Install is the easiest way to get ROX

Anyone can join in (decentralised)

Easier for users

Easier for upstream authors

Security benefits

Questions – install to PATH?

(summary of questions asked after the talk)

Can Zero Install be used without also switching to ROX-style applications (e.g. still put binaries in PATH)?

Per-user union FS (like Plan/9) ideal.

Stow could achieve much the same effect, installing symlinks in $HOME pointing into /uri/0install.

But ROX is cool, because you don't need all that!

Questions - configuration?

Installing on Debian asks about configuration (e.g. apache). What about on Zero Install?

On Debian: 'apt-get install apache' installs apache, and configures it as a side-effect.

On Zero Install: '/uri/0install/apache.org/config' configures apache, and installs it as a side-effect.

Same number of steps, but configuration is always explicit in Zero Install.

User apps (gimp, etc) do configuration on first run anyway.

Questions - caching

Is Zero Install web-cache friendly?

Yes!

GPG detached signature and index name is fetched bypassing cache (about 1K) to ensure up-to-date.

Index and all archives are fetched through the cache. They are uniquely named including a date-stamp, so that the same name always refers to the same data => never need to check whether they are out-of-date => excellent for caches (squid, etc).

Questions – how do I repackage?

ROX apps are easy to package for zero install. What about more traditional auto-tools packages?

Use ./configure –prefix=/uri/0install/... to build.

Then distribute using 0build as normal.

To link against Zero Install libraries, either specify the full path of the library, or add an rpath entry to the ELF header to add a /uri/0install/... directory to the search path.

Questions – versions and bug reports

When a Debian user uses reportbug, the bug report automatically includes all library versions. Can Zero Install do the same?

In a pure Zero Install system, this isn't a big problem, since everyone is using recent libraries anyway. Same binaries everywhere.

Not done automatically when mixing Zero Install with traditional system. Same problem as normal binary packages.

But advantages too: debugging symbols and source are trivially available when using Zero Install.

Questions – get everything?

Should we package everything this way (glibc, etc)?

Probably not.

Users already have glibc; they see no advantage over traditional methods to get it.

Better to package applications, and add libraries when you get complaints that some distro doesn't have them.

2004-07-10T15:55:10