---
name: "dbus-run-session"
section: "1"
platform: "linux"
package: "dbus"
version: "1.16.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dbus-run-session"
---

# dbus-run-session(1)

start a process as a new D-Bus session

## NAME

dbus-run-session - start a process as a new D-Bus session

## SYNOPSIS

**dbus-run-session** \[--config-file *FILENAME*\] \[--dbus-daemon *BINARY*\] \[--\] *PROGRAM* \[*ARGUMENTS*...\]

**dbus-run-session** --help

**dbus-run-session** --version

## DESCRIPTION

**dbus-run-session** is used to start a session bus instance of **dbus-daemon** from a shell script, and start a specified program in that session. The **dbus-daemon** will run for as long as the program does, after which it will terminate.

One use is to run a shell with its own **dbus-daemon** in a text‐mode or SSH session, and have the **dbus-daemon** terminate automatically on leaving the sub‐shell, like this:

dbus-run-session -- bash

or to replace the login shell altogether, by combining **dbus-run-session** with the **exec** builtin:

exec dbus-run-session -- bash

Another use is to run regression tests and similar things in an isolated D-Bus session, to avoid either interfering with the "real" D-Bus session or relying on there already being a D-Bus session active, for instance:

dbus-run-session -- make check

or (in [**automake**(1)](/automake/1.md)):

```
  AM_TESTS_ENVIRONMENT = export MY_DEBUG=all;
  LOG_COMPILER = dbus-run-session
  AM_LOG_FLAGS = --
```

## OPTIONS

- **--config-file=***FILENAME*, **--config-file** *FILENAME*

  Pass **--config-file=***FILENAME* to the bus daemon, instead of passing it the **--session** argument. See [**dbus-daemon**(1)](/dbus-daemon/1.md).

- **--dbus-daemon=***BINARY*, **--dbus-daemon** *BINARY*

  Run *BINARY* as [**dbus-daemon**(1)](/dbus-daemon/1.md), instead of searching the **PATH** in the usual way for an executable called **dbus-daemon**.

- **--help**

  Print usage information and exit.

- **--version**

  Print the version of dbus-run-session and exit.

## EXIT STATUS

**dbus-run-session** exits with the exit status of *PROGRAM*, 0 if the **--help** or **--version** options were used, 127 on an error within **dbus-run-session** itself, or 128+*n* if the *PROGRAM* was killed by signal *n*.

## ENVIRONMENT

**PATH** is searched to find *PROGRAM*, and (if the --dbus-daemon option is not used or its argument does not contain a **/** character) to find **dbus-daemon**.

The session bus' address is made available to *PROGRAM* in the environment variable **DBUS\_SESSION\_BUS\_ADDRESS**.

The variables **DBUS\_SESSION\_BUS\_PID**, **DBUS\_SESSION\_BUS\_WINDOWID**, **DBUS\_STARTER\_BUS\_TYPE** and **DBUS\_STARTER\_ADDRESS** are removed from the environment, if present.

## BUGS

Please send bug reports to the D-Bus mailing list or bug tracker, see **https://www.freedesktop.org/wiki/Software/dbus/**

## AUTHOR

See **https://dbus.freedesktop.org/doc/AUTHORS**

## SEE ALSO

[**dbus-daemon**(1)](/dbus-daemon/1.md), [**dbus-launch**(1)](/dbus-launch/1.md)
