LinuxCommandLibrary

distrobox-enter

Enter a created Distrobox container

TLDR

Enter a Distrobox container

$ distrobox-enter [container_name]
copy

Enter a Distrobox container and run a command at login
$ distrobox-enter [container_name] -- [sh -l]
copy

Enter a Distrobox container without instantiating a tty
$ distrobox-enter [[-n|--name]] [container_name] -- [uptime --pretty]
copy

SYNOPSIS

distrobox-enter [OPTIONS] CONTAINER [SHELL]

PARAMETERS

-n, --name <CONTAINER>
    Name of the container to use (if not specified, one will be guessed from current directory)

-r, --root
    Launch container manager rootful (requires root privileges)

-v, --verbose
    Show more output

-q, --quiet
    Less output

-h, --help
    Show the help message and exit

-V, --version
    Show the version of the tool

--extra-flags <extra-flags>
    Extra flags to pass to the container manager (e.g., secrets)

--wrapper <wrapper>
    Custom wrapper script to execute before entering

--pre-init-hooks <hooks>
    File with pre-init hooks, one per line

--post-init-hooks <hooks>
    File with post-init hooks, one per line

DESCRIPTION

Distrobox is a lightweight tool for running any Linux distribution inside containers managed by Podman, Docker, or compatible managers. It provides near-native integration by bind-mounting host directories like $HOME, /tmp, /usr/bin, and sharing display/audio devices.

distrobox-enter launches an interactive shell (or specified command) inside an existing Distrobox container. It automatically starts the container if stopped, sets up environment variables ($DISPLAY, $XDG_RUNTIME_DIR, $WAYLAND_DISPLAY, etc.), and merges host $PATH with container paths. Applications launched from the container appear and function as if native on the host, without manual exports.

This is ideal for developers needing distro-specific tools (e.g., Fedora's dnf in an Ubuntu host) without system pollution or VMs. Usage example: distrobox-enter myfedora drops into a shell; distrobox-enter myfedora -- nvim runs host-integrated nvim. Container name can be auto-detected from current directory.

CAVEATS

Container must exist (create with distrobox-create). Requires Podman/Docker. Rootful mode needs sudo. Host integration assumes compatible distro/container manager.

HOST INTEGRATION

Automatically binds $HOME, /etc/profile.d, devices (/dev/dri for GPU), shares user namespaces for seamless apps.

SHELL/COMMAND

Defaults to container's login shell; specify alternative like /bin/zsh or full command (e.g., htop). Use -- to disambiguate.

HISTORY

Distrobox created by Luca Wehr (89luca89) in 2021 as a user-friendly container wrapper, inspired by toolbox. distrobox-enter core since v1.0; evolved with better GPU/Wayland support in v1.4+ and rootless enhancements.

SEE ALSO

Copied to clipboard