run command on any linux distribution, transparently using docker containers
Go to file
2021-05-01 16:23:56 +02:00
install install - warn if bindir is not in PATH 2021-05-01 16:23:56 +02:00
LICENSE.txt add (c) and LICENSE 2021-04-30 20:32:20 +02:00 clean README 2021-04-30 20:35:17 +02:00
runon add author in help 2021-05-01 16:23:11 +02:00
runon.conf update packages list and add new distributions 2021-04-30 18:04:25 +02:00

RUNON - Run your commands in any systems

(c) 2021 Gilles Grandou licensed under GPL-2.0.



$ grep ^PRETTY_NAME /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"

$ runon centos7 grep ^PRETTY_NAME /etc/os-release
PRETTY_NAME="CentOS Linux 7 (Core)"

$ runon ubuntu20.04 grep ^PRETTY_NAME /etc/os-release
PRETTY_NAME="Ubuntu 20.04.2 LTS"

$ runon debian9 grep ^PRETTY_NAME /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"

$ runon centos7 xclock
[xclock launched!]


Installation is only tested on Debian 10, even though it should work straightforward on any equivalent system.

Docker Install

sudo apt install docker

Check that your user is part of docker group:

sudo adduser <user> docker

If needed, you need to logout and login again for the new group to become active.

manual install

cd <tools>
git clone

local install, in your ~/local/bin (or wherever directory which is in your PATH):

cd <runon>
./install local


./install local <your_bin_path>

system install, for all users:

cd <runon>
sudo ./install system

each user can have its own configuration in ~/.config/runon/runon.conf if needed.


simply pass -u to install command you have used, eg.:

./install local -u
./install local -u <dir>
sudo ./install system -u

you can create soft links to runos to simplify calls:

cd /usr/local/bin
ln -s runon centos7

now calling centos7 ... is equivalent to call runos centos7 ...:

centos7 xclock


With the default configuration, a seamless environment is set up, allowing to transparently run commands in various environments, while keeping:

  • user environment (uid, gid, password, home directory, ...)
  • X support to run graphical applications

Basic usage

runon [options] <osname> <command>

runon -h

available options

  • -v verbose output, this is really usefull when running new containers for the first time, as the initial docker build can be quite long (several minutes) especially with slow internet link. If the command seems to be stalled, don't hesitate to interrupt it (with CTRL-C) and to restart it with -v.

  • -u forces the container image to be updated, useful if the distribution has been updated and you want to use it. Otherwise, if a container has been already built, it will be used directly without doing any network access.

  • -c <configfile> uses a custom config file, useful to try new distribution without breaking your running config.

Interactive shell

Just run:

runon <osname>

while start an insteractive shell in the container system:

gilles@host:~$ runon centos8
(centos8) gilles@host:~$ cat /etc/os-release
NAME="CentOS Linux"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS Linux 8"
(centos8) gilles@host:~$ id
uid=1000(gilles) gid=1000(gilles) groups=1000(gilles)
(centos8) gilles@host:~$ sudo id
[sudo] password for gilles:
uid=0(root) gid=0(root) groups=0(root)
(centos8) gilles@host:~$ xclock
(centos8) gilles@host:~$ exit


Configuration is done in runon.conf file, which describes supported distribution in .INI format.

Example config

environment =

binds =

dockerfile =
    FROM centos:8
    RUN yum install dnf-plugins-core -y
    RUN yum config-manager --set-enabled powertools -y
    RUN yum install sudo -y
    RUN echo "Defaults lecture = never" >> /etc/sudoers
    RUN echo "ALL ALL=(ALL) ALL" >> /etc/sudoers
pkginstall = RUN yum install {} -y
packages = ksh csh xterm xorg-x11-apps xkeyboard-config git

dockerfile =
    FROM debian:9
    RUN apt-get update
    RUN apt-get -y install sudo
    RUN echo "Defaults lecture = never" >> /etc/sudoers
pkginstall = RUN apt-get -y install {}
packages = ksh csh xterm x11-apps libgtk-3-0 build-essential git

Each section [osname] defines a distribution which can be used by runon. The [DEFAULT] section defines default values which is used if not overriden in individual section.

Config entries

  • dockerfile the base content of dockerfile which will be used to generate the running environment. There is usually no need to diverge from the ones given in example.

  • pkginstall the dockerfile command used to install a package, likely to be standard for all deb and rpm based distributions. In the command {} is replaced by the package name.

  • packages the list of packages to install. Feel free to add the ones you need for your commands (likely news system libs, new tools, ...)

  • binds the list of files and directories from the host system to expose in the container system. you might want to add /opt or other shared directories. See below for a description of binds entries

  • environment the list of environment variables you want to pass or set in the container system. See below for a description

Lines starting with # or ; are comments.

Some substitution happens upon reading the configuration:

  • ${user} the current username
  • ${osname} the executed distribution.


Each binds line can have one of the following formats:



  • <hostpath> is the filename or the dirname of the path you want to expose
  • <containerpath> is the pathname inside the container, by default it's the same path.
  • <mode> can be rw, read-write (by default), or ro, read-only.


Each environment line define a Environment Variable which is set in the container upon execution.

Each line can have one of the following formats:


If no value is given, the host value is passed into the container.