[neon/backports-noble/distrobox-noble/Neon/unstable] /: New upstream version 1.3.1
Michel Alexandre Salim
null at kde.org
Tue Sep 3 08:26:59 BST 2024
Git commit 64d30bd21f6cabdb53bde03a86e77439398c7917 by Michel Alexandre Salim.
Committed on 13/06/2022 at 17:41.
Pushed by carlosdem into branch 'Neon/unstable'.
New upstream version 1.3.1
M +3 -2 .github/ISSUE_TEMPLATE/bug_report.md
M +35 -3 .github/workflows/compatibility.yml
A +70 -0 .github/workflows/manpages.yml
M +40 -8 CONTRIBUTING.md
M +3 -12 distrobox
M +117 -64 distrobox-create
M +160 -86 distrobox-enter
M +108 -73 distrobox-export
A +143 -0 distrobox-host-exec
M +261 -65 distrobox-init
M +44 -20 distrobox-list
M +26 -10 distrobox-rm
M +27 -11 distrobox-stop
M +47 -13 docs/README.md
M +25 -26 docs/compatibility.md
M +15 -6 docs/distrobox_custom.md
M +9 -2 docs/featured_articles.md
M +38 -5 docs/posts/execute_commands_on_host.md
M +19 -5 docs/posts/run_latest_gnome_kde_on_distrobox.md
M +21 -13 docs/usage/distrobox-create.md
M +10 -1 docs/usage/distrobox-enter.md
A +28 -0 docs/usage/distrobox-host-exec.md
M +1 -0 docs/usage/distrobox-init.md
M +11 -0 docs/usage/distrobox-list.md
M +12 -0 docs/usage/distrobox-rm.md
M +18 -3 docs/usage/distrobox-stop.md
M +83 -17 docs/useful_tips.md
M +15 -8 install
M +25 -13 man/gen-man
M +303 -160 man/man1/distrobox-compatibility.1
M +149 -97 man/man1/distrobox-create.1
M +82 -43 man/man1/distrobox-enter.1
M +146 -92 man/man1/distrobox-export.1
A +60 -0 man/man1/distrobox-host-exec.1
M +55 -33 man/man1/distrobox-init.1
M +56 -21 man/man1/distrobox-list.1
M +57 -23 man/man1/distrobox-rm.1
M +61 -23 man/man1/distrobox-stop.1
M +990 -513 man/man1/distrobox.1
M +2 -2 uninstall
https://invent.kde.org/neon/backports-noble/distrobox-noble/-/commit/64d30bd21f6cabdb53bde03a86e77439398c7917
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 8543612..155614e 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -21,8 +21,9 @@ Run the commands with `--verbose` and post the log here as a file upload
Attach also the output of `podman logs` or `docker logs`, possibly with `--latest` flag
**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
- - Version [e.g. 22]
+ - Are you using podman or docker?
+ - Which version or podman or docker?
+ - Which version of distrobox?
**Additional context**
Add any other context about the problem here.
diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml
index e848200..51db8be 100644
--- a/.github/workflows/compatibility.yml
+++ b/.github/workflows/compatibility.yml
@@ -10,17 +10,49 @@ on:
branches: [main]
pull_request:
branches: [main]
- types: [opened, synchronize, ready_for_review, edited]
+ types: [opened, synchronize, ready_for_review, edited, labeled]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
-
-# Prepare distros matrix
+ inputs:
+ run_always:
+ description: 'Run even if no files are changed'
+ required: true
+ type: boolean
+# Check if we indeed modified distrobox stuff
jobs:
+ check_changes:
+ runs-on: ubuntu-latest
+ if: >-
+ contains( github.event.pull_request.labels.*.name, 'CI') ||
+ github.ref == 'refs/heads/main'
+ outputs:
+ distrobox_changed: ${{ steps.check_file_changed.outputs.distrobox_changed }}
+ steps:
+
+ - uses: actions/checkout at v2
+ with:
+ # Checkout as many commits as needed for the diff
+ fetch-depth: 2
+
+ # Fetch from compatibility table all the distros supported
+ - id: check_file_changed
+ run: |
+ if git diff --name-only HEAD^ HEAD | grep -E "^distrobox|compatibility.md"; then
+ echo "::set-output name=distrobox_changed::True"
+ else
+ echo "::set-output name=distrobox_changed::False"
+ fi
+
+ # Prepare distros matrix
setup:
runs-on: ubuntu-latest
+ needs: check_changes
outputs:
targets: ${{ steps.set-matrix.outputs.targets }}
+ if: >-
+ needs.check_changes.outputs.distrobox_changed == 'True' ||
+ github.event.inputs.run_always == 'True'
steps:
- uses: actions/checkout at v2
diff --git a/.github/workflows/manpages.yml b/.github/workflows/manpages.yml
new file mode 100644
index 0000000..684a93c
--- /dev/null
+++ b/.github/workflows/manpages.yml
@@ -0,0 +1,70 @@
+---
+# This is a basic workflow to help you get started with Actions
+
+name: Docs
+
+# Controls when the workflow will run
+on:
+ # Triggers the workflow on push or pull request events but only for the master branch
+ push:
+ branches: [main]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+
+ # Check changes, cancel job is not.
+ check_changes:
+ runs-on: ubuntu-latest
+ outputs:
+ distrobox_changed: ${{ steps.check_file_changed.outputs.distrobox_changed }}
+ steps:
+
+ - uses: actions/checkout at v2
+ with:
+ # Checkout as many commits as needed for the diff
+ fetch-depth: 2
+ token: ${{ secrets.PAT }}
+
+ # Fetch from compatibility table all the distros supported
+ - id: check_file_changed
+ run: |
+ if git diff --name-only HEAD^ HEAD | grep -E "^docs|gen-man"; then
+ echo "::set-output name=distrobox_changed::True"
+ else
+ echo "::set-output name=distrobox_changed::False"
+ fi
+
+ gen_man:
+ runs-on: ubuntu-latest
+ needs: check_changes
+ if: needs.check_changes.outputs.distrobox_changed == 'True'
+ steps:
+
+ - uses: actions/checkout at v2
+ with:
+ token: ${{ secrets.PAT }}
+
+ # Fetch from compatibility table all the distros supported
+ - id: generate
+ run: |
+ RELEASE=$(curl -L https://github.com/jgm/pandoc/releases/latest | grep href | grep pandoc | grep download | grep deb | grep amd64 | tail -1 | cut -d'"' -f2)
+ NAME=$(echo $RELEASE | rev | cut -d'/' -f1 | rev)
+
+ curl -L https://github.com/$RELEASE -o $NAME
+ sudo apt-get install -y ./$NAME
+ sudo apt-get install -y ronn
+
+ rm -f $NAME
+
+ man/gen-man
+
+ - uses: stefanzweifel/git-auto-commit-action at v4
+ with:
+ branch: main
+ commit_message: Automatic Man Page Update
+ commit_options: '--no-verify --signoff'
+ commit_user_name: distrobox-docs-bot
+ commit_user_email: distrobox-docs-bot at users.noreply.github.com
+ commit_author: distrobox-docs-bot <actions at github.com>
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 36a0e75..260cd5b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,7 +10,7 @@ as easy and transparent as possible, whether it's:
## Creating a Pull Requests
-Pull requests are the best way to propose changes to the codebase
+Pull requests are the best way to propose changes to the codebase.
We actively welcome your pull requests:
1. Fork the repo and create your branch from `main`.
@@ -31,16 +31,16 @@ Feel free to contact the maintainers if that's a concern.
Suggestions are welcome, be sure:
-- it is not already being discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
+- It is not already being discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
- If it has and is marked as OPEN, go ahead and share your own
thoughts about the topic!
- If it has and is marked as CLOSED, please read the ticket and depending on
- whether the suggestion was accepted or not consider if it is worth opening
+ whether the suggestion was accepted consider if it is worth opening
a new issue or not.
- Consider if the suggestion is not too out of scope of the project.
-- Mark them with a [Suggestion] in the title
+- Mark them with a [Suggestion] in the title.
-## Report bugs using Github's [issues](https://github.com/89luca89/distrobox/issues)
+## Report bugs using GitHub's [issues](https://github.com/89luca89/distrobox/issues)
We use GitHub issues to track public bugs.
Report a bug by
@@ -65,17 +65,49 @@ Report a bug by
## Use a Consistent Coding Style
+- check if files have some problems with POSIX using the following:
+
+```shell
+for file in $(find . -type f -not -path "*.git*"); do
+ if file "$file" | grep -qi shell; then
+ echo "### Checking file $file..."
+ dash -n $file
+ result=$(( result + $? ))
+ fi
+done
+```
+
+ Here we're using `dash` to verify if there are any non-POSIX code inside the
+ scripts. Distrobox aims to be POSIX compliant so it's important to use a
+ strict POSIX compliant shell to verify. `dash` is available in all major distributions'
+ repositories.
+
- use `shellcheck` to check for posix compliance and bashisms using:
- - `shellcheck -s sh -o all -Cnever -Sstyle -a -f gcc -x`
- install from: [HERE](https://github.com/koalaman/shellcheck)
following [this](https://github.com/koalaman/shellcheck#installing)
+ - `shellcheck -s sh -a -o all -Sstyle -Calways -x -e SC2310,SC2311,SC2312`
- use `shfmt` to style the code using:
- - `shfmt -s`
- install from [HERE](https://github.com/mvdan/sh) using `go install mvdan.cc/sh/v3/cmd/shfmt at latest`
+ - `shfmt -d -s -ci -sr -kp`
+- use `bashate` to check the code:
+ - install using `pip3 install bashate`
+ - `bashate -i E002,E003,E010,E011 --max-line-length 12`
+- use `markdownlint`
+ - install using `npm -i -g markdownlint-cli`
+ - run `markdownlint $(find . -name '*.md' | grep -vF './.git')`
- Legibility of the code is more important than code golfing, try to be
expressive in the code
+- Try to **follow the happy path**:
+ - [This guide](https://maelvls.dev/go-happy-line-of-sight/) is for golang,
+ but it's a very insightful source to follow
- Error checking is important! Ensure to LBYL (Look Before You Leap), check for
variables and for code success exit codes
+- If a command or function can fail, ensure you check the outcome:
+ - `if ! my_function; then ...`
+ this is important to handle errors gracefully and to potentially warn users
+ of what's happening
+- Use snake_case for variable naming. Keep variable names lowercase if they are
+ not an environment variable
- Don't hesitate to comment your code! We're placing high importance on this to
maintain the code readable and understandeable
- Update documentation to reflect your changes - Manual pages can be found in
@@ -95,4 +127,4 @@ its GPLv3 License.
## References
This document was adapted from the open-source contribution guidelines
-for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
+for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md).
diff --git a/distrobox b/distrobox
index 96c9ee3..5cbb6de 100755
--- a/distrobox
+++ b/distrobox
@@ -24,17 +24,7 @@ set -o nounset
trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
-# Dont' run this command as sudo.
-if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
- exit 1
-fi
-
-version="1.2.15"
+version="1.3.1"
# Print usage to stdout.
# Arguments:
@@ -51,6 +41,7 @@ Choose one of the available commands:
list
stop
rm
+ version
EOF
}
@@ -81,7 +72,7 @@ case "${distrobox_command}" in
rm)
"${distrobox_path}"/distrobox-rm "$@"
;;
- -V | --version)
+ -V | --version | version)
printf "distrobox: %s\n" "${version}"
exit 0
;;
diff --git a/distrobox-create b/distrobox-create
index a85be9d..b0bb0e9 100755
--- a/distrobox-create
+++ b/distrobox-create
@@ -23,6 +23,7 @@
# HOME
# USER
# Optional env variables:
+# DBX_CONTAINER_ALWAYS_PULL
# DBX_CONTAINER_CUSTOM_HOME
# DBX_CONTAINER_IMAGE
# DBX_CONTAINER_MANAGER
@@ -33,22 +34,22 @@ trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ printf >&2 "Running %s as sudo is not supported.\n" "$(basename "${0}")"
+ printf >&2 " try instead running:\n"
+ printf >&2 " %s --root %s\n" "$(basename "${0}")" "$*"
exit 1
fi
# Defaults
+container_always_pull=0
container_clone=""
container_image=""
-container_image_default="registry.fedoraproject.org/fedora-toolbox:35"
+container_image_default="registry.fedoraproject.org/fedora-toolbox:36"
container_init_hook=""
container_manager="autodetect"
container_manager_additional_flags=""
container_name=""
+container_pre_init_hook=""
container_user_custom_home=""
container_user_gid="$(id -rg)"
container_user_home="${HOME:-"/"}"
@@ -61,14 +62,17 @@ non_interactive=0
# management.
distrobox_entrypoint_path="$(cd "$(dirname "${0}")" && pwd)/distrobox-init"
distrobox_export_path="$(cd "$(dirname "${0}")" && pwd)/distrobox-export"
+distrobox_hostexec_path="$(cd "$(dirname "${0}")" && pwd)/distrobox-host-exec"
# In case init or export are not in the same path as create, let's search
# in PATH for them.
[ ! -e "${distrobox_entrypoint_path}" ] && distrobox_entrypoint_path="$(command -v distrobox-init)"
[ ! -e "${distrobox_export_path}" ] && distrobox_export_path="$(command -v distrobox-export)"
+[ ! -e "${distrobox_hostexec_path}" ] && distrobox_hostexec_path="$(command -v distrobox-hostexec)"
dryrun=0
init=0
+rootful=0
verbose=0
-version="1.2.15"
+version="1.3.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -83,6 +87,11 @@ for config_file in ${config_files}; do
# shellcheck disable=SC1090
[ -e "${config_file}" ] && . "${config_file}"
done
+# Fixup non_interactive=[true|false], in case we find it in the config file(s)
+[ "${non_interactive}" = "true" ] && non_interactive=1
+[ "${non_interactive}" = "false" ] && non_interactive=0
+
+[ -n "${DBX_CONTAINER_ALWAYS_PULL}" ] && container_always_pull="${DBX_CONTAINER_ALWAYS_PULL}"
[ -n "${DBX_CONTAINER_CUSTOM_HOME}" ] && container_user_custom_home="${DBX_CONTAINER_CUSTOM_HOME}"
[ -n "${DBX_CONTAINER_IMAGE}" ] && container_image="${DBX_CONTAINER_IMAGE}"
[ -n "${DBX_CONTAINER_MANAGER}" ] && container_manager="${DBX_CONTAINER_MANAGER}"
@@ -100,21 +109,25 @@ distrobox version: ${version}
Usage:
- distrobox-create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
- distrobox-create --clone fedora-toolbox-35 --name fedora-toolbox-35-copy
- distrobox-create --image alpine my-alpine-container
- distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
- distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
distrobox create --image alpine:latest --name test --init-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
- distrobox create -i docker.io/almalinux/8-init --init --name test
+ distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
+ distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
+ distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
+ distrobox create --clone fedora-35 --name fedora-35-copy
+ distrobox create --image alpine my-alpine-container
+ distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
+ distrobox create --pull --image centos:stream9 --home ~/distrobox/centos9
DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test-alpine DBX_CONTAINER_IMAGE=alpine distrobox-create
Options:
- --image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:35
- --name/-n: name for the distrobox default: fedora-toolbox-35
- --yes/-Y: non-interactive, pull images without asking
+ --image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:36
+ --name/-n: name for the distrobox default: my-distrobox
+ --pull/-p: pull the image even if it exists locally (implies --yes)
+ --yes/-Y: non-interactive, pull images without asking
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--clone/-c: name of the distrobox container to use as base for a new container
this will be useful to either rename an existing distrobox or have multiple copies
of the same environment.
@@ -122,6 +135,7 @@ Options:
--volume additional volumes to add to the container
--additional-flags/-a: additional flags to pass to the container manager command
--init-hooks additional commands to execute during container initialization
+ --pre-init-hooks additional commands to execute prior to container initialization
--init/-I use init system (like systemd) inside the container.
this will make host's processes not visible from within the container.
--help/-h: show this message
@@ -157,6 +171,10 @@ while :; do
shift
dryrun=1
;;
+ -r | --root)
+ shift
+ rootful=1
+ ;;
-I | --init)
shift
init=1
@@ -189,6 +207,10 @@ while :; do
shift
fi
;;
+ -p | --pull)
+ container_always_pull=1
+ shift
+ ;;
-Y | --yes)
non_interactive=1
shift
@@ -214,10 +236,22 @@ while :; do
shift
fi
;;
+ --pre-init-hooks)
+ if [ -n "$2" ]; then
+ container_pre_init_hook="--pre-init-hooks \"${2}\""
+ shift
+ shift
+ fi
+ ;;
--) # End of all options.
shift
break
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
# If we have a flagless option and container_name is not specified
# then let's accept argument as container_name
@@ -238,18 +272,20 @@ if [ "${verbose}" -ne 0 ]; then
set -o xtrace
fi
-# We cannot have both a clone AND an image name.
-if [ -n "${container_clone}" ] && [ -n "${container_image}" ]; then
- printf >&2 "Error: Invalid arguments, choose only one between clone or image name.\n"
- exit 2
-fi
-
# If no clone option and no container image, let's choose a default image to use.
# Fedora toolbox is a sensitive default
if [ -z "${container_clone}" ] && [ -z "${container_image}" ]; then
container_image="${container_image_default}"
fi
+# If no name is specified and we're using the default container_image, then let's
+# set a default name for the container, that is distinguishable from the default
+# toolbx one. This will avoid problems when using both toolbx and distrobox on
+# the same system.
+if [ -z "${container_name}" ] && [ "${container_image}" = "${container_image_default}" ]; then
+ container_name="my-distrobox"
+fi
+
# If no container_name is declared, we build our container name starting from the
# container image specified.
#
@@ -270,8 +306,6 @@ case "${container_manager}" in
container_manager="podman"
elif command -v docker > /dev/null; then
container_manager="docker"
- else
- container_manager="not_found"
fi
;;
podman)
@@ -283,28 +317,30 @@ case "${container_manager}" in
*)
printf >&2 "Invalid input %s.\n" "${container_manager}"
printf >&2 "The available choices are: 'autodetect', 'podman', 'docker'\n"
- container_manager="not_found"
;;
esac
# Be sure we have a container manager to work with.
-if ! command -v "${container_manager}" > /dev/null; then
+if ! command -v "${container_manager}" > /dev/null && [ "${dryrun}" -eq 0 ]; then
# Error: we need at least one between docker or podman.
- if [ "${dryrun}" -eq 0 ]; then
- printf >&2 "Missing dependency: we need a container manager.\n"
- printf >&2 "Please install one of podman or docker.\n"
- printf >&2 "You can follow the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\n"
- printf >&2 "or:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
- exit 127
- fi
+ printf >&2 "Missing dependency: we need a container manager.\n"
+ printf >&2 "Please install one of podman or docker.\n"
+ printf >&2 "You can follow the documentation on:\n"
+ printf >&2 "\tman distrobox-compatibility\n"
+ printf >&2 "or:\n"
+ printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ exit 127
fi
# add verbose if -v is specified
if [ "${verbose}" -ne 0 ]; then
container_manager="${container_manager} --log-level debug"
fi
+# prepend sudo if we want podman or docker to be rootful
+if [ "${rootful}" -ne 0 ]; then
+ container_manager="sudo ${container_manager}"
+fi
+
# Clone a container as a snapshot.
# Arguments:
# None
@@ -377,12 +413,15 @@ generate_command() {
# This grants access to external devices like usb webcams, disks and so on.
#
# Mount also the distrobox-init utility as the container entrypoint.
+ # Also mount in the container the distrobox-export and distrobox-host-exec
+ # utilities.
result_command="${result_command}
--env \"SHELL=${SHELL:-"/bin/bash"}\"
--env \"HOME=${container_user_home}\"
--volume \"${container_user_home}\":\"${container_user_home}\":rslave
--volume \"${distrobox_entrypoint_path}\":/usr/bin/entrypoint:ro
--volume \"${distrobox_export_path}\":/usr/bin/distrobox-export:ro
+ --volume \"${distrobox_hostexec_path}\":/usr/bin/distrobox-host-exec:ro
--volume /:/run/host:rslave
--volume /dev:/dev:rslave
--volume /sys:/sys:rslave
@@ -407,10 +446,8 @@ generate_command() {
# This works around this using an unnamed volume so that this path will be
# mounted with a normal non-overlay FS, allowing ACLs and preventing errors.
#
- # This work around works in conjunction with:
- # - distrobox-init:488-489
- # - distrobox-init:463-464
- # - distrobox-init:498-503
+ # This work around works in conjunction with distrobox-init's package manager
+ # setups.
# So that we can use pre/post hooks for package managers to present to the
# systemd install script a blank path to work with, and mount the host's
# journal path afterwards.
@@ -466,29 +503,30 @@ generate_command() {
#
# We're doing this now instead of inside the init because some distros will
# have symlinks places for these files that use absolute paths instead of
- # relative paths. Those symlinks will result broken inside the container so
- # we need to resolve them now on the host.
- host_links="/etc/host.conf /etc/hosts /etc/resolv.conf /etc/localtime"
- for host_link in ${host_links}; do
- # Check if the file exists first
- if [ -f "${host_link}" ] && [ -r "${host_link}" ]; then
- result_command="${result_command}
- --volume \"$(realpath "${host_link}")\":\"${host_link}\":ro"
- fi
- done
+ # relative paths.
+ # This is the bare minimum to ensure connectivity inside the container.
+ # These files, will then be kept updated by the main loop every 15 seconds.
+ result_command="${result_command}
+ --volume /etc/hosts:/etc/hosts:ro
+ --volume /etc/localtime:/etc/localtime:ro
+ --volume /etc/resolv.conf:/etc/resolv.conf:ro"
# These flags are not supported by docker, so we use them only if our
# container manager is podman.
if [ -z "${container_manager#*podman*}" ]; then
result_command="${result_command}
- --userns keep-id
- --ulimit host
- --annotation run.oci.keep_original_groups=1
- --mount type=devpts,destination=/dev/pts"
+ --ulimit host
+ --annotation run.oci.keep_original_groups=1
+ --mount type=devpts,destination=/dev/pts"
if [ "${init}" -eq 1 ]; then
result_command="${result_command}
--systemd=always"
fi
+ # Use keep-id only if going rootless.
+ if [ "${rootful}" -eq 0 ]; then
+ result_command="${result_command}
+ --userns keep-id"
+ fi
fi
# Add additional flags
@@ -501,6 +539,7 @@ generate_command() {
--group ${container_user_gid}
--home \"${container_user_custom_home:-"${container_user_home}"}\"
--init \"${init}\"
+ ${container_pre_init_hook}
-- '${container_init_hook}'
"
# use container_user_custom_home if defined, else fallback to normal home.
@@ -531,8 +570,12 @@ fi
# If it does, notify the user and exit.
if ${container_manager} inspect --type container "${container_name}" > /dev/null 2>&1; then
printf "Distrobox named '%s' already exists.\n" "${container_name}"
- printf "To enter, run:\n"
- printf "\tdistrobox-enter --name %s\n" "${container_name}"
+ printf "To enter, run:\n\n"
+ if [ "${rootful}" -ne 0 ]; then
+ printf "distrobox-enter --root %s\n\n" "${container_name}"
+ else
+ printf "distrobox-enter %s\n\n" "${container_name}"
+ fi
exit 0
fi
@@ -541,17 +584,20 @@ fi
if [ -n "${container_clone}" ]; then
container_image="$(clone_container)"
fi
-# First, check if the image exists in the host.
+# First, check if the image exists in the host or auto-pull is enabled
# If not prompt to download it.
-if ! ${container_manager} inspect --type image "${container_image}" > /dev/null 2>&1; then
- if [ "${non_interactive}" -eq 0 ]; then
+if [ "${container_always_pull}" -eq 1 ] ||
+ ! ${container_manager} inspect --type image "${container_image}" > /dev/null 2>&1; then
+
+ # If we do auto-pull, don't ask questions
+ if [ "${non_interactive}" -eq 1 ] || [ "${container_always_pull}" -eq 1 ]; then
+ response="yes"
+ else
# Prompt to download it.
printf >&2 "Image %s not found.\n" "${container_image}"
printf >&2 "Do you want to pull the image now? [Y/n]: "
read -r response
response="${response:-"Y"}"
- else
- response="yes"
fi
# Accept only y,Y,Yes,yes,n,N,No,no.
@@ -574,11 +620,18 @@ if ! ${container_manager} inspect --type image "${container_image}" > /dev/null
fi
# Generate the create command and run it
+printf "Creating '%s' using image %s\t" "${container_name}" "${container_image}"
cmd="$(generate_command)"
# Eval the generated command. If successful display an helpful message.
# shellcheck disable=SC2086
-if eval ${cmd}; then
- printf "Distrobox '%s' successfully created.\n" "${container_name}"
- printf "To enter, run:\n"
- printf "\tdistrobox-enter %s\n" "${container_name}"
+if eval ${cmd} > /dev/null; then
+ printf >&2 "\033[32m [ OK ]\n\033[0mDistrobox '%s' successfully created.\n" "${container_name}"
+ printf "To enter, run:\n\n"
+ if [ "${rootful}" -ne 0 ]; then
+ printf "distrobox enter --root %s\n\n" "${container_name}"
+ else
+ printf "distrobox enter %s\n\n" "${container_name}"
+ fi
+ exit 0
fi
+printf >&2 "\033[31m [ ERR ]\n\033[0m"
diff --git a/distrobox-enter b/distrobox-enter
index 69e0adb..138446c 100755
--- a/distrobox-enter
+++ b/distrobox-enter
@@ -24,18 +24,17 @@
# USER
# SHELL
# Optional env variables:
-# DBX_CONTAINER_NAME
# DBX_CONTAINER_MANAGER
+# DBX_CONTAINER_NAME
+# DBX_SKIP_WORKDIR
-trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
+trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n" && rm -f "/tmp/.*.fifo"' EXIT
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ printf >&2 "Running %s as sudo is not supported.\n" "$(basename "${0}")"
+ printf >&2 " try instead running:\n"
+ printf >&2 " %s --root %s\n" "$(basename "${0}")" "$*"
exit 1
fi
@@ -45,10 +44,13 @@ container_shell="${SHELL:-"bash"}"
# Work around for shells that are not in the container's file system, nor PATH.
# For example in hosts that do not follow FHS, like NixOS or for shells in custom
# exotic paths.
-container_shell="$(basename "${container_shell}")l"
+container_shell="$(basename "${container_shell}") -l"
+container_image=""
+container_image_default="registry.fedoraproject.org/fedora-toolbox:36"
container_manager="autodetect"
-container_name="fedora-toolbox-35"
+container_name="my-distrobox"
container_manager_additional_flags=""
+non_interactive=0
# Use cd + dirname + pwd so that we do not have relative paths in mount points
# We're not using "realpath" here so that symlinks are not resolved this way
@@ -57,8 +59,10 @@ container_manager_additional_flags=""
distrobox_enter_path="$(cd "$(dirname "$0")" && pwd)/distrobox-enter"
dryrun=0
headless=0
+rootful=0
+skip_workdir=0
verbose=0
-version="1.2.15"
+version="1.3.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -73,8 +77,15 @@ for config_file in ${config_files}; do
# shellcheck disable=SC1090
[ -e "${config_file}" ] && . "${config_file}"
done
+# Fixup non_interactive=[true|false], in case we find it in the config file(s)
+[ "${non_interactive}" = "true" ] && non_interactive=1
+[ "${non_interactive}" = "false" ] && non_interactive=0
+
+[ -n "${DBX_CONTAINER_IMAGE}" ] && container_image="${DBX_CONTAINER_IMAGE}"
[ -n "${DBX_CONTAINER_MANAGER}" ] && container_manager="${DBX_CONTAINER_MANAGER}"
[ -n "${DBX_CONTAINER_NAME}" ] && container_name="${DBX_CONTAINER_NAME}"
+[ -n "${DBX_SKIP_WORKDIR}" ] && skip_workdir="${DBX_SKIP_WORKDIR}"
+[ -n "${DBX_NON_INTERACTIVE}" ] && non_interactive="${DBX_NON_INTERACTIVE}"
# Print usage to stdout.
# Arguments:
@@ -87,7 +98,7 @@ distrobox version: ${version}
Usage:
- distrobox-enter --name fedora-toolbox-35 -- bash -l
+ distrobox-enter --name fedora-35 -- bash -l
distrobox-enter my-alpine-container -- sh -l
distrobox-enter --additional-flags "--preserve-fds" --name test -- bash -l
distrobox-enter --additional-flags "--env MY_VAR=value" --name test -- bash -l
@@ -95,11 +106,14 @@ Usage:
Options:
- --name/-n: name for the distrobox default: fedora-toolbox-35
+ --name/-n: name for the distrobox default: my-distrobox
--/-e: end arguments execute the rest as command to execute at login default: bash -l
--no-tty/-T: do not instantiate a tty
+ --no-workdir/-nw: always start the container from container's home directory
--additional-flags/-a: additional flags to pass to the container manager command
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--dry-run/-d: only print the container manager command generated
--verbose/-v: show more verbosity
--version/-V: show version
@@ -122,6 +136,10 @@ while :; do
shift
headless=1
;;
+ -r | --root)
+ shift
+ rootful=1
+ ;;
-V | --version)
printf "distrobox: %s\n" "${version}"
exit 0
@@ -130,6 +148,10 @@ while :; do
shift
dryrun=1
;;
+ -nw | --no-workdir)
+ shift
+ skip_workdir=1
+ ;;
-n | --name)
if [ -n "$2" ]; then
container_name="$2"
@@ -144,11 +166,20 @@ while :; do
shift
fi
;;
+ -Y | --yes)
+ non_interactive=1
+ shift
+ ;;
-e | --exec | --)
shift
container_command=$*
break
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
# If we have a flagless option and container_name is not specified
# then let's accept argument as container_name
@@ -177,8 +208,6 @@ case "${container_manager}" in
container_manager="podman"
elif command -v docker > /dev/null; then
container_manager="docker"
- else
- container_manager="not_found"
fi
;;
podman)
@@ -190,22 +219,19 @@ case "${container_manager}" in
*)
printf >&2 "Invalid input %s.\n" "${container_manager}"
printf >&2 "The available choices are: 'autodetect', 'podman', 'docker'\n"
- container_manager="not_found"
;;
esac
# Be sure we have a container manager to work with.
-if ! command -v "${container_manager}" > /dev/null; then
+if ! command -v "${container_manager}" > /dev/null && [ "${dryrun}" -eq 0 ]; then
# Error: we need at least one between docker or podman.
- if [ "${dryrun}" -eq 0 ]; then
- printf >&2 "Missing dependency: we need a container manager.\n"
- printf >&2 "Please install one of podman or docker.\n"
- printf >&2 "You can follow the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\n"
- printf >&2 "or:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
- exit 127
- fi
+ printf >&2 "Missing dependency: we need a container manager.\n"
+ printf >&2 "Please install one of podman or docker.\n"
+ printf >&2 "You can follow the documentation on:\n"
+ printf >&2 "\tman distrobox-compatibility\n"
+ printf >&2 "or:\n"
+ printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ exit 127
fi
# Small performance optimization, using podman socket shaves
# about half the time to access informations.
@@ -215,6 +241,7 @@ fi
# This is not necessary on docker as it is already handled
# in this way.
if [ -z "${container_manager#*podman*}" ] &&
+ [ "${rootful}" -eq 0 ] &&
[ -S "/run/user/$(id -ru)/podman/podman.sock" ] &&
systemctl --user status podman.socket > /dev/null; then
@@ -225,6 +252,11 @@ if [ "${verbose}" -ne 0 ]; then
container_manager="${container_manager} --log-level debug"
fi
+# prepend sudo if we want podman or docker to be rootful
+if [ "${rootful}" -ne 0 ]; then
+ container_manager="sudo ${container_manager}"
+fi
+
# Generate Podman or Docker command to execute.
# Arguments:
# None
@@ -239,7 +271,7 @@ generate_command() {
# For some usage, like use in service, or launched by non-terminal
# eg. from desktop files, TTY can fail to instantiate, and fail to enter
# the container.
- # To work around this, --headless let's you skip these 2 flags and make it
+ # To work around this, --headless let's you skip the --tty flag and make it
# work in tty-less situations.
# Disable tty also if we're NOT in a tty (test -t 0).
if [ "${headless}" -eq 0 ] && [ -t 0 ]; then
@@ -255,14 +287,18 @@ generate_command() {
# Since user $HOME is very likely present in container, enter there directly
# to avoid confusing the user about shifted paths.
# pass distrobox-enter path, it will be used in the distrobox-export tool.
- workdir="$(echo "${PWD:-${HOME:-"/"}}" | sed -e 's/"/\\\"/g')"
- if [ -n "${workdir##*"${HOME}"*}" ]; then
- workdir="/run/host/${workdir}"
+ if [ "${skip_workdir}" -eq 0 ]; then
+ workdir="$(echo "${PWD:-${container_home:-"/"}}" | sed -e 's/"/\\\"/g')"
+ if [ -n "${workdir##*"${container_home}"*}" ]; then
+ workdir="/run/host/${workdir}"
+ fi
+ else
+ # Skipping workdir we just enter $HOME of the container.
+ workdir="${container_home}"
fi
result_command="${result_command}
--workdir=\"${workdir}\"
--env=\"DISTROBOX_ENTER_PATH=${distrobox_enter_path}\""
-
# Loop through all the environment vars
# and export them to the container.
set +o xtrace
@@ -287,10 +323,7 @@ generate_command() {
fi
done
# Ensure the $PATH entries from the host are appended as well
- for standard_path in $(
- IFS=:
- for p in ${PATH}; do echo "${p}"; done
- ); do
+ for standard_path in $(echo "${PATH}" | tr ':' ' '); do
if [ -n "${container_paths##*:"${standard_path}"*}" ]; then
container_paths="${container_paths}:${standard_path}"
fi
@@ -334,6 +367,7 @@ generate_command() {
printf "%s" "${result_command}"
}
+container_home="${HOME}"
container_path="${PATH}"
# dry run mode, just generate the command and print it. No execution.
if [ "${dryrun}" -ne 0 ]; then
@@ -343,22 +377,53 @@ if [ "${dryrun}" -ne 0 ]; then
exit 0
fi
-# Inspect the container we're working with.
+# Now inspect the container we're working with.
container_status="unknown"
eval "$(${container_manager} inspect --type container "${container_name}" --format \
'container_status={{.State.Status}};
- {{range .Config.Env}}{{if slice . 0 6 | eq "SHELL="}}container_shell={{slice . 6 | printf "%q"}}{{end}}{{end}};
+ {{range .Config.Env}}{{if slice . 0 5 | eq "HOME="}}container_home={{slice . 5 | printf "%q"}};{{end}}{{end}}
+ {{range .Config.Env}}{{if slice . 0 6 | eq "SHELL="}}container_shell={{slice . 6 | printf "%q"}};{{end}}{{end}}
{{range .Config.Env}}{{if slice . 0 5 | eq "PATH="}}container_path={{slice . 5 | printf "%q"}}{{end}}{{end}}')"
-container_exists="$?"
# Set SHELL as a login shell
-container_shell="${container_shell} -l"
-# Does the container exists? check if inspect reported errors
-if [ "${container_exists}" -gt 0 ]; then
+container_shell="$(basename "${container_shell}") -l"
+
+# Check if the container is even there
+if [ "${container_status}" = "unknown" ]; then
# If not, prompt to create it first
- printf >&2 "Cannot find container %s, does it exist?\n" "${container_name}"
- printf >&2 "\nTry running first:\n"
- printf >&2 "\tdistrobox-create <name-of-container> --image <remote>/<docker>:<tag>\n"
- exit 1
+ printf >&2 "Cannot find container %s\n" "${container_name}"
+ if [ -z "${container_image}" ]; then
+ container_image="${container_image_default}"
+ fi
+ # If we're not-interactive, just don't ask questions
+ if [ "${non_interactive}" -eq 1 ]; then
+ response="yes"
+ else
+ printf >&2 "Create it now, out of image %s? [Y/n]: " "${container_image}"
+ read -r response
+ response="${response:-"Y"}"
+ fi
+
+ # Accept only y,Y,Yes,yes,n,N,No,no.
+ case "${response}" in
+ y | Y | Yes | yes | YES)
+ # Ok, let's create the container with just 'distrobox create $container_name
+ printf >&2 "Creating the container with command:\n"
+ printf >&2 " distrobox create -i %s %s\n" "${container_image}" "${container_name}"
+ if [ "${dryrun}" -ne 1 ]; then
+ "$(dirname "${0}")"/distrobox-create -i "${container_image}" -n "${container_name}"
+ fi
+ ;;
+ n | N | No | no | NO)
+ printf >&2 "Ok. For creating it, run this command:\n"
+ printf >&2 "\tdistrobox create <name-of-container> --image <remote>/<docker>:<tag>\n"
+ exit 0
+ ;;
+ *) # Default case: If no more options then break out of the loop.
+ printf >&2 "Invalid input.\n"
+ printf >&2 "The available choices are: y,Y,Yes,yes,YES or n,N,No,no,NO.\nExiting.\n"
+ exit 1
+ ;;
+ esac
fi
# If the container is not already running, we need to start if first
@@ -366,52 +431,61 @@ if [ "${container_status}" != "running" ]; then
# If container is not running, start it first
# Here, we save the timestamp before launching the start command, so we can
# be sure we're working with this very same session of logs later.
- log_timestamp="$(date +%FT%T.%N%:z)"
- ${container_manager} start "${container_name}" > /dev/null
+ printf >&2 "Container %s is not running.\n" "${container_name}"
printf >&2 "Starting container %s\n" "${container_name}"
- printf >&2 "run this command to follow along:\n"
- printf >&2 "\t%s logs -f %s\n" "${container_manager}" "${container_name}"
-
- # Wait for container to start successfully.
- # We will probe the container logs every 1s to check if we have either:
- # Error or container_setup_done
- #
- # In the end, print eventual Warnings that occurred.
- while :; do
-
- # Check if the container is going in error status at any time during the first init
- if [ "$(${container_manager} inspect \
- --type container "${container_name}" \
- --format "{{.State.Status}}")" != "running" ]; then
-
- container_manager_log="$(${container_manager} logs "${container_name}")"
- printf >&2 "%s\n" "${container_manager_log}"
- exit 1
- fi
+ printf >&2 "run this command to follow along:\n\n"
+ printf >&2 " %s logs -f %s\n\n" "${container_manager}" "${container_name}"
- container_manager_log="$(${container_manager} logs -t \
- --since "${log_timestamp}" \
- "${container_name}" 2> /dev/null)"
- case "${container_manager_log}" in
- *"Error"*)
- printf >&2 "%s\n" "${container_manager_log}"
- exit 1
- ;;
- *"container_setup_done"*)
- break
- ;;
- *)
- printf >&2 "."
- sleep 1
- ;;
- esac
+ log_timestamp="$(date +%FT%T.%N%:z)"
+ ${container_manager} start "${container_name}" > /dev/null
+ # Check if the container is going in error status earlier than the
+ # entrypoint
+ if [ "$(${container_manager} inspect \
+ --type container "${container_name}" \
+ --format "{{.State.Status}}")" != "running" ]; then
+
+ printf >&2 "\033[31m Error: could not start entrypoint.\n\033[0m"
+ container_manager_log="$(${container_manager} logs \
+ --since "${log_timestamp}" "${container_name}")"
+ printf >&2 "%s\n" "${container_manager_log}"
+ exit 1
+ fi
+
+ printf >&2 "%-40s\t" " Starting container..."
+ while true; do
+ # save starting loop timestamp in temp variable, we'll use it
+ # after to let logs command minimize possible holes
+ log_timestamp_new="$(date +%FT%T.%N%:z)"
+ ${container_manager} logs --since "${log_timestamp}" "${container_name}" 2> /dev/null > "/tmp/.${container_name}.fifo"
+ # read logs from log_timestamp to now, line by line
+ while IFS= read -r line; do
+ case "${line}" in
+ *"Error"*)
+ printf >&2 "\033[31m %s\n\033[0m" "${line}"
+ exit 1
+ ;;
+ *"Warning"*)
+ printf >&2 "\n\033[33m %s\033[0m" "${line}"
+ ;;
+ *"distrobox:"*)
+ printf >&2 "\033[32m [ OK ]\n\033[0m%-40s\t" "$(echo "${line}" | cut -d':' -f2-)"
+ ;;
+ *"container_setup_done"*)
+ printf >&2 "\033[32m [ OK ]\n\033[0m"
+ break 2
+ ;;
+ *) ;;
+ esac
+ done < "/tmp/.${container_name}.fifo"
+
+ # Register new timestamp where to start logs from.
+ log_timestamp="${log_timestamp_new}"
+ sleep 1
done
- printf >&2 "\ndone!\n"
- # Print eventual warnings in the log.
- ${container_manager} logs -t \
- --since "${log_timestamp}" \
- "${container_name}" 2> /dev/null | grep "Warning" >&2 || :
+ # cleanup fifo
+ rm -f "/tmp/.${container_name}.fifo"
+ printf >&2 "\nContainer Setup Complete!\n"
fi
# Generate the exec command and run it
diff --git a/distrobox-export b/distrobox-export
index 05cd1c0..5ecf168 100755
--- a/distrobox-export
+++ b/distrobox-export
@@ -28,6 +28,7 @@
trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
# Defaults
+dest_path=""
export_action=""
exported_app=""
exported_app_label=""
@@ -40,8 +41,9 @@ extra_flags=""
# with custom --home directory
host_home="${DISTROBOX_HOST_HOME:-"${HOME}"}"
is_sudo=""
+rootful=""
verbose=0
-version="1.2.15"
+version="1.3.1"
# We depend on some commands, let's be sure we have them
base_dependencies="basename grep sed find"
@@ -153,6 +155,11 @@ while :; do
exported_delete=1
shift
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
break ;;
esac
@@ -165,12 +172,17 @@ if [ "${verbose}" -ne 0 ]; then
set -o xtrace
fi
-# Check we're running inside a container and not on the host
+# Check we're running inside a container and not on the host.
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
printf >&2 "You must run %s inside a container!\n" " $(basename "$0")"
exit 126
fi
+# Check if we're in a rootful or rootless container.
+if grep -q "rootless=0" /run/.containerenv 2> /dev/null; then
+ rootful="--root"
+fi
+
# We're working with HOME, so we must run as USER, not as root.
if [ "$(id -u)" -eq 0 ]; then
printf >&2 "You must not run %s as root!\n" " $(basename "$0")"
@@ -205,7 +217,7 @@ fi
# We can assume this as we set it the same as container name during creation.
container_name=$(uname -n | cut -d'.' -f1)
# Prefix to add to an existing command to work throught the container
-container_command_prefix="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} -n ${container_name} -- \"${is_sudo} "
+container_command_prefix="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- '${is_sudo} "
if [ -z "${exported_app_label}" ]; then
exported_app_label=" (on ${container_name})"
fi
@@ -220,8 +232,8 @@ generate_script() {
#!/bin/sh
# distrobox_binary
# name: ${container_name}
-if [ ! -f /run/.containerenv ]; then
- ${DISTROBOX_ENTER_PATH:-"distrobox-enter"} -n ${container_name} -- \
+if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
+ ${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- \
${is_sudo} ${exported_bin} ${extra_flags} \$@
else
${exported_bin} \$@
@@ -249,22 +261,14 @@ export_binary() {
dest_file="${dest_path}/$(basename "${exported_bin}")"
# If we're deleting it, just do it and exit
- if [ "${exported_delete}" -ne 0 ]; then
- if [ ! -f "${dest_file}" ]; then
- printf >&2 "Error: cannot find %s in %s.\nWas it exported?.\n" \
- "$(basename "${exported_bin}")" "${dest_path}"
- return 1
- fi
- if grep -q "distrobox_binary" "${dest_file}"; then
- if rm -f "${dest_file}"; then
- printf "%s from %s removed successfully from %s.\nOK!\n" \
- "${exported_bin}" "${container_name}" "${dest_path}"
- return 0
- fi
- else
- printf >&2 "Error: %s exists but it's not a distrobox exported file.\n" "${dest_file}"
- printf >&2 "Error: cannot delete: %s.\n" "${dest_file}"
- return 2
+ if [ "${exported_delete}" -ne 0 ] &&
+ # ensure it's a distrobox exported binary
+ grep -q "distrobox_binary" "${dest_file}"; then
+
+ if rm -f "${dest_file}"; then
+ printf "%s from %s removed successfully from %s.\nOK!\n" \
+ "${exported_bin}" "${container_name}" "${dest_path}"
+ return 0
fi
fi
@@ -282,7 +286,6 @@ export_binary() {
return 0
fi
# Unknown error.
- printf >&2 "A problem occurred.\n"
return 3
}
@@ -299,20 +302,13 @@ export_binary() {
# needed desktop files in /run/host/$host_home/.local/share/applications
# or error code.
export_application() {
- # Ensure the app we're exporting is installed
- if ! command -v "${exported_app}" > /dev/null; then
- printf >&2 "Error: trying to export a non-installed application.\n"
- return 127
- fi
# Find desktop file for the application to export
- desktop_files=$(grep -ril "${exported_app}" \
+ desktop_files=$(grep -ril "Exec=.*${exported_app}" \
/usr/share/applications/* \
/var/lib/flatpak/exports/share/applications/* 2> /dev/null || :)
- icon_files=$(find \
- /usr/share/icons \
- /usr/share/pixmaps \
- /var/lib/flatpak/exports/share/icons -iname "*${exported_app}*" 2> /dev/null || :)
+
+ # Ensure the app we're exporting is installed
# Check that we found some desktop files first.
if [ -z "${desktop_files}" ]; then
printf >&2 "Error: cannot find any desktop files.\n"
@@ -320,60 +316,102 @@ export_application() {
return 127
fi
+ # Find icons by usinc the Icon= specification. If it's only a name, we'll
+ # search for the file, if it's already a path, just grab it.
+ icon_files=""
+ for desktop_file in ${desktop_files}; do
+ icon_name="$(grep Icon= "${desktop_file}" | cut -d'=' -f2-)"
+
+ # In case it's an hard path, conserve it and continue
+ if [ -e "${icon_name}" ]; then
+ icon_files="${icon_files} ${icon_name}"
+ continue
+ fi
+
+ # If it's not an hard path, find all files in the canonical paths.
+ icon_files="${icon_files} $(find \
+ /usr/share/icons \
+ /usr/share/pixmaps \
+ /var/lib/flatpak/exports/share/icons -iname "*${icon_name}*" 2> /dev/null || :)"
+ done
+
# create applications dir if not existing
- if [ ! -d "/run/host/${host_home}/.local/share/applications" ]; then
- mkdir -p "/run/host/${host_home}/.local/share/applications"
- fi
+ mkdir -p "/run/host${host_home}/.local/share/applications"
# copy icons in home directory
+ icon_file_absolute_path=""
for icon_file in ${icon_files}; do
+ # replace canonical paths with equivalent paths in HOME
icon_home_directory="$(dirname "${icon_file}" |
sed "s|/usr/share/|\/run\/host\/${host_home}/.local/share/|g" |
sed "s|/var/lib/flatpak/exports/share|\/run\/host\/${host_home}/.local/share/|g" |
sed "s|pixmaps|icons|g")"
+ # check if we're exporting an icon which is not in a canonical path
+ if [ "${icon_home_directory}" = "$(dirname "${icon_file}")" ]; then
+ icon_home_directory="/run/host${host_home}/.local/share/icons/"
+ icon_file_absolute_path="${icon_home_directory}$(basename "${icon_file}")"
+ fi
+
# check if we're exporting or deleting
if [ "${exported_delete}" -ne 0 ]; then
# we need to remove, not export
rm -rf "${icon_home_directory:?}"/"$(basename "${icon_file:?}")"
- else
- # we wanto to export the application's icons
- mkdir -p "${icon_home_directory}"
- cp -r "${icon_file}" "${icon_home_directory}"
+ continue
fi
+
+ # we wanto to export the application's icons
+ mkdir -p "${icon_home_directory}"
+ cp -r "${icon_file}" "${icon_home_directory}"
done
# create desktop files for the distrobox
for desktop_file in ${desktop_files}; do
desktop_original_file="$(basename "${desktop_file}")"
desktop_home_file="${container_name}-$(basename "${desktop_file}")"
+
# check if we're exporting or deleting
if [ "${exported_delete}" -ne 0 ]; then
- if [ ! -f "/run/host/${host_home}/.local/share/applications/${desktop_home_file}" ]; then
- printf >&2 "Error: trying to remove a non-exported application.\n"
- return 1
- fi
- rm -f "/run/host/${host_home}/.local/share/applications/${desktop_original_file}"
- rm -f "/run/host/${host_home}/.local/share/applications/${desktop_home_file}"
- else
- # Add commmand_prefix
- # Add extra flags
- # Add closing quote
- # If a TryExec is present, we have to fake it as it will not work
- # throught the container separation
- sed "s|^Exec=|Exec=${container_command_prefix} |g" "${desktop_file}" |
- sed "s|\(%.*\)|${extra_flags} \1|g" |
- sed 's|^Exec=.*|&"|g' |
- sed "s|^TryExec=.*|TryExec=true|g" |
- sed "s|Name.*|& ${exported_app_label}|g" \
- > "/run/host/${host_home}/.local/share/applications/${desktop_home_file}"
- if ! grep -q "StartupWMClass" "/run/host/${host_home}/.local/share/applications/${desktop_home_file}"; then
- printf "StartupWMClass=%s\n" "${exported_app}" >> \
- "/run/host/${host_home}/.local/share/applications/${desktop_home_file}"
- fi
- # in the end we add the final quote we've opened in the "container_command_prefix"
+ rm -f "/run/host${host_home}/.local/share/applications/${desktop_original_file}"
+ rm -f "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
+ # we're done, go to next
+ continue
+ fi
+
+ # Add commmand_prefix
+ # Add extra flags
+ # Add closing quote
+ # If a TryExec is present, we have to fake it as it will not work
+ # throught the container separation
+ sed "s|^Exec=|Exec=${container_command_prefix} |g" "${desktop_file}" |
+ sed "s|\(%.*\)|${extra_flags} \1|g" |
+ sed "s|^Exec=.*|&'|g" |
+ sed "/^TryExec=.*/d" |
+ sed "/^DBusActivatable=true/d" |
+ sed "s|Name.*|& ${exported_app_label}|g" \
+ > "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
+ # in the end we add the final quote we've opened in the "container_command_prefix"
+
+ if ! grep -q "StartupWMClass" "/run/host${host_home}/.local/share/applications/${desktop_home_file}"; then
+ printf "StartupWMClass=%s\n" "${exported_app}" >> \
+ "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
fi
+ # In case of an icon in a non canonical path, we need to replace the path
+ # in the desktop file.
+ if [ -n "${icon_file_absolute_path}" ]; then
+ sed -i "s|Icon=.*|Icon=${icon_file_absolute_path}|g" \
+ "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
+ # we're done, go to next
+ continue
+ fi
+
+ # In case of an icon in a canonical path, but specified as an absolute
+ # we need to replace the path in the desktop file.
+ sed -i "s|Icon=/usr/share/|Icon=/run/host${host_home}/.local/share/|g" \
+ "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
+ sed -i "s|pixmaps|icons|g" \
+ "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
done
if [ "${exported_delete}" -ne 0 ]; then
@@ -402,6 +440,7 @@ export_service() {
/etc/systemd/system/ /lib/systemd/system/ /usr/lib/systemd/system/ \
"${host_home}"/.config/systemd/user/ \
-type f -name "${exported_service}*" 2> /dev/null | tail -1)
+
# Check that we found some service files first.
if [ -z "${service_file}" ]; then
printf >&2 "Error: cannot find any service file for %s.\n" "${exported_service}"
@@ -411,18 +450,15 @@ export_service() {
# this is the output file we will produce.
exported_service_file="${container_name}-$(basename "${service_file}")"
- exported_service_fullpath="/run/host/${host_home}/.config/systemd/user/${exported_service_file}"
+ exported_service_fullpath="/run/host${host_home}/.config/systemd/user/${exported_service_file}"
# If we're deleting it, just do it and exit
if [ "${exported_delete}" -ne 0 ]; then
- if [ ! -f "${exported_service_fullpath}" ]; then
- printf >&2 "Error: cannot find service %s.\nWas it exported?.\n" "${exported_service_file}"
- return 1
- fi
rm -f "${exported_service_fullpath}"
printf "Service %s successfully removed.\nOK!\n" "${exported_service_file}"
return 0
fi
+
# Check if it is already exported
if [ -f "${exported_service_fullpath}" ] &&
grep -q "${container_command_prefix}" "${exported_service_fullpath}"; then
@@ -436,14 +472,13 @@ export_service() {
# Create temp file with random name
temp_file="$(mktemp -u)"
+ mkdir -p "/run/host${host_home}/.config/systemd/user/"
+
# Replace all Exec occurrencies
- if [ ! -d "/run/host/${host_home}/.config/systemd/user/" ]; then
- mkdir -p "/run/host/${host_home}/.config/systemd/user/"
- fi
- cat "${service_file}" > "${exported_service_fullpath}" 2> /dev/null
+ cp -f "${service_file}" "${exported_service_fullpath}"
for exec_cmd in ExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost; do
# Save to temp file
- cat "${exported_service_fullpath}" > "${temp_file}" 2> /dev/null
+ cp -f "${exported_service_fullpath}" "${temp_file}"
# Add prefix only if not present
if ! grep "${exec_cmd}" "${temp_file}" | grep -q "${container_command_prefix}"; then
# Add commmand_prefix
@@ -451,7 +486,7 @@ export_service() {
# Add closing quote
sed "s|^${exec_cmd}=|${exec_cmd}=${container_command_prefix}|g" "${temp_file}" |
sed "s|^${exec_cmd}=.*|& ${extra_flags}|g" |
- sed "s|^${exec_cmd}=.*|&\"|g" > "${exported_service_fullpath}"
+ sed "s|^${exec_cmd}=.*|&'|g" > "${exported_service_fullpath}"
# in the end we add the final quote we've opened in the "container_command_prefix"
fi
done
diff --git a/distrobox-host-exec b/distrobox-host-exec
new file mode 100755
index 0000000..2c208c8
--- /dev/null
+++ b/distrobox-host-exec
@@ -0,0 +1,143 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-3.0-only
+#
+# This file is part of the distrobox project:
+# https://github.com/89luca89/distrobox
+#
+# Copyright (C) 2022 distrobox contributors
+#
+# distrobox is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3
+# as published by the Free Software Foundation.
+#
+# distrobox is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with distrobox; if not, see <http://www.gnu.org/licenses/>.
+
+trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
+
+# Defaults
+distrobox_host_exec_default_command="/bin/sh"
+
+verbose=0
+version="1.3.1"
+
+# Print usage to stdout.
+# Arguments:
+# None
+# Outputs:
+# print usage with examples.
+show_help() {
+ cat << EOF
+distrobox version: ${version}
+
+Usage:
+
+ distrobox-host-exec [command [arguments]]
+ distrobox-host-exec ls
+ distrobox-host-exec bash -l
+ distrobox-host-exec flatpak run org.mozilla.firefox
+ distrobox-host-exec podman ps -a
+
+
+Options:
+
+ --help/-h: show this message
+ --verbose/-v: show more verbosity
+ --version/-V: show version
+EOF
+}
+
+# Parse arguments
+while :; do
+ case $1 in
+ -h | --help)
+ # Call a "show_help" function to display a synopsis, then exit.
+ show_help
+ exit 0
+ ;;
+ -v | --verbose)
+ verbose=1
+ shift
+ ;;
+ -V | --version)
+ printf "distrobox: %s\n" "${version}"
+ exit 0
+ ;;
+ --) # End of all options.
+ shift
+ ;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
+ *)
+ command=${distrobox_host_exec_default_command}
+ if [ -n "$1" ]; then
+ command=$1
+ shift
+ fi
+ break
+ ;;
+ esac
+done
+
+set -o errexit
+set -o nounset
+# set verbosity
+if [ "${verbose}" -ne 0 ]; then
+ set -o xtrace
+fi
+
+# Check we're running inside a container and not on the host
+if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
+ printf >&2 "You must run %s inside a container!\n" " $(basename "$0")"
+ exit 126
+fi
+
+mode=flatpak
+result_command="flatpak-spawn --host --forward-fd=1 --forward-fd=2 "
+
+if ! command -v flatpak-spawn > /dev/null; then
+ printf "WARNING: flatpak-spawn not found!\n"
+ printf "We recommend installing it and then trying distrobox-host-exec again.\n\n"
+ printf "Alternatively, we can try an different (chroot-based) approach, but please\n"
+ printf "be aware that it has severe limitations and some commands will not work!\n\n"
+ printf "Do you really want to continue without installing flatpak-spawn? [y/N] "
+ read -r response
+ response=${response:-"N"}
+
+ # Accept only y,Y,Yes,yes,n,N,No,no.
+ case "${response}" in
+ y | Y | Yes | yes | YES)
+ mode=chroot
+ result_command="sudo -E chroot --userspec=$(id -u):$(id -g) /run/host/ /usr/bin/env "
+ ;;
+ n | N | No | no | NO)
+ printf "Good choice! Go get flatpak-spawn.\n"
+ exit 0
+ ;;
+ *) # Default case: If no more options then break out of the loop.
+ printf >&2 "Invalid input.\n"
+ printf >&2 "The available choices are: y,Y,Yes,yes,YES or n,N,No,no,NO.\nExiting.\n"
+ exit 1
+ ;;
+ esac
+fi
+
+# Let's also pass back the environment
+for i in $(printenv | grep "=" | grep -Ev ' |"' | grep -Ev "^(_)"); do
+ if [ "${mode}" = "chroot" ]; then
+ result_command="${result_command} ${i}"
+ else
+ result_command="${result_command} --env=${i} "
+ fi
+done
+
+# Eval the generated command.
+exec ${result_command} sh -c " cd ${PWD} && ${command} $* "
diff --git a/distrobox-init b/distrobox-init
index 44ca87d..df431c9 100755
--- a/distrobox-init
+++ b/distrobox-init
@@ -29,8 +29,9 @@ trap '[ "$?" -ne 0 ] && printf "Error: An error occurred\n"' EXIT
# Defaults
init=0
init_hook=""
+pre_init_hook=""
verbose=0
-version="1.2.15"
+version="1.3.1"
# Print usage to stdout.
# Arguments:
# None
@@ -52,6 +53,7 @@ Options:
--home/-d: path/to/home of the user
--help/-h: show this message
--init/-I: whether to use or not init
+ --pre-init-hooks: commands to execute prior to init
--verbose/-v: show more verbosity
--version/-V: show version
--: end arguments execute the rest as command to execute during init
@@ -109,11 +111,23 @@ while :; do
shift
fi
;;
+ --pre-init-hooks)
+ if [ -n "$2" ]; then
+ pre_init_hook="$2"
+ shift
+ shift
+ fi
+ ;;
--)
shift
init_hook=$*
break
;;
+ -*) # Invalid options.
+ printf >&2 "Error: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
break ;;
esac
@@ -158,6 +172,10 @@ mount_bind() (
# if source dir doesn't exist, just exit normally
! [ -d "${source_dir}" ] && ! [ -f "${source_dir}" ] && return 0
+ # if target_dir exists, check if it is a mountpoint and umount it.
+ if [ -e "${target_dir}" ] && mountpoint "${target_dir}"; then
+ umount "${target_dir}"
+ fi
# if the source_dir exists, then create the target_dir
if [ -d "${source_dir}" ]; then
# exit if not successful
@@ -187,13 +205,28 @@ mount_bind() (
return 0
)
+if [ -n "${pre_init_hook}" ]; then
+ printf "distrobox: Executing pre-init hooks...\n"
+ # execute pre-init hooks if specified
+ # shellcheck disable=SC2086
+ eval ${pre_init_hook}
+fi
+
+printf "distrobox: Installing basic packages...\n"
# Extract shell name from the $SHELL environment variable
# If not present as package in the container, we want to install it.
shell_pkg="$(basename "${SHELL:-"bash"}")"
+# Ash shell is an exception, it is not a standalone package, but part of busybox.
+# for this reason, use this quirk to adjust the package name.
+if [ "${shell_pkg}" = "ash" ]; then
+ shell_pkg="busybox"
+fi
+
# Check if dependencies are met for the script to run.
if ! command -v find || ! command -v mount || ! command -v passwd ||
- ! command -v sudo || ! command -v useradd || ! command -v usermod ||
- ! ls /etc/profile.d/*vte* ||
+ ! command -v sudo || ! command -v useradd || ! command -v diff ||
+ ! command -v pinentry || ! command -v wget || ! command -v curl ||
+ ! command -v less || ! command -v bc ||
! command -v "${shell_pkg}"; then
# Detect the available package manager
@@ -211,15 +244,26 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
apk add \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
ncurses \
+ pinentry \
procps \
shadow \
sudo \
util-linux \
+ wget \
vte3
elif command -v apt-get; then
+ # In Ubuntu official images, dpkg is configured to ignore locale and docs
+ # This however, results in a rather poor out-of-the-box experience
+ # So, let's enable them.
+ rm -f /etc/dpkg/dpkg.cfg.d/excludes
+
export DEBIAN_FRONTEND=noninteractive
apt-get update
# Check if shell_pkg is available in distro's repo. If not we
@@ -231,16 +275,27 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
apt-get install -y \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
libnss-myhostname \
libvte-common \
ncurses-base \
passwd \
+ pinentry-curses \
procps \
sudo \
+ wget \
util-linux
elif command -v dnf; then
+ # In dnf family official images, dnf is configured to ignore locale and docs
+ # This however, results in a rather poor out-of-the-box experience
+ # So, let's enable them.
+ sed -i '/tsflags=nodocs/d' /etc/dnf/dnf.conf
+
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
@@ -248,20 +303,24 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
SHELL="/bin/bash"
shell_pkg="bash"
fi
- dnf install -y \
+ dnf install -y --allowerasing \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
ncurses \
passwd \
+ pinentry \
procps-ng \
shadow-utils \
sudo \
util-linux \
+ wget \
vte-profile
elif command -v emerge; then
- # update repos
- emerge --sync
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
@@ -269,17 +328,52 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
SHELL="/bin/bash"
shell_pkg="bash"
fi
- emerge --ask=n --autounmask-continue \
+ emerge --ask=n --autounmask-continue --quiet-build \
"${shell_pkg}" \
+ bc \
+ net-misc/curl \
+ diffutils \
findutils \
+ less \
ncurses \
+ pinentry \
procps \
shadow \
sudo \
util-linux \
- vte-profile
+ wget \
+ vte
+
+ elif command -v microdnf; then
+ # Check if shell_pkg is available in distro's repo. If not we
+ # fall back to bash, and we set the SHELL variable to bash so
+ # that it is set up correctly for the user.
+ if ! microdnf install -y "${shell_pkg}"; then
+ SHELL="/bin/bash"
+ shell_pkg="bash"
+ fi
+ microdnf install -y \
+ "${shell_pkg}" \
+ bc \
+ diffutils \
+ findutils \
+ less \
+ ncurses \
+ passwd \
+ pinentry \
+ procps \
+ shadow-utils \
+ sudo \
+ wget \
+ util-linux
+ # vte-profile
elif command -v pacman; then
+ # In archlinux official images, pacman is configured to ignore locale and docs
+ # This however, results in a rather poor out-of-the-box experience
+ # So, let's enable them.
+ sed -i "s|NoExtract.*||g" /etc/pacman.conf
+
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
@@ -290,12 +384,18 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
pacman -Sy --noconfirm \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
ncurses \
+ pinentry \
procps-ng \
shadow \
sudo \
util-linux \
+ wget \
vte-common
elif command -v slackpkg; then
@@ -309,22 +409,31 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
yes | slackpkg install -default_answer=yes -batch=yes \
"${shell_pkg}" \
- libvte-2 \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
+ libvte-2 \
ncurses \
+ pinentry \
procps \
shadow \
sudo \
+ wget \
util-linux
elif command -v swupd; then
# Here we do not handle shell_pkg as shells are already all bundled
# together in "shells"
swupd bundle-add \
+ bc \
+ cryptography \
+ curl \
+ procps-ng \
shells \
- sudo \
- findutils \
- procps-ng
+ sysadmin-basic \
+ wget
elif command -v xbps-install; then
# Check if shell_pkg is available in distro's repo. If not we
@@ -336,14 +445,24 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
xbps-install -Sy \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
ncurses-base \
procps-ng \
shadow \
sudo \
+ wget \
util-linux
elif command -v yum; then
+ # In yum family official images, yum is configured to ignore locale and docs
+ # This however, results in a rather poor out-of-the-box experience
+ # So, let's enable them.
+ sed -i '/tsflags=nodocs/d' /etc/yum.conf
+
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
@@ -353,33 +472,56 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
yum install -y \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
ncurses \
passwd \
+ pinentry \
procps \
shadow-utils \
sudo \
util-linux \
+ wget \
vte-profile
elif command -v zypper; then
- # Check if shell_pkg is available in distro's repo. If not we
- # fall back to bash, and we set the SHELL variable to bash so
- # that it is set up correctly for the user.
if ! zypper install -y "${shell_pkg}"; then
SHELL="/bin/bash"
shell_pkg="bash"
fi
zypper install -y \
"${shell_pkg}" \
+ bc \
+ curl \
+ diffutils \
findutils \
+ less \
libvte-2* \
ncurses \
+ pinentry \
procps \
shadow \
sudo \
+ systemd \
+ wget \
util-linux
-
+ # In openSUSE official images, zypper is configured to ignore recommended
+ # packages (i.e., weak dependencies). This however, results in a rather
+ # poor out-of-the-box experience (e.g., when trying to run GUI apps).
+ # So, let's enable them. For the same reason, we make sure we install
+ # docs.
+ sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = false/g' /etc/zypp/zypp.conf
+ sed -i 's/.*rpm.install.excludedocs.*/rpm.install.excludedocs = no/g' /etc/zypp/zypp.conf
+ # With recommended packages, something might try to pull in
+ # parallel-printer-support which can't be installed in rootless podman.
+ # Since we very much likely never need it, just lock it
+ zypper al parallel-printer-support
+ # Check if shell_pkg is available in distro's repo. If not we
+ # fall back to bash, and we set the SHELL variable to bash so
+ # that it is set up correctly for the user.
else
printf "Error: could not find a supported package manager.\n"
printf "Error: could not set up base dependencies.\n"
@@ -388,9 +530,10 @@ if ! command -v find || ! command -v mount || ! command -v passwd ||
fi
fi
+
+printf "distrobox: Setting up read-only mounts...\n"
# We'll also bind mount in READ-ONLY useful directories from the host
HOST_MOUNTS_RO="
- /etc/machine-id
/var/lib/flatpak
/var/lib/systemd/coredump
/var/log/journal"
@@ -398,9 +541,12 @@ for host_mount_ro in ${HOST_MOUNTS_RO}; do
mount_bind /run/host"${host_mount_ro}" "${host_mount_ro}" ro
done
+printf "distrobox: Setting up read-write mounts...\n"
# We'll also bind mount READ-WRITE useful mountpoints to pass external drives and libvirt from
# the host to the container
HOST_MOUNTS="
+ /etc/host.conf
+ /etc/machine-id
/media
/mnt
/run/libvirt
@@ -409,6 +555,8 @@ HOST_MOUNTS="
/run/systemd/seats
/run/systemd/sessions
/run/systemd/users
+ /run/systemd/resolve/
+ /run/netconfig/
/run/udev
/srv
/var/lib/libvirt
@@ -419,6 +567,25 @@ for host_mount in ${HOST_MOUNTS}; do
fi
done
+HOST_MOUNTS_RO_INIT="
+ /run/systemd/journal
+ /run/systemd/resolve
+ /run/systemd/seats
+ /run/systemd/sessions
+ /run/systemd/users
+ /var/lib/systemd/coredump
+ /var/log/journal"
+
+# On some ostree systems, home is in /var/home, but most of the software expects
+# it to be in /home. In the hosts systems this is fixed by using a symlink.
+# Do something similar here with a bind mount.
+if [ -e "/var/home/${container_user_name}" ] && [ ! -e "/home/${container_user_name}" ]; then
+ if ! mount_bind /run/host/var/home /home rw; then
+ printf "Warning: Cannot bind mount %s to /run/host%s\n" "/var/home" "/home"
+ fi
+fi
+
+printf "distrobox: Setting up host's sockets integration...\n"
# Find all the user's socket and mount them inside the container
# this will allow for continuity of functionality between host and container
#
@@ -429,6 +596,9 @@ host_sockets="$(find /run/host/run -name 'user' \
-prune -o -name 'system_bus_socket' \
-prune -o -type s -print \
2> /dev/null || :)"
+# we're excluding system dbus socket and nscd socket here. Including them will
+# create many problems with package managers thinking they have access to
+# system dbus or user auth cache misused.
for host_socket in ${host_sockets}; do
container_socket="$(printf "%s" "${host_socket}" | sed 's|/run/host||g')"
# Check if the socket already exists or the symlink already esists
@@ -442,6 +612,24 @@ for host_socket in ${host_sockets}; do
fi
done
+printf "distrobox: Integrating host's themes, icons, fonts...\n"
+# Themes and icons integration works using a bind mount inside the container
+# of the host's themes and icons directory. This ensures that the host's home will
+# not be littered with files and directories and broken symlinks.
+if ! mount_bind "/run/host/usr/share/themes" "/usr/local/share/themes" rw; then
+ printf "Warning: Cannot bind mount /run/host/usr/share/themes to /usr/local/share/themes\n"
+ printf "Warning: Themes integration with the host is disabled.\n"
+fi
+if ! mount_bind "/run/host/usr/share/icons" "/usr/local/share/icons" rw; then
+ printf "Warning: Cannot bind mount /run/host/usr/share/icons to /usr/local/share/icons\n"
+ printf "Warning: Icons integration with the host is disabled.\n"
+fi
+if ! mount_bind "/run/host/usr/share/fonts" "/usr/local/share/fonts" rw; then
+ printf "Warning: Cannot bind mount /run/host/usr/share/fonts to /usr/local/share/fonts\n"
+ printf "Warning: Fonts integration with the host is disabled.\n"
+fi
+
+printf "distrobox: Setting up package manager exceptions...\n"
# In case of an RPM distro, we can specify that our bind_mount directories
# are in fact net shares. This prevents conflicts during package installations.
if [ -d "/usr/lib/rpm/macros.d/" ]; then
@@ -487,10 +675,14 @@ if [ -d "/etc/dpkg/dpkg.cfg.d/" ]; then
# Also we put a hook to clear some critical paths that do not play well
# with read only filesystems, like systemd.
if [ -d "/etc/apt/apt.conf.d/" ]; then
- cat << EOF > /etc/apt/apt.conf.d/00_distrobox
-DPkg::Pre-Invoke {"if mountpoint /var/log/journal; then umount /var/log/journal; fi";};
-DPkg::Post-Invoke {"if [ -e /run/host/var/log/journal ]; then mount --rbind -o ro /run/host/var/log/journal /var/log/journal; fi";};
-EOF
+
+ printf "" > /etc/apt/apt.conf.d/00_distrobox
+ for init_mount in ${HOST_MOUNTS_RO_INIT}; do
+ printf 'DPkg::Pre-Invoke {"if mountpoint %s; then umount %s; fi";};\n' \
+ "${init_mount}" "${init_mount}" >> /etc/apt/apt.conf.d/00_distrobox
+ printf 'DPkg::Post-Invoke {"if [ -e /run/host/%s ]; then mount --rbind /run/host/%s %s; fi";};\n' \
+ "${init_mount}" "${init_mount}" "${init_mount}" >> /etc/apt/apt.conf.d/00_distrobox
+ done
fi
fi
@@ -561,6 +753,7 @@ EOF
fi
+printf "distrobox: Setting up sudo...\n"
mkdir -p /etc/sudoers.d
# Do not check fqdn when doing sudo, it will not work anyways
if ! grep -q 'Defaults !fqdn' /etc/sudoers.d/sudoers; then
@@ -571,6 +764,7 @@ if ! grep -q "${container_user_name} ALL = (root) NOPASSWD:ALL" /etc/sudoers.d/s
printf "%s ALL = (root) NOPASSWD:ALL\n" "${container_user_name}" >> /etc/sudoers.d/sudoers
fi
+printf "distrobox: Setting up groups...\n"
# If not existing, ensure we have a group for our user.
if ! grep -q "^${container_user_name}:" /etc/group; then
if ! groupadd --force --gid "${container_user_gid}" "${container_user_name}"; then
@@ -579,6 +773,8 @@ if ! grep -q "^${container_user_name}:" /etc/group; then
printf "%s:x:%s:" "${container_user_name}" "${container_user_gid}" >> /etc/group
fi
fi
+
+printf "distrobox: Setting up users...\n"
# Let's add our user to the container. if the user already exists, enforce properties.
if ! grep -q "^${container_user_name}:" /etc/passwd; then
if ! useradd \
@@ -623,6 +819,10 @@ printf "%s:" "${container_user_name}" | chpasswd -e
# If we do not have profile files in the home, we should copy the
# skeleton files, if present.
# Ensure we copy only if the dotfile is not already present.
+mkdir -p /etc/profile.d
+printf "test -z \"\$USER\" && USER=\"\$(id -un 2> /dev/null)\"\n" > /etc/profile.d/distrobox_profile.sh
+printf "test -z \"\$UID\" && readonly UID=\"\$(id -ur 2> /dev/null)\"\n" >> /etc/profile.d/distrobox_profile.sh
+printf "test -z \"\$EUID\" && readonly EUID=\"\$(id -u 2> /dev/null)\"\n" >> /etc/profile.d/distrobox_profile.sh
if [ -d "/etc/skel" ]; then
skel_files="$(find /etc/skel/ -type f || :)"
for skel_file in ${skel_files}; do
@@ -637,57 +837,53 @@ if [ -d "/etc/skel" ]; then
done
fi
-# Themes and icons integration works using a bind mount inside the container
-# of the host's themes and icons directory. This ensures that the host's home will
-# not be littered with files and directories and broken symlinks.
-#
-# bind mount distrobox directory for themes and icons
-mkdir -p "${container_user_home}/.local/share/themes"
-mkdir -p "${container_user_home}/.local/share/icons"
-mkdir -p "${container_user_home}/.local/share/fonts"
-# Fix permissions for home directories
-chown "${container_user_uid}":"${container_user_gid}" "${container_user_home}/.local"
-chown "${container_user_uid}":"${container_user_gid}" "${container_user_home}/.local/share"
-chown "${container_user_uid}":"${container_user_gid}" "${container_user_home}/.local/share/themes"
-chown "${container_user_uid}":"${container_user_gid}" "${container_user_home}/.local/share/icons"
-chown "${container_user_uid}":"${container_user_gid}" "${container_user_home}/.local/share/fonts"
-if ! mount_bind "/run/host/usr/share/themes" "${container_user_home}/.local/share/themes" rw; then
- printf "Warning: Cannot bind mount /run/host/usr/share/themes to %s/.local/share/themes\n" "${container_user_home}"
- printf "Warning: Themes integration with the host is disabled.\n"
-fi
-if ! mount_bind "/run/host/usr/share/icons" "${container_user_home}/.local/share/icons" rw; then
- printf "Warning: Cannot bind mount /run/host/usr/share/icons to %s/.local/share/icons\n" "${container_user_home}"
- printf "Warning: Icons integration with the host is disabled.\n"
-fi
-if ! mount_bind "/run/host/usr/share/fonts" "${container_user_home}/.local/share/fonts" rw; then
- printf "Warning: Cannot bind mount /run/host/usr/share/fonts to %s/.local/share/fonts\n" "${container_user_home}"
- printf "Warning: Fonts integration with the host is disabled.\n"
-fi
-
+printf "distrobox: Executing init hooks...\n"
# execute eventual init hooks if specified
# shellcheck disable=SC2086
eval ${init_hook}
printf "container_setup_done\n"
+# If init support is disabled, let's do our routine to keep the container
+# up, running and in sync with host.
if [ "${init}" -eq 0 ]; then
# Keepalive loop
- sleep infinity
-else
- # some of this directories are needed by
- # the init system. If they're mounts, there might
- # be problems. Let's unmount them.
- HOST_MOUNTS_RO_INIT="
- /run/systemd/journal
- /run/systemd/seats
- /run/systemd/sessions
- /run/systemd/system
- /run/systemd/users
- /var/lib/systemd/coredump
- /var/log/journal"
- for host_mount in ${HOST_MOUNTS_RO_INIT}; do
- if mountpoint "${host_mount}"; then umount "${host_mount}"; fi
+ HOST_WATCH="
+ /etc/hosts
+ /etc/localtime
+ /etc/resolv.conf
+ "
+ # disable verbose logging for this phase.
+ set +x
+ while true; do
+ # Let's check for changes every 15 seconds.
+ # This way we can dynamically keep hosts, dns and timezone setups
+ # in sync with host, without having permissions problems:
+ # - symlink will fail with "Device or Resource busy"
+ # - bindmount will need a container restart on changes
+ for file_watch in ${HOST_WATCH}; do
+ # do stuff, only if we need to.
+ if ! diff "${file_watch}" "/run/host${file_watch}" > /dev/null; then
+ # We only do this, if the file is a bind mount in the first place.
+ # This could be useful for init-hooks that involve umounting those
+ # files so that can be separated from the host.
+ mountpoint "${file_watch}" &&
+ umount "${file_watch}" &&
+ mount_bind "/run/host${file_watch}" "${file_watch}" rw
+ fi
+ done
+ sleep 15
done
- # Now we can launch init
- exec /sbin/init
fi
+
+# If we're here, the init support has been enabled.
+printf "distrobox: Setting up init system...\n"
+# some of this directories are needed by
+# the init system. If they're mounts, there might
+# be problems. Let's unmount them.
+for host_mount in ${HOST_MOUNTS_RO_INIT}; do
+ if mountpoint "${host_mount}"; then umount "${host_mount}"; fi
+done
+# Now we can launch init
+printf "distrobox: Firing up init system...\n"
+exec /sbin/init
diff --git a/distrobox-list b/distrobox-list
index 70bfa94..f62da97 100755
--- a/distrobox-list
+++ b/distrobox-list
@@ -24,17 +24,17 @@
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ printf >&2 "Running %s as sudo is not supported.\n" "$(basename "${0}")"
+ printf >&2 " try instead running:\n"
+ printf >&2 " %s --root %s\n" "$(basename "${0}")" "$*"
exit 1
fi
# Defaults
+rootful=0
+size=0
verbose=0
-version="1.2.15"
+version="1.3.1"
container_manager="autodetect"
# Source configuration files, this is done in an hierarchy so local files have
@@ -68,6 +68,8 @@ Usage:
Options:
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--verbose/-v: show more verbosity
--version/-V: show version
EOF
@@ -81,6 +83,14 @@ while :; do
show_help
exit 0
;;
+ -r | --root)
+ shift
+ rootful=1
+ ;;
+ -s | --size)
+ size=1
+ shift
+ ;;
-v | --verbose)
verbose=1
shift
@@ -93,6 +103,11 @@ while :; do
shift
break
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
break ;;
esac
@@ -113,8 +128,6 @@ case "${container_manager}" in
container_manager="podman"
elif command -v docker > /dev/null; then
container_manager="docker"
- else
- container_manager="not_found"
fi
;;
podman)
@@ -126,7 +139,6 @@ case "${container_manager}" in
*)
printf >&2 "Invalid input %s.\n" "${container_manager}"
printf >&2 "The available choices are: 'autodetect', 'podman', 'docker'\n"
- container_manager="not_found"
;;
esac
@@ -146,17 +158,27 @@ if [ "${verbose}" -ne 0 ]; then
container_manager="${container_manager} --log-level debug"
fi
+# prepend sudo if we want podman or docker to be rootful
+if [ "${rootful}" -ne 0 ]; then
+ container_manager="sudo ${container_manager}"
+fi
+
# List containers using custom format that inclused MOUNTS
# we do this as we can detect the custom mounts done by distrobox to distringuish
# between a normal podman or docker container and a distrobox one.
-container_list=$(${container_manager} ps -a --no-trunc --format \
- "{{.ID}}|{{.Image}}|{{.Names}}|{{.State}}|{{.Mounts}}")
+if [ "${size}" -ne 0 ]; then
+ container_list=$(${container_manager} ps -a --no-trunc --size --format \
+ "{{.ID}}|{{.Image}}|{{.Names}}|{{.State}}|{{.Mounts}}|{{.Size}}")
+ printf " %-12s | %-25s | %-30s | %-40s | %-30s\n" "ID" "NAME" "STATUS" "IMAGE" "SIZE"
+else
+ container_list=$(${container_manager} ps -a --no-trunc --format \
+ "{{.ID}}|{{.Image}}|{{.Names}}|{{.State}}|{{.Mounts}}")
+ printf " %-12s | %-25s | %-30s | %-30s\n" "ID" "NAME" "STATUS" "IMAGE"
+fi
IFS='
'
# Header of the output
-printf " %-12s | %-25s | %-30s | %-30s\n" "ID" "NAME" "STATUS" "IMAGE"
for container in ${container_list}; do
-
# Check if the current container has a custom mount point for distrobox.
if [ -z "${container##*distrobox*}" ]; then
@@ -165,15 +187,17 @@ for container in ${container_list}; do
container_image="$(printf "%s" "${container}" | cut -d'|' -f2)"
container_name="$(printf "%s" "${container}" | cut -d'|' -f3)"
container_status="$(printf "%s" "${container}" | cut -d'|' -f4)"
+ container_size="$(printf "%s" "${container}" | cut -d'|' -f6)"
- # If the container is Up and Running, print it in green
+ # If the container is Up and Running, print it in green and go next.
if [ -z "${container_status##*Up*}" ] || [ -z "${container_status##*running*}" ]; then
- printf "\033[32m %-12s | %-25s | %-30s | %-30s\n\033[0m" \
- "${container_id}" "${container_name}" "${container_status}" "${container_image}"
- # Else, print it in yellow
- else
- printf "\033[33m %-12s | %-25s | %-30s | %-30s\n\033[0m" \
- "${container_id}" "${container_name}" "${container_status}" "${container_image}"
+ printf "\033[32m %-12s | %-25s | %-30s | %-40s | %-30s\n\033[0m" \
+ "${container_id}" "${container_name}" "${container_status}" "${container_image}" "${container_size}"
+ continue
fi
+ # print it in yellow if not Running
+ printf "\033[33m %-12s | %-25s | %-30s | %-40s | %-30s\n\033[0m" \
+ "${container_id}" "${container_name}" "${container_status}" "${container_image}" "${container_size}"
+
fi
done
diff --git a/distrobox-rm b/distrobox-rm
index 5e88e8f..4d6b0a8 100755
--- a/distrobox-rm
+++ b/distrobox-rm
@@ -26,21 +26,20 @@
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ printf >&2 "Running %s as sudo is not supported.\n" "$(basename "${0}")"
+ printf >&2 " try instead running:\n"
+ printf >&2 " %s --root %s\n" "$(basename "${0}")" "$*"
exit 1
fi
# Defaults
container_manager="autodetect"
-container_name="fedora-toolbox-35"
+container_name="my-distrobox"
force=0
non_interactive=0
+rootful=0
verbose=0
-version="1.2.15"
+version="1.3.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -55,6 +54,10 @@ for config_file in ${config_files}; do
# shellcheck disable=SC1090
[ -e "${config_file}" ] && . "${config_file}"
done
+# Fixup non_interactive=[true|false], in case we find it in the config file(s)
+[ "${non_interactive}" = "true" ] && non_interactive=1
+[ "${non_interactive}" = "false" ] && non_interactive=0
+
[ -n "${DBX_CONTAINER_MANAGER}" ] && container_manager="${DBX_CONTAINER_MANAGER}"
[ -n "${DBX_CONTAINER_NAME}" ] && container_name="${DBX_CONTAINER_NAME}"
[ -n "${DBX_NON_INTERACTIVE}" ] && non_interactive="${DBX_NON_INTERACTIVE}"
@@ -77,6 +80,8 @@ Options:
--name/-n: name for the distrobox
--force/-f: force deletion
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--help/-h: show this message
--verbose/-v: show more verbosity
--version/-V: show version
@@ -91,6 +96,10 @@ while :; do
show_help
exit 0
;;
+ -r | --root)
+ shift
+ rootful=1
+ ;;
-v | --verbose)
verbose=1
shift
@@ -118,6 +127,11 @@ while :; do
shift
break
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
# If we have a flagless option and container_name is not specified
# then let's accept argument as container_name
@@ -146,8 +160,6 @@ case "${container_manager}" in
container_manager="podman"
elif command -v docker > /dev/null; then
container_manager="docker"
- else
- container_manager="not_found"
fi
;;
podman)
@@ -159,7 +171,6 @@ case "${container_manager}" in
*)
printf >&2 "Invalid input %s.\n" "${container_manager}"
printf >&2 "The available choices are: 'autodetect', 'podman', 'docker'\n"
- container_manager="not_found"
;;
esac
@@ -179,6 +190,11 @@ if [ "${verbose}" -ne 0 ]; then
container_manager="${container_manager} --log-level debug"
fi
+# prepend sudo if we want podman or docker to be rootful
+if [ "${rootful}" -ne 0 ]; then
+ container_manager="sudo ${container_manager}"
+fi
+
# Inspect the container we're working with.
container_status="$(${container_manager} inspect --type container \
"${container_name}" --format '{{.State.Status}}')"
diff --git a/distrobox-stop b/distrobox-stop
index e2f89ee..accfce0 100755
--- a/distrobox-stop
+++ b/distrobox-stop
@@ -26,20 +26,19 @@
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
- printf >&2 "Running %s as sudo is not supported.\n" "${0}"
- printf >&2 "Please check the documentation on:\n"
- printf >&2 "\tman distrobox-compatibility\t"
- printf >&2 "or consult the documentation page on:\n"
- printf >&2 "\thttps://github.com/89luca89/distrobox/blob/main/docs/compatibility.md\n"
+ printf >&2 "Running %s as sudo is not supported.\n" "$(basename "${0}")"
+ printf >&2 " try instead running:\n"
+ printf >&2 " %s --root %s\n" "$(basename "${0}")" "$*"
exit 1
fi
# Defaults
container_manager="autodetect"
-container_name="fedora-toolbox-35"
+container_name="my-distrobox"
non_interactive=0
+rootful=0
verbose=0
-version="1.2.15"
+version="1.3.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -54,6 +53,10 @@ for config_file in ${config_files}; do
# shellcheck disable=SC1090
[ -e "${config_file}" ] && . "${config_file}"
done
+# Fixup non_interactive=[true|false], in case we find it in the config file(s)
+[ "${non_interactive}" = "true" ] && non_interactive=1
+[ "${non_interactive}" = "false" ] && non_interactive=0
+
[ -n "${DBX_CONTAINER_MANAGER}" ] && container_manager="${DBX_CONTAINER_MANAGER}"
[ -n "${DBX_CONTAINER_NAME}" ] && container_name="${DBX_CONTAINER_NAME}"
[ -n "${DBX_NON_INTERACTIVE}" ] && non_interactive="${DBX_NON_INTERACTIVE}"
@@ -77,6 +80,8 @@ Options:
--name/-n: name for the distrobox
--yes/-Y: non-interactive, stop without asking
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--verbose/-v: show more verbosity
--version/-V: show version
EOF
@@ -90,6 +95,10 @@ while :; do
show_help
exit 0
;;
+ -r | --root)
+ shift
+ rootful=1
+ ;;
-v | --verbose)
verbose=1
shift
@@ -113,6 +122,11 @@ while :; do
shift
break
;;
+ -*) # Invalid options.
+ printf >&2 "ERROR: Invalid flag '%s'\n\n" "$1"
+ show_help
+ exit 1
+ ;;
*) # Default case: If no more options then break out of the loop.
# If we have a flagless option and container_name is not specified
# then let's accept argument as container_name
@@ -141,8 +155,6 @@ case "${container_manager}" in
container_manager="podman"
elif command -v docker > /dev/null; then
container_manager="docker"
- else
- container_manager="not_found"
fi
;;
podman)
@@ -154,7 +166,6 @@ case "${container_manager}" in
*)
printf >&2 "Invalid input %s.\n" "${container_manager}"
printf >&2 "The available choices are: 'autodetect', 'podman', 'docker'\n"
- container_manager="not_found"
;;
esac
@@ -174,6 +185,11 @@ if [ "${verbose}" -ne 0 ]; then
container_manager="${container_manager} --log-level debug"
fi
+# prepend sudo if we want podman or docker to be rootful
+if [ "${rootful}" -ne 0 ]; then
+ container_manager="sudo ${container_manager}"
+fi
+
# Inspect the container we're working with.
container_exists="$?"
# Does the container exist? check if inspect reported errors
@@ -183,7 +199,7 @@ if [ "${container_exists}" -gt 0 ]; then
fi
if [ "${non_interactive}" -eq 0 ]; then
- # Prompt to download it.
+ # Prompt to stop the container.
printf "Do you really want to stop %s? [Y/n]: " "${container_name}"
read -r response
response="${response:-"Y"}"
diff --git a/docs/README.md b/docs/README.md
index 3fa3f1a..df00785 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -22,6 +22,12 @@ graphical apps (X11/Wayland), and audio.
---
+[Documentation](https://distrobox.privatedns.org/#distrobox) -
+[Matrix Room](https://matrix.to/#/%23distrobox:matrix.org) -
+[Telegram Group](https://t.me/distrobox)
+
+---
+
![overview](https://user-images.githubusercontent.com/598882/144294862-f6684334-ccf4-4e5e-85f8-1d66210a0fff.png)
---
@@ -46,6 +52,7 @@ graphical apps (X11/Wayland), and audio.
- [distrobox-stop](usage/distrobox-stop.md)
- [Inside the distrobox](usage/usage.md#inside-the-distrobox)
- [distrobox-export](usage/distrobox-export.md)
+ - [distrobox-host-exec](usage/distrobox-host-exec.md)
- [distrobox-init](usage/distrobox-init.md)
- [Configure distrobox](#configure-distrobox)
- [Useful tips](useful_tips.md)
@@ -62,6 +69,7 @@ graphical apps (X11/Wayland), and audio.
- [Using docker inside a distrobox](useful_tips.md#using-docker-inside-a-distrobox)
- [Using init system inside a distrobox](useful_tips.md#using-init-system-inside-a-distrobox)
- [Using distrobox as main cli](useful_tips.md#using-distrobox-as-main-cli)
+ - [Using a different architecture](useful_tips.md#using-a-different-architecture)
- [Improve distrobox-enter performance](useful_tips.md#improve-distrobox-enter-performance)
- [Slow creation on podman and image size getting bigger with distrobox-create](useful_tips.md#slow-creation-on-podman-and-image-size-getting-bigger-with-distrobox-create)
- [Container save and restore](useful_tips.md#container-save-and-restore)
@@ -73,14 +81,18 @@ graphical apps (X11/Wayland), and audio.
- [Integrate VSCode and Distrobox](posts/integrate_vscode_distrobox.md)
- [Execute a command on the Host](posts/execute_commands_on_host.md)
- [Featured Articles](featured_articles.md)
- - [Run Distrobox on Fedora Linux - Fedora Magazine](https://fedoramagazine.org/run-distrobox-on-fedora-linux/)
- - [DistroBox – Run Any Linux Distribution Inside Linux Terminal - TecMint](https://www.tecmint.com/distrobox-run-any-linux-distribution/)
- - [Distrobox - How to quickly deploy a Linux distribution with GUI applications via a container](https://www.techrepublic.com/article/how-to-quickly-deploy-a-linux-distribution-with-gui-applications-via-a-container/)
- - [Using Distrobox To Augment The Package Selection On Clear Linux - Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Distrobox-Clear-Linux)
- - [Benchmark: benefits of Clear Linux containers (distrobox) - Phoronix](https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1305326-clear-linux-container-performance-continues-showing-sizable-gains)
- - [Distrobox - A great item in the Linux toolbelt - phmurphy's blog](https://phmurphy.com/posts/distrobox-toolbelt/)
- - [Running Other Linux Distros with Distrobox on Fedora Linux - bandithijo's blog](featured_articles.md)
- - [Day-to-day differences between Fedora Silverblue and Ubuntu - castrojo's blog](https://www.ypsidanger.com/day-to-day-advantages-of-fedora-silverblue/)
+ - [Articles](featured_articles.md#articles)
+ - [Run Distrobox on Fedora Linux - Fedora Magazine](https://fedoramagazine.org/run-distrobox-on-fedora-linux/)
+ - [DistroBox – Run Any Linux Distribution Inside Linux Terminal - TecMint](https://www.tecmint.com/distrobox-run-any-linux-distribution/)
+ - [Distrobox - How to quickly deploy a Linux distribution with GUI applications via a container](https://www.techrepublic.com/article/how-to-quickly-deploy-a-linux-distribution-with-gui-applications-via-a-container/)
+ - [Using Distrobox To Augment The Package Selection On Clear Linux - Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Distrobox-Clear-Linux)
+ - [Benchmark: benefits of Clear Linux containers (distrobox) - Phoronix](https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1305326-clear-linux-container-performance-continues-showing-sizable-gains)
+ - [Distrobox - A great item in the Linux toolbelt - phmurphy's blog](https://phmurphy.com/posts/distrobox-toolbelt/)
+ - [Running Other Linux Distros with Distrobox on Fedora Linux - bandithijo's blog](featured_articles.md)
+ - [Day-to-day differences between Fedora Silverblue and Ubuntu - castrojo's blog](https://www.ypsidanger.com/day-to-day-advantages-of-fedora-silverblue/)
+ - [Distrobox is Awesome - Running Window Manager and Desktop environments using Distrobox](https://cloudyday.tech.blog/2022/05/14/distrobox-is-awesome/)
+ - [Talks](featured_articles.md#talks)
+ - [Linux App Summit 2022 - Distrobox: Run Any App On Any Distro - BoF](https://github.com/89luca89/distrobox/files/8598433/distrobox-las-talk.pdf)
- [Podcasts](featured_articles.md#podcasts)
---
@@ -102,7 +114,7 @@ but in a simplified way using POSIX sh and aiming at broader compatibility.
All the props go to them as they had the great idea to implement this stuff.
-It is divided into 6 commands:
+It is divided into 8 commands:
- `distrobox-create` - creates the container
- `distrobox-enter` - to enter the container
@@ -112,10 +124,14 @@ It is divided into 6 commands:
- `distrobox-init` - the entrypoint of the container (not meant to be used manually)
- `distrobox-export` - it is meant to be used inside the container,
useful to export apps and services from the container to the host
+- `distrobox-host-exec` - to run commands/programs from the host, while inside
+ of the container
It also includes a little wrapper to launch commands with `distrobox COMMAND`
instead of calling the single files.
+Please check [the usage docs here](usage/usage.md) and [see some handy tips on how to use it](useful_tips.md)
+
### See it in action
Thanks to [castrojo](https://github.com/castrojo), you can see Distrobox in
@@ -180,8 +196,9 @@ The container will have complete access to your home, pen drives and so on,
so do not expect it to be highly sandboxed like a plain
docker/podman container or a flatpak.
-⚠️ **BE CAREFUL**: if you use docker, the daemon runs as root by default, so
-**root inside the docker container can modify system stuff outside the container**,
+⚠️ **BE CAREFUL**: if you use docker, or you use podman with the `--root/-r` flag,
+the containers will run as root, so **root inside the rootful container can modify
+system stuff outside the container**,
if you have security concern for this, **use podman that runs in rootless mode**.
Rootless docker is still not working as intended and will be included in the future
when it will be complete.
@@ -233,19 +250,24 @@ to the most important:
Example configuration file:
```conf
+container_always_pull="1"
container_user_custom_home="/home/.local/share/container-home-test"
container_image="registry.opensuse.org/opensuse/toolbox:latest"
container_manager="docker"
container_name="test-name-1"
non_interactive="1"
+skip_workdir="0"
```
Alternatively it is possible to specify preferences using ENV variables:
-- DBX_CONTAINER_MANAGER
+- DBX_CONTAINER_ALWAYS_PULL
+- DBX_CONTAINER_CUSTOM_HOME
- DBX_CONTAINER_IMAGE
+- DBX_CONTAINER_MANAGER
- DBX_CONTAINER_NAME
- DBX_NON_INTERACTIVE
+- DBX_SKIP_WORKDIR
---
@@ -258,7 +280,7 @@ on this list, you can refer to your repos for installation:
Thanks to the maintainers for their work: [M0Rf30](https://github.com/M0Rf30),
[alcir](https://github.com/alcir), [dfaggioli](https://github.com/dfaggioli),
-[AtilaSaraiva](https://github.com/AtilaSaraiva)
+[AtilaSaraiva](https://github.com/AtilaSaraiva), [michel-slm](https://github.com/michel-slm)
Else, if you like to live your life dangerously, or you want the latest release,
you can trust me and simply run this in your terminal:
@@ -273,6 +295,18 @@ or if you want to select a custom directory to install without sudo:
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
```
+If you want to install the last development version, directly from last commit on git, you can use:
+
+```sh
+curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh -s -- --next
+```
+
+or:
+
+```sh
+curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --next --prefix ~/.local
+```
+
Alternatively you can clone the project using `git clone` or using the latest
release [HERE](https://github.com/89luca89/distrobox/releases/latest).
diff --git a/docs/compatibility.md b/docs/compatibility.md
index c0d48e5..e291bd8 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -42,23 +42,22 @@ Distrobox has been successfully tested on:
| Distro | Version | Notes |
| --- | --- | --- |
-| Alpine Linux | 3.14<br>3.15 | To setup rootless podman, look [HERE](https://wiki.alpinelinux.org/wiki/Podman) |
-| Arch Linux | | `distrobox` and `distrobox-git` are available in AUR (thanks [M0Rf30](https://github.com/M0Rf30)!).<br>To setup rootless podman, look [HERE](https://wiki.archlinux.org/title/Podman) |
+| Alpine Linux | 3.14 <br> 3.15 | To setup rootless podman, look [HERE](https://wiki.alpinelinux.org/wiki/Podman) |
+| Arch Linux | | `distrobox` and `distrobox-git` are available in AUR (thanks [M0Rf30](https://github.com/M0Rf30)!). <br> To setup rootless podman, look [HERE](https://wiki.archlinux.org/title/Podman) |
| Manjaro | | To setup rootless podman, look [HERE](https://wiki.archlinux.org/title/Podman) |
-| CentOS | 8<br>8 Stream<br>9 Stream | `distrobox` is available in epel repos. (thanks [alcir](https://github.com/alcir)!) |
-| RedHat | 8<br>9beta | `distrobox` is available in epel repos. (thanks [alcir](https://github.com/alcir)!) |
-| Debian | 11<br>Testing<br>Unstable | |
-| Fedora | 34<br>35<br>36 | `distrobox` is available in default repos.(thanks [alcir](https://github.com/alcir)!) |
-| Fedora Silverblue/Kinoite | 34<br>35<br>36 | `distrobox` is available in default repos.(thanks [alcir](https://github.com/alcir)!) |
+| CentOS | 8 <br> 8 Stream <br> 9 Stream | `distrobox` is available in epel repos. (thanks [alcir](https://github.com/alcir)!) |
+| RedHat | 8 <br> 9beta | `distrobox` is available in epel repos. (thanks [alcir](https://github.com/alcir)!) |
+| Debian | 11 <br> Testing <br> Unstable | |
+| Fedora | 34 <br> 35 <br> 36 | `distrobox` is available in default repos.(thanks [alcir](https://github.com/alcir)!) |
+| Fedora Silverblue/Kinoite | 34 <br> 35 <br> 36 | `distrobox` is available in default repos.(thanks [alcir](https://github.com/alcir)!) |
| Gentoo | | To setup rootless podman, look [HERE](https://wiki.gentoo.org/wiki/Podman) |
-| Ubuntu | 18.04<br>20.04<br>21.10 | Older versions based on 20.04 or earlier may need external repos to install newer Podman and Docker releases.<br>Please follow their installation guide: [Podman](https://podman.io/getting-started/installation) [Docker](https://docs.docker.com/engine/install/ubuntu/)<br> Derivatives like Pop_OS!, Mint and Elementary OS should work the same. |
+| Ubuntu | 18.04 <br> 20.04 <br> 21.10 | Older versions based on 20.04 or earlier may need external repos to install newer Podman and Docker releases. <br> Please follow their installation guide: [Podman](https://podman.io/getting-started/installation) [Docker](https://docs.docker.com/engine/install/ubuntu/) <br> Derivatives like Pop_OS!, Mint and Elementary OS should work the same. <br> [Now PPA available!](https://launchpad.net/~michel-slm/+archive/ubuntu/distrobox) (thanks [michel-slm](https://github.com/michel-slm)! |
| EndlessOS | 4.0.0 | |
-| openSUSE | Tumbleweed<br>MicroOS | `distrobox` is available in default repos (thanks [dfaggioli](https://github.com/dfaggioli)!)<br>For Tumbleweed, do: `zypper install distrobox`.<br>For MicroOS enter in a [transactional update](https://kubic.opensuse.org/documentation/transactional-update-guide/transactional-update.html) shell like this: `tukit --continue execute /bin/bash` (or `transactional-update shell --continue`, if you have `transactional-update` installed). Once inside: `zypper install distrobox`. Then exit the shell (`CTRL+D` is fine) and reboot the system. |
-| openSUSE | Leap 15.4<br>Leap 15.3<br>Leap 15.2 | Packages are available [here](https://software.opensuse.org/download/package?package=distrobox&project=home%3Adfaggioli%3Amicroos-desktop) (thanks [dfaggioli](https://github.com/dfaggioli)!)<br>To install on openSUSE Leap 15.4, do:<br>`zypper addrepo https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.4/home:dfaggioli:microos-desktop.repo && zypper refresh && zypper install distrobox`.<br>For earlier versions, the procedure is the same, the link to the repository (i.e., the last argument of the `zypper addrepo` command) is the only thing that changes: [Leap 15.3](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/openSUSE_Leap_15.3/home:dfaggioli:microos-desktop.repo), [Leap 15.2](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/openSUSE_Leap_15.2/home:dfaggioli:microos-desktop.repo). |
-| SUSE Linux Enterprise Server | 15 Service Pack 4<br>15 Service Pack 3<br>15 Service Pack 2 | Same procedure as the one for openSUSE (Leap, respective versions, of course). Use the following repository links in the `zypper addrepo` command: [SLE-15-SP4](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.4/home:dfaggioli:microos-desktop.repo), [SLE-15-SP3](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.3/home:dfaggioli:microos-desktop.repo), [SLE-15-SP4](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/SLE_15_SP2/home:dfaggioli:microos-desktop.repo). |
+| openSUSE | Tumbleweed <br> MicroOS | `distrobox` is available in default repos (thanks [dfaggioli](https://github.com/dfaggioli)!) <br> For Tumbleweed, do: `zypper install distrobox`. <br> For MicroOS enter in a [transactional update](https://kubic.opensuse.org/documentation/transactional-update-guide/transactional-update.html) shell like this: `tukit --continue execute /bin/bash` (or `transactional-update shell --continue`, if you have `transactional-update` installed). Once inside: `zypper install distrobox`. Then exit the shell (`CTRL+D` is fine) and reboot the system. |
+| openSUSE | Leap 15.4 <br> Leap 15.3 <br> Leap 15.2 | Packages are available [here](https://software.opensuse.org/download/package?package=distrobox&project=home%3Adfaggioli%3Amicroos-desktop) (thanks [dfaggioli](https://github.com/dfaggioli)!).<br> To install on openSUSE Leap 15.4, do: <br> `zypper addrepo https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.4/home:dfaggioli:microos-desktop.repo && zypper refresh && zypper install distrobox`. <br> For earlier versions, the procedure is the same, the link to the repository (i.e., the last argument of the `zypper addrepo` command) is the only thing that changes: [Leap 15.3](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/openSUSE_Leap_15.3/home:dfaggioli:microos-desktop.repo), [Leap 15.2](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/openSUSE_Leap_15.2/home:dfaggioli:microos-desktop.repo).<br>``Podman`` under SUSE Leap, cannot initialize correctly the containers managed by ``distrobox`` until [this OpenSUSE bug](https://bugzilla.opensuse.org/show_bug.cgi?id=1199871&GoAheadAndLogIn=1) is fixed, or ``podman`` loggin is configured properly. ``Docker`` can be used instead, but it is less secure [because it does not work yet in rootless mode](https://github.com/89luca89/distrobox/issues/223).|
+| SUSE Linux Enterprise Server | 15 Service Pack 4 <br> 15 Service Pack 3 <br> 15 Service Pack 2 | Same procedure as the one for openSUSE (Leap, respective versions, of course). Use the following repository links in the `zypper addrepo` command: [SLE-15-SP4](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.4/home:dfaggioli:microos-desktop.repo), [SLE-15-SP3](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.3/home:dfaggioli:microos-desktop.repo), [SLE-15-SP4](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/SLE_15_SP2/home:dfaggioli:microos-desktop.repo). |
| Void Linux | glibc | Systemd service export will not work. |
-| NixOS | 21.11 | Currently you must have your default shell set to Bash, if it is not, make sure you edit your configuration.nix so that it is. <br>Also make sure to mind your executable paths. Sometimes a container will not have nix paths, and sometimes it will not have its own paths. <br> Distrobox is available in Nixpkg collection (thanks [AtilaSaraiva](https://github.com/AtilaSaraiva)!)<<br>To setup Docker, look [HERE](https://nixos.wiki/wiki/Docker) <br>To setup Podman, look [HERE](https://nixos.wiki/wiki/Podman) and [HERE](https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947) |
-| Windows WSL2 | | **NOTE WSL2 support is preliminary, and there are many bugs present, any help in improving support is appreciated** <br> Currently you must work around some incompatibility between WSL2 and Podman, namely [THIS](https://github.com/containers/podman/issues/12236). <br>Install into WSL2 any of the supported distributions in this list. <br> Ensure you have an entry in the `fstab` for the `/tmp` folder:<br> `echo 'tmpfs /tmp tmps defaults 0 0' >> /etc/fstab`.<br>Then reboot the WSL machine `wsl --shutdown` <br>Note that `distrobox export` is not supported on WSL2 and will not work. |
+| NixOS | 21.11 | Currently you must have your default shell set to Bash, if it is not, make sure you edit your configuration.nix so that it is. <br> Also make sure to mind your executable paths. Sometimes a container will not have nix paths, and sometimes it will not have its own paths. <br> Distrobox is available in Nixpkg collection (thanks [AtilaSaraiva](https://github.com/AtilaSaraiva)!)< <br> To setup Docker, look [HERE](https://nixos.wiki/wiki/Docker) <br> To setup Podman, look [HERE](https://nixos.wiki/wiki/Podman) and [HERE](https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947) |
### Compatibility notes
@@ -106,31 +105,31 @@ Distrobox guests tested successfully with the following container images:
| Distro | Version | Images |
| --- | --- | --- |
-| AlmaLinux | 8 | docker.io/library/almalinux:8 |
-| AlmaLinux (UBI) | 8 | docker.io/almalinux/8-base<br>docker.io/almalinux/8-init |
-| Alpine Linux | 3.14<br>3.15 | docker.io/library/alpine:latest |
+| AlmaLinux | 8 <br> 8-minimal <br> 9 <br> 9-minimal | docker.io/library/almalinux:8 <br> docker.io/library/almalinux:9 <br> docker.io/library/almalinux:9-minimal |
+| AlmaLinux (UBI) | 8 | docker.io/almalinux/8-base <br> docker.io/almalinux/8-init |
+| Alpine Linux | 3.14 <br> 3.15 | docker.io/library/alpine:latest |
| AmazonLinux | 2 | docker.io/library/amazonlinux:2.0.20211005.0 |
| AmazonLinux | 2022 | public.ecr.aws/amazonlinux/amazonlinux:2022 |
| Archlinux | | docker.io/library/archlinux:latest |
-| ClearLinux | | docker.io/library/clearlinux:latest<br>docker.io/library/clearlinux:base |
+| ClearLinux | | docker.io/library/clearlinux:latest <br> docker.io/library/clearlinux:base |
| CentOS | 7 | quay.io/centos/centos:7 |
-| CentOS Stream | 8<br>9 | quay.io/centos/centos:stream8<br>quay.io/centos/centos:stream9 |
-| RedHat (UBI) | 7<br>8 | registry.access.redhat.com/ubi7/ubi<br>registry.access.redhat.com/ubi7/ubi-init<br>registry.access.redhat.com/ubi8/ubi<br>registry.access.redhat.com/ubi8/ubi-init |
-| Debian | 7<br>8<br>9<br>10<br>11 | docker.io/debian/eol:wheezy<br>docker.io/library/debian:8<br>docker.io/library/debian:9<br>docker.io/library/debian:10<br>docker.io/library/debian:stable<br>docker.io/library/debian:stable-backports |
-| Debian | Testing | docker.io/library/debian:testing <br> docker.io/library/debian:testing-backports |
+| CentOS Stream | 8 <br> 9 | quay.io/centos/centos:stream8 <br> quay.io/centos/centos:stream9 |
+| RedHat (UBI) | 7 <br> 8 <br> 9 | registry.access.redhat.com/ubi7/ubi <br> registry.access.redhat.com/ubi7/ubi-init <br> registry.access.redhat.com/ubi7/ubi-minimal <br> registry.access.redhat.com/ubi8/ubi <br> registry.access.redhat.com/ubi8/ubi-init <br> registry.access.redhat.com/ubi8/ubi-minimal <br> registry.access.redhat.com/ubi9/ubi <br> registry.access.redhat.com/ubi9/ubi-init <br> registry.access.redhat.com/ubi9/ubi-minimal |
+| Debian | 7 <br> 8 <br> 9 <br> 10 <br> 11 | docker.io/debian/eol:wheezy <br> docker.io/library/debian:8 <br> docker.io/library/debian:9 <br> docker.io/library/debian:10 <br> docker.io/library/debian:stable <br> docker.io/library/debian:stable-backports |
+| Debian | Testing | docker.io/library/debian:testing <br> docker.io/library/debian:testing-backports |
| Debian | Unstable | docker.io/library/debian:unstable |
| Neurodebian | nd100 | docker.io/library/neurodebian:nd100 |
-| Fedora | 34<br>35<br>36<br>37<br>Rawhide | registry.fedoraproject.org/fedora-toolbox:34<br> docker.io/library/fedora:34<br>registry.fedoraproject.org/fedora-toolbox:35<br>docker.io/library/fedora:35<br>docker.io/library/fedora:36<br>registry.fedoraproject.org/fedora:37<br>docker.io/library/fedora:rawhide |
+| Fedora | 34 <br> 35 <br> 36 <br> 37 <br> Rawhide | registry.fedoraproject.org/fedora-toolbox:34 <br> docker.io/library/fedora:34 <br> registry.fedoraproject.org/fedora-toolbox:35 <br> docker.io/library/fedora:35 <br> docker.io/library/fedora:36 <br> registry.fedoraproject.org/fedora:37 <br> docker.io/library/fedora:rawhide |
| Mageia | 8 | docker.io/library/mageia |
| Opensuse | Leap | registry.opensuse.org/opensuse/leap:latest |
-| Opensuse | Tumbleweed | registry.opensuse.org/opensuse/tumbleweed:latest <br> registry.opensuse.org/opensuse/toolbox:latest |
-| Oracle Linux | 7<br>8 | container-registry.oracle.com/os/oraclelinux:7<br>container-registry.oracle.com/os/oraclelinux:8 |
+| Opensuse | Tumbleweed | registry.opensuse.org/opensuse/tumbleweed:latest <br> registry.opensuse.org/opensuse/toolbox:latest |
+| Oracle Linux | 7 <br> 8 | container-registry.oracle.com/os/oraclelinux:7 <br> container-registry.oracle.com/os/oraclelinux:8 |
| Rocky Linux | 8 | docker.io/rockylinux/rockylinux:8 |
| Scientific Linux | 7 | docker.io/library/sl:7 |
| Slackware | 14.2 | docker.io/vbatts/slackware:14.2 |
-| Ubuntu | 14.04<br>16.04<br>18.04<br>20.04<br>21.10<br>22.04 | docker.io/library/ubuntu:14.04<br>docker.io/library/ubuntu:16.04<br>docker.io/library/ubuntu:18.04<br>docker.io/library/ubuntu:20.04<br>docker.io/library/ubuntu:21.10<br>docker.io/library/ubuntu:22.04 |
+| Ubuntu | 14.04 <br> 16.04 <br> 18.04 <br> 20.04 <br> 21.10 <br> 22.04 | docker.io/library/ubuntu:14.04 <br> docker.io/library/ubuntu:16.04 <br> docker.io/library/ubuntu:18.04 <br> docker.io/library/ubuntu:20.04 <br> docker.io/library/ubuntu:21.10 <br> docker.io/library/ubuntu:22.04 |
| Kali Linux | rolling | docker.io/kalilinux/kali-rolling:latest |
-| Void Linux | | ghcr.io/void-linux/void-linux:latest-full-x86_64 <br> ghcr.io/void-linux/void-linux:latest-full-x86_64-musl |
+| Void Linux | | ghcr.io/void-linux/void-linux:latest-full-x86_64 <br> ghcr.io/void-linux/void-linux:latest-full-x86_64-musl |
| Gentoo Linux | rolling | You will have to [Build your own](distrobox_gentoo.md) to have a complete Gentoo docker image |
Note however that if you use a non-toolbox preconfigured image (e.g.
diff --git a/docs/distrobox_custom.md b/docs/distrobox_custom.md
index 22f9881..e0d2bc4 100644
--- a/docs/distrobox_custom.md
+++ b/docs/distrobox_custom.md
@@ -18,13 +18,20 @@ The only required programs that must be available in the container so that
`distrobox-init` won't start the installation are:
- the $SHELL you use (bash, zsh, fish etc etc)
+- bc
+- curl
+- diffutils
- findutils
+- less
- ncurses
-- procps
-- shadow
+- passwd
+- pinentry
+- procps-ng
+- shadow-utils
- sudo
-- libvte
- util-linux (that provides the mount command)
+- vte-profile
+- wget
If all those dependencies are met, then the `distrobox-init`
will simply skip the installation process and work as expected.
@@ -32,9 +39,11 @@ will simply skip the installation process and work as expected.
To test if all packages requirements are met just run this in the container:
```shell
-if ! command -v mount || ! command -v mount || ! command -v passwd ||
- ! command -v sudo || ! command -v useradd || ! command -v usermod ||
- ! command -v "${SHELL}"; then
+if ! command -v find || ! command -v mount || ! command -v passwd ||
+ ! command -v sudo || ! command -v useradd || ! command -v diff ||
+ ! command -v pinentry || ! command -v wget || ! command -v curl ||
+ ! command -v less || ! command -v bc ||
+ ! command -v "${SHELL}"; then
echo "Missing dependencies"
diff --git a/docs/featured_articles.md b/docs/featured_articles.md
index 55c59a1..8984eb6 100644
--- a/docs/featured_articles.md
+++ b/docs/featured_articles.md
@@ -1,10 +1,11 @@
- [Distrobox](README.md)
- - [Featured articles](#featured-articles)
+ - [Featured articles](#articles)
+ - [Talks](#talks)
- [Podcasts](#podcasts)
---
-## Featured articles
+## Articles
- [Run Distrobox on Fedora Linux - Fedora Magazine](https://fedoramagazine.org/run-distrobox-on-fedora-linux/)
- [DistroBox – Run Any Linux Distribution Inside Linux Terminal - TecMint](https://www.tecmint.com/distrobox-run-any-linux-distribution/)
@@ -16,9 +17,15 @@
[ORIGINAL](https://bandithijo.github.io/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux)
or [TRANSLATED](https://bandithijo-github-io.translate.goog/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux?_x_tr_sl=id&_x_tr_tl=en&_x_tr_hl=it&_x_tr_pto=wapp)
- [Day-to-day differences between Fedora Silverblue and Ubuntu - castrojo's blog](https://www.ypsidanger.com/day-to-day-advantages-of-fedora-silverblue/)
+- [Distrobox is Awesome - Running Window Manager and Desktop environments using Distrobox](https://cloudyday.tech.blog/2022/05/14/distrobox-is-awesome/)
+
+## Talks
+
+- [Linux App Summit 2022 - Distrobox: Run Any App On Any Distro - BoF](https://github.com/89luca89/distrobox/files/8598433/distrobox-las-talk.pdf)
## Podcasts
- [Linux After Dark – Episode 07](https://linuxafterdark.net/linux-after-dark-episode-07/)
- [Linux Lads - Season 7 - Episode 1](https://linuxlads.com/episodes/season-7-episode-1)
- [Late Night Linux - Episode 39](https://latenightlinux.com/linux-downtime-episode-39/)
+- [Late After Dark - Episode 16](https://linuxafterdark.net/linux-after-dark-episode-16/)
diff --git a/docs/posts/execute_commands_on_host.md b/docs/posts/execute_commands_on_host.md
index a75f96c..706158f 100644
--- a/docs/posts/execute_commands_on_host.md
+++ b/docs/posts/execute_commands_on_host.md
@@ -1,7 +1,9 @@
- [Distrobox](../README.md)
- [Execute a command on the Host](execute_commands_on_host.md)
- - [The easy one](#the-easy-one)
- - [The not so easy one](#the-not-so-easy-one)
+ - [With distrobox-host-exec](#distrobox-host-exec)
+ - [Manually](#manually)
+ - [The easy one](#the-easy-one)
+ - [The not so easy one](#the-not-so-easy-one)
- [Integrate host with container seamlessly](#integrate-host-with-container-seamlessly)
---
@@ -13,7 +15,15 @@ archive manager, a container manager and so on.
Here are a couple of solutions.
-## The easy one
+## With distrobox-host-exec
+
+distrobox offers the `distrobox-host-exec` helper, that can be used exactly for this.
+
+See [distrobox-host-exec](../usage/distrobox-host-exec.md).
+
+## Manually
+
+### The easy one
Install `flatpak-spawn` inside the container, this example is running on a
Fedora Distrobox:
@@ -24,14 +34,14 @@ Fedora Distrobox:
user at fedora-distrobox:~$ sudo dnf install -y flatpak-spawn
```
-With `flatpak-swpan` we can easily execute commands on the host using:
+With `flatpak-spawn` we can easily execute commands on the host using:
```shell
user at fedora-distrobox:~$ flatpak-spawn --host bash -l
~$ # We're back on host!
```
-## The not so easy one
+### The not so easy one
Alternatively you may don't have `flatpak-spawn` in the repository of your container,
or simply want an alternative.
@@ -65,6 +75,8 @@ user at fedora-distrobox:~$ host-exec bash -l
Another cool trick we can pull, is to use the handy `command_not_found_handle` function
to try and execute missing commands in the container on the host.
+## bash / zsh
+
Place this in your `~/.profile`:
```shell
@@ -91,6 +103,27 @@ if [ -n "${ZSH_VERSION-}" ]; then
fi
```
+## fish
+
+Place this snippet in a new fish function file (`~/.config/fish/functions/fish_command_not_found.fish`):
+
+```fish
+function fish_command_not_found
+ # "In a container" check
+ if test -e /run/.containerenv -o -e /.dockerenv
+ if command -q flatpak-spawn
+ flatpak-spawn --host $argv
+ else if command -q host-exec
+ host-exec "$argv"
+ else
+ __fish_default_command_not_found_handler $argv
+ end
+ else
+ __fish_default_command_not_found_handler $argv
+ end
+end
+```
+
And restart your terminal. Now when a command does not exist on your container,
it will be automatically executed back on the host:
diff --git a/docs/posts/run_latest_gnome_kde_on_distrobox.md b/docs/posts/run_latest_gnome_kde_on_distrobox.md
index 12da5b9..ba6b62b 100644
--- a/docs/posts/run_latest_gnome_kde_on_distrobox.md
+++ b/docs/posts/run_latest_gnome_kde_on_distrobox.md
@@ -7,6 +7,7 @@
- [Running Latest Plasma](#running-latest-plasma)
- [Generate session file - Plasma](#generate-session-file---plasma)
- [Add a couple of fixes](#add-a-couple-of-fixes)
+ - [Using other GUIs](#using-other-guis)
- [Using apps from host](#using-apps-from-host)
---
@@ -38,12 +39,14 @@ distrobox enter fedora-rawhide
## Running Latest GNOME
First we need to change a couple of bits in the distrobox container to make host's
-systemd session accessible from within the host:
+systemd session accessible from within the container:
```shell
~$ distrobox enter fedora-rawhide
-user at fedora-rawhide:~$ rm -rf /run/systemd/system
-user at fedora-rawhide:~$ ln -s /run/host/run/systemd/system /run/systemd
+user at fedora-rawhide:~$ sudo umount /run/systemd/system
+user at fedora-rawhide:~$ sudo rmdir /run/systemd/system
+user at fedora-rawhide:~$ sudo ln -s /run/host/run/systemd/system /run/systemd
+user at fedora-rawhide:~$ sudo ln -s /run/host/run/dbus/system_bus_socket /run/dbus/
```
Then we can proceed to install GNOME in the container:
@@ -106,8 +109,10 @@ sharing with the container:
```shell
~$ distrobox enter fedora-rawhide
-user at fedora-rawhide:~$ rm -rf /run/systemd/system
-user at fedora-rawhide:~$ ln -s /run/host/run/systemd/system /run/systemd
+user at fedora-rawhide:~$ sudo umount /run/systemd/system
+user at fedora-rawhide:~$ sudo rmdir /run/systemd/system
+user at fedora-rawhide:~$ sudo ln -s /run/host/run/systemd/system /run/systemd
+user at fedora-rawhide:~$ sudo ln -s /run/host/run/dbus/system_bus_socket /run/dbus/
```
Then we can proceed to install Plasma in the container:
@@ -168,6 +173,15 @@ Let's log out and voilá!
We now are in latest KDE Plasma session inside Fedora Rawhide while our main OS remains
Centos.
+# Using other GUIs
+
+Thanks to [J.S. Evans](https://twitter.com/usenetnerd) he experimented and wrote a beautiful blog post
+on how to use Distrobox for much more than simply running apps.
+
+You'll read on how to set up a working Ubuntu container with IceWM running on Xorg using Distrobox:
+
+[Read the Article HERE](https://cloudyday.tech.blog/2022/05/14/distrobox-is-awesome/)
+
# Using apps from host
Now that we're in a container session, we may want to still use some of the host's
diff --git a/docs/usage/distrobox-create.md b/docs/usage/distrobox-create.md
index 7594ca7..f5b6412 100644
--- a/docs/usage/distrobox-create.md
+++ b/docs/usage/distrobox-create.md
@@ -8,29 +8,36 @@ graphical apps (X11/Wayland), and audio.
Usage:
- distrobox-create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
- distrobox-create --clone fedora-toolbox-35 --name fedora-toolbox-35-copy
- distrobox-create --image alpine my-alpine-container
- distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
- distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
distrobox create --image alpine:latest --name test --init-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
- distrobox create -i docker.io/almalinux/8-init --init --name test
+ distrobox create --image fedora:35 --name test --additional-flags "--env MY_VAR-value"
+ distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags "--pids-limit -1"
+ distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
+ distrobox create --clone fedora-35 --name fedora-35-copy
+ distrobox create --image alpine my-alpine-container
+ distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
+ distrobox create --pull --image centos:stream9 --home ~/distrobox/centos9
-You can also use environment variables to specify container name and image
+You can also use environment variables to specify container name, image and container manager:
- DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test-alpine DBX_CONTAINER_IMAGE=alpine distrobox-create
+ DBX_CONTAINER_MANAGER="docker" DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test-alpine DBX_CONTAINER_IMAGE=alpine distrobox-create
Supported environment variables:
- DBX_NON_INTERACTIVE
- DBX_CONTAINER_NAME
+ DBX_CONTAINER_ALWAYS_PULL
+ DBX_CONTAINER_CUSTOM_HOME
DBX_CONTAINER_IMAGE
+ DBX_CONTAINER_MANAGER
+ DBX_CONTAINER_NAME
+ DBX_NON_INTERACTIVE
Options:
- --image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:35
- --name/-n: name for the distrobox default: fedora-toolbox-35
- --yes/-Y: non-interactive, pull images without asking
+ --image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:36
+ --name/-n: name for the distrobox default: my-distrobox
+ --pull/-p: pull latest image unconditionally without asking
+ --yes/-Y: non-interactive, pull images without asking
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--clone/-c: name of the distrobox container to use as base for a new container
this will be useful to either rename an existing distrobox or have multiple copies
of the same environment.
@@ -38,6 +45,7 @@ Options:
--volume additional volumes to add to the container
--additional-flags/-a: additional flags to pass to the container manager command
--init-hooks additional commands to execute during container initialization
+ --pre-init-hooks additional commands to execute prior to container initialization
--init/-I use init system (like systemd) inside the container.
this will make host's processes not visible from within the container.
--help/-h: show this message
diff --git a/docs/usage/distrobox-enter.md b/docs/usage/distrobox-enter.md
index 4b933a0..9224ec0 100644
--- a/docs/usage/distrobox-enter.md
+++ b/docs/usage/distrobox-enter.md
@@ -15,17 +15,26 @@ Usage:
distrobox-enter --additional-flags "--env MY_VAR=value" --name test -- bash -l
MY_VAR=value distrobox-enter --additional-flags "--preserve-fds" --name test -- bash -l
+You can also use environment variables to specify container manager and container name:
+
+ DBX_CONTAINER_MANAGER="docker" DBX_CONTAINER_NAME=test-alpine distrobox-enter
+
Supported environment variables:
DBX_CONTAINER_NAME
+ DBX_CONTAINER_MANAGER
+ DBX_SKIP_WORKDIR
Options:
- --name/-n: name for the distrobox default: fedora-toolbox-35
+ --name/-n: name for the distrobox default: my-distrobox
--/-e: end arguments execute the rest as command to execute at login default: bash -l
--no-tty/-T: do not instantiate a tty
+ --no-workdir/-nw: always start the container from container's home directory
--additional-flags/-a: additional flags to pass to the container manager command
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--dry-run/-d: only print the container manager command generated
--verbose/-v: show more verbosity
--version/-V: show version
diff --git a/docs/usage/distrobox-host-exec.md b/docs/usage/distrobox-host-exec.md
new file mode 100644
index 0000000..52ced6e
--- /dev/null
+++ b/docs/usage/distrobox-host-exec.md
@@ -0,0 +1,28 @@
+<!-- markdownlint-disable MD010 -->
+# Host Command Execution
+
+distrobox-host-exec lets one execute command on the host, while inside of a container.
+
+If "flatpak-spawn" is installed in the container, this is what is used, and it is the
+most powerful and recommended method. If, instead, "flatpak-spawn" can't be found, it
+still try to get the job done with "chroot" (but beware that not all commands/programs
+will work well in this mode).
+
+Just pass to "distrobox-host-exec" any command and all its arguments, if any.
+
+ distrobox-host-exec [command [arguments]]
+
+If no command is provided, it will execute "/bin/sh".
+
+Example usage:
+
+ distrobox-host-exec ls
+ distrobox-host-exec bash -l
+ distrobox-host-exec flatpak run org.mozilla.firefox
+ distrobox-host-exec podman ps -a
+
+Options:
+
+ --help/-h: show this message
+ --verbose/-v: show more verbosity
+ --version/-V: show version
diff --git a/docs/usage/distrobox-init.md b/docs/usage/distrobox-init.md
index d287ac5..cfeb72d 100644
--- a/docs/usage/distrobox-init.md
+++ b/docs/usage/distrobox-init.md
@@ -24,6 +24,7 @@ Options:
--home/-d: path/to/home of the user
--help/-h: show this message
--init/-I: whether to use or not init
+ --pre-init-hooks: commands to execute prior to init
--verbose/-v: show more verbosity
--version/-V: show version
--: end arguments execute the rest as command to execute during init
diff --git a/docs/usage/distrobox-list.md b/docs/usage/distrobox-list.md
index dfb9523..c15fd79 100644
--- a/docs/usage/distrobox-list.md
+++ b/docs/usage/distrobox-list.md
@@ -8,9 +8,20 @@ Usage:
distrobox-list
+You can also use environment variables to specify container manager
+
+ DBX_CONTAINER_MANAGER="docker" distrobox-list
+
+Supported environment variables:
+
+ DBX_CONTAINER_MANAGER
+
Options:
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
+ --size/-s: show also container size
--verbose/-v: show more verbosity
--version/-V: show version
diff --git a/docs/usage/distrobox-rm.md b/docs/usage/distrobox-rm.md
index d959549..bdbda78 100644
--- a/docs/usage/distrobox-rm.md
+++ b/docs/usage/distrobox-rm.md
@@ -8,10 +8,22 @@ Usage:
distrobox-rm --name container-name [--force]
distrobox-rm container-name [-f]
+You can also use environment variables to specify container manager and name:
+
+ DBX_CONTAINER_MANAGER="docker" DBX_CONTAINER_NAME=test-alpine distrobox-rm
+
+Supported environment variables:
+
+ DBX_CONTAINER_MANAGER
+ DBX_CONTAINER_NAME
+ DBX_NON_INTERACTIVE
+
Options:
--name/-n: name for the distrobox
--force/-f: force deletion
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--help/-h: show this message
--verbose/-v: show more verbosity
--version/-V: show version
diff --git a/docs/usage/distrobox-stop.md b/docs/usage/distrobox-stop.md
index 653c4e3..a648f51 100644
--- a/docs/usage/distrobox-stop.md
+++ b/docs/usage/distrobox-stop.md
@@ -1,17 +1,32 @@
<!-- markdownlint-disable MD010 -->
# Stop containers
-distrobox-rm delete one of the available distroboxes.
+distrobox-stop stop a running distrobox.
+
+Distroboxes are left running, even after exiting out of them, so that
+subsequent enters are really quick. This is how they can be stopped.
Usage:
- distrobox-rm --name container-name
- distrobox-rm container-name
+ distrobox-stop --name container-name
+ distrobox-stop container-name
+
+You can also use environment variables to specify container manager and name:
+
+ DBX_CONTAINER_MANAGER="docker" DBX_CONTAINER_NAME=test-alpine distrobox-stop
+
+Supported environment variables:
+
+ DBX_CONTAINER_MANAGER
+ DBX_CONTAINER_NAME
+ DBX_NON_INTERACTIVE
Options:
--name/-n: name for the distrobox
--yes/-Y: non-interactive, stop without asking
--help/-h: show this message
+ --root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over "sudo distrobox"
--verbose/-v: show more verbosity
--version/-V: show version
diff --git a/docs/useful_tips.md b/docs/useful_tips.md
index 6319e38..5620a37 100644
--- a/docs/useful_tips.md
+++ b/docs/useful_tips.md
@@ -1,5 +1,5 @@
- [Distrobox](README.md)
- - [Execute complex commands directly from distrobox-enter](#execute-complex-commands-directly-from-distrobox-enter)
+ - [Execute complex commands directly from distrobox enter](#execute-complex-commands-directly-from-distrobox-enter)
- [Create a distrobox with a custom HOME directory](#create-a-distrobox-with-a-custom-home-directory)
- [Mount additional volumes in a distrobox](#mount-additional-volumes-in-a-distrobox)
- [Use a different shell than the host](#use-a-different-shell-than-the-host)
@@ -12,10 +12,12 @@
- [Using docker inside a distrobox](#using-docker-inside-a-distrobox)
- [Using init system inside a distrobox](#using-init-system-inside-a-distrobox)
- [Using distrobox as main cli](#using-distrobox-as-main-cli)
- - [Improve distrobox-enter performance](#improve-distrobox-enter-performance)
- - [Slow creation on podman and image size getting bigger with distrobox-create](#slow-creation-on-podman-and-image-size-getting-bigger-with-distrobox-create)
+ - [Using a different architecture](#using-a-different-architecture)
+ - [Improve distrobox enter performance](#improve-distrobox-enter-performance)
+ - [Slow creation on podman and image size getting bigger with distrobox create](#slow-creation-on-podman-and-image-size-getting-bigger-with-distrobox-create)
- [Container save and restore](#container-save-and-restore)
- [Check used resources](#check-used-resources)
+ - [Pre-installing additional package repositories](#pre-installing-additional-package-repositories)
- [Build a Gentoo distrobox container](distrobox_gentoo.md)
- [Build a Dedicated distrobox container](distrobox_custom.md)
@@ -23,7 +25,7 @@
# Useful tips
-## Execute complex commands directly from distrobox-enter
+## Execute complex commands directly from distrobox enter
Sometimes it is necessary to execure complex commands from a distrobox enter,
like multiple concatenated commands using variables declared **inside** the container.
@@ -39,21 +41,21 @@ inside the container.
## Create a distrobox with a custom HOME directory
-`distrobox-create` supports the use of the `--home` flag, as specified in the
+`distrobox create` supports the use of the `--home` flag, as specified in the
usage [HERE](./usage/distrobox-create.md)
Simply use:
-`distrobox-create --name test --image your-choosen-image:tag --home /your/custom/home`
+`distrobox create --name test --image your-choosen-image:tag --home /your/custom/home`
## Mount additional volumes in a distrobox
-`distrobox-create` supports the use of the `--volume` flag, as specified in the
+`distrobox create` supports the use of the `--volume` flag, as specified in the
usage [HERE](./usage/distrobox-create.md)
Simply use:
-`distrobox-create --name test --image your-choosen-image:tag --volume /your/custom/volume/path`
+`distrobox create --name test --image your-choosen-image:tag --volume /your/custom/volume/path`
## Use a different shell than the host
@@ -63,15 +65,29 @@ If you want a different one you can use:
`SHELL=/bin/zsh distrobox create -n test`
`SHELL=/bin/zsh distrobox enter test`
+## Run the container with real root
+
+When using podman, distrobox will prefer to use rootless containers. In this mode the `root`
+user inside the container is **not** the real `root` user of the host. But it still has
+the same privileges as your normal `$USER`.
+
+But what if you really really need those `root` privileges even inside the container?
+
+Instead of running `sudo distrobox` to do stuff, it is better to simply use normal
+command with the `--root` or `-r` flag, so that distrobox can still integrate better
+with your `$USER`.
+
+`distrobox create --name test --image your-choosen-image:tag --root`
+
## Duplicate an existing distrobox
It can be useful to just duplicate an already set up environment, to do this,
-`distrobox-create` supports the use of the
+`distrobox create` supports the use of the
`--clone` flag, as specified in the usage [HERE](./usage/distrobox-create.md)
Simply use:
-`distrobox-create --name test --clone name-of-distrobox-to-clone`
+`distrobox create --name test --clone name-of-distrobox-to-clone`
## Export to the host
@@ -90,13 +106,13 @@ You can create a distrobox with will have the same hostname as the host by
creating it with the following init-hook:
```sh
-distrobox-create --name test --image your-choosen-image:tag \
+distrobox create --name test --image your-choosen-image:tag \
--init-hooks '"$(uname -n)" > /etc/hostname'`
```
This will ensure SSH X-Forwarding will work when SSH-ing inside the distrobox:
-`ssh -X myhost distrobox-enter test -- xclock`
+`ssh -X myhost distrobox enter test -- xclock`
## Use distrobox to install different flatpaks from the host
@@ -107,7 +123,7 @@ If you want to have a separate system remote between host and container,
you can create your distrobox with the followint init-hook:
```sh
-distrobox-create --name test --image your-choosen-image:tag \
+distrobox create --name test --image your-choosen-image:tag \
--init-hooks 'umount /var/lib/flatpak'`
```
@@ -181,7 +197,32 @@ to the Host profile.
For other terminals, there are similar features (profiles) or you can set up a
dedicated shortcut to launch a terminal directly in the distrobox
-## Improve distrobox-enter performance
+## Using a different architecture
+
+In case you want to run a container with a different architecture from your host,
+you can leverage the use of `qemu` and support from podman/docker.
+
+Install on your host the following dependencies:
+
+- qemu
+- qemu-user-static
+- binfmt-support
+
+Then you can easily run the image you like:
+
+```console
+~$ uname -m
+x86_64
+~$ distrobox create -i aarch64/fedora -n fedora-arm64
+~$ distrobox enter fedora-arm64
+...
+user at fedora-arm64:~$ uname -m
+aarch64
+```
+
+![image](https://user-images.githubusercontent.com/598882/170837120-9170a9fa-6153-4684-a435-d60a0136b563.png)
+
+## Improve distrobox enter performance
If you are experiencing a bit slow performance using `podman` you should enable
the podman socket using
@@ -190,7 +231,7 @@ the podman socket using
this will improve a lot `podman`'s command performances.
-## Slow creation on podman and image size getting bigger with distrobox-create
+## Slow creation on podman and image size getting bigger with distrobox create
For rootless podman 3.4.0 and upward, adding this to your `~/.config/containers/storage.conf`
file will improve container creation speed and fix issues with images getting
@@ -252,8 +293,8 @@ docker load < image_name_you_choose.tar.gz
And create a new container based on that image:
```sh
-distrobox-create --image image_name_you_choose:latest --name distrobox_name
-distrobox-enter --name distrobox_name
+distrobox create --image image_name_you_choose:latest --name distrobox_name
+distrobox enter --name distrobox_name
```
And you're good to go, now you can reproduce your personal environment everywhere
@@ -264,3 +305,28 @@ in simple (and scriptable) steps.
- You can always check how much space a `distrobox` is taking by using `podman` command:
`podman system df -v` or `docker system df -v`
+
+## Pre-installing additional package repositories
+
+On Red Hat Enterprise Linux and its derivatives, the amount of packages in the
+base repositories is limited, and additional packages need to be brought in by
+enabling additional repositories such as [EPEL](https://docs.fedoraproject.org/en-US/epel/).
+
+You can use `--init-hooks` to automate this, but this does not solve the
+issue for package installations done during initialization itself, e.g. if
+the shell you use on the host is not available in the default repos (e.g.
+`fish`).
+
+Use the pre-initialization hooks for this:
+
+```shell
+distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-release"
+```
+
+```shell
+distrobox create -i docker.io/library/almalinux:9 -n alma9 --pre-init-hooks "dnf -y install dnf-plugins-core && dnf config-manager --enable crb && dnf -y install epel-release"
+```
+
+```shell
+distrobox create -i quay.io/centos/centos:stream8 c8s --pre-init-hooks "dnf config-manager --enable powertools && dnf -y install epel-next-release"
+```
diff --git a/install b/install
index e5b9ac8..14b027e 100755
--- a/install
+++ b/install
@@ -19,6 +19,7 @@
# POSIX
+next=0
verbose=0
# Print usage to stdout.
@@ -57,6 +58,12 @@ while :; do
shift
fi
;;
+ -N | --next)
+ if [ -n "$2" ]; then
+ shift
+ next=1
+ fi
+ ;;
-P | --prefix)
if [ -n "$2" ]; then
prefix="$2"
@@ -104,10 +111,6 @@ cd "${curr_dir}" || exit 1
# if files are available, install files in dest directory
# else download targz and uncompress it
if [ -e "${curr_dir}/distrobox-enter" ]; then
- release_ver="github-zip-$(date +%F)"
- if [ -d "${curr_dir}/.git" ] && command -v git > /dev/null; then
- release_ver="git-$(git rev-parse HEAD)"
- fi
for file in distrobox*; do
if ! install -D -m 0755 -t "${dest_path}" "${file}"; then
printf >&2 "Do you have permission to write to %s?\n" "${dest_path}"
@@ -126,10 +129,14 @@ else
exit 1
fi
- release_ver=$(curl -L https://github.com/89luca89/distrobox/releases/latest |
- grep 'refs/tags' | tail -1 | cut -d'"' -f2)
- release_name=$(echo "${release_ver}" | rev | cut -d'/' -f1 | rev)
-
+ if [ "${next}" -eq 0 ]; then
+ release_ver=$(curl -L https://github.com/89luca89/distrobox/releases/latest |
+ grep 'refs/tags' | tail -1 | cut -d'"' -f2)
+ release_name=$(echo "${release_ver}" | rev | cut -d'/' -f1 | rev)
+ else
+ release_ver="89luca89/distrobox/archive/refs/heads/main.tar.gz"
+ release_name="main"
+ fi
# go in tmp
tmp_dir="$(mktemp -d)"
cd "${tmp_dir}"
diff --git a/man/gen-man b/man/gen-man
index d6b9bc2..749cb4e 100755
--- a/man/gen-man
+++ b/man/gen-man
@@ -1,32 +1,44 @@
#!/bin/sh
-if ! command -v ronn; then
+if ! command -v pandoc; then
echo '
-Please install "ronn". This tool is needed to convert markdown to man pages.
+Please install "pandoc". This tool is needed to convert markdown to man pages.
This tool is needed to convert files under docs/usage into man pages for the
installation.
-
-https://github.com/rtomayko/ronn
'
exit 1
fi
for i in "$(dirname "${0}")"/../docs/usage/distrobox*; do
- ronn --manual=Distrobox --name="$(basename "${i}" |
- cut -d'.' -f1).1" --organization=Distrobox "${i}" -o "$(dirname "${0}")"/man1/
- mv "$(dirname "${0}")/man1/$(basename "${i}" |
- cut -d'.' -f1)" "$(dirname "${0}")/man1/$(basename "${i}" | sed 's|md|1|g')"
+ pandoc --standalone \
+ --metadata title="$(basename "${i}" | cut -d'.' -f1 | tr '[:lower:]' '[:upper:]')" \
+ --metadata section=1 \
+ --metadata header="User Manual" \
+ --metadata footer="Distrobox" \
+ --metadata date="$(date +"%b %Y")" \
+ --to man "${i}" \
+ -o "$(dirname "${0}")"/man1/out
+ sed -i 's|\" Automatically generated by Pandoc.*||g' "$(dirname "${0}")"/man1/out
+ mv "$(dirname "${0}")/man1/out" "$(dirname "${0}")/man1/$(basename "${i}" | sed 's|md|1|g')"
done
-compatibility_file="$(mktemp)"
+compatibility_file="$(mktemp --suffix='.md')"
+HEAD="$(grep -n -B1 "^# Compatibility" "$(dirname "${0}")/../docs/compatibility.md" | head -1 | tr -d '-')"
START="$(grep -n "# Host Distros" "$(dirname "${0}")/../docs/compatibility.md" | cut -d":" -f1)"
END="$(grep -n -B1 "# Containers Distros" "$(dirname "${0}")/../docs/compatibility.md" | head -1 | tr -d '-')"
sed -e "${START},${END}d" "$(dirname "${0}")/../docs/compatibility.md" > "${compatibility_file}"
+sed -e "1,${HEAD}d" -i "${compatibility_file}"
-ronn --manual=Distrobox --name="distrobox-compatibility.1" \
- --organization=Distrobox "${compatibility_file}" -o "$(dirname "${0}")"/man1/
-mv "$(dirname "${0}")"/man1/tmp "$(dirname "${0}")"/man1/distrobox-compatibility.1
+pandoc --standalone \
+ --metadata title="DISTROBOX" \
+ --metadata section=1 \
+ --metadata header="User Manual" \
+ --metadata footer="Distrobox" \
+ --metadata date="$(date +"%b %Y")" \
+ --to man "${compatibility_file}" \
+ -o "$(dirname "${0}")"/man1/out
+sed -i 's|\" Automatically generated by Pandoc.*||g' "$(dirname "${0}")"/man1/out
+mv "$(dirname "${0}")"/man1/out "$(dirname "${0}")"/man1/distrobox-compatibility.1
-rm -f "$(dirname "${0}")"/man1/*.html
cat "$(dirname "${0}")/man1/distrobox-"* > "$(dirname "${0}")/man1/distrobox.1"
diff --git a/man/man1/distrobox-compatibility.1 b/man/man1/distrobox-compatibility.1
index 0754442..be70aca 100644
--- a/man/man1/distrobox-compatibility.1
+++ b/man/man1/distrobox-compatibility.1
@@ -1,164 +1,307 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-COMPATIBILITY\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-compatibility\.1\fR \- Compatibility
-.P
-This project \fBdoes not need a dedicated image\fR\. It can use any OCI images from docker\-hub, quay\.io, or any registry of your choice\.
-.P
-Granted, they may not be as featureful as expected (some of them do not even have \fBwhich\fR, \fBmount\fR, \fBless\fR or \fBvi\fR) but that\'s all doable in the container itself after bootstrapping it\.
-.P
-The main concern is having basic Linux utilities (\fBmount\fR), basic user management utilities (\fBusermod, passwd\fR), and \fBsudo\fR correctly set\.
-.SH "Supported container managers"
-\fBdistrobox\fR can run on either \fBpodman\fR or \fBdocker\fR
-.P
-It depends either on \fBpodman\fR configured in \fBrootless mode\fR or on \fBdocker\fR configured without sudo (follow THIS instructions \fIhttps://docs\.docker\.com/engine/install/linux\-postinstall/\fR)
-.IP "\[ci]" 4
-Minimum podman version: \fB2\.1\.0\fR
-.IP "\[ci]" 4
-Minimum docker version: \fB18\.06\.1\fR
-.IP "" 0
-.P
+'\" t
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Compatibility
+.PP
+This project \f[B]does not need a dedicated image\f[R].
+It can use any OCI images from docker-hub, quay.io, or any registry of
+your choice.
+.PP
+Granted, they may not be as featureful as expected (some of them do not
+even have \f[V]which\f[R], \f[V]mount\f[R], \f[V]less\f[R] or
+\f[V]vi\f[R]) but that\[cq]s all doable in the container itself after
+bootstrapping it.
+.PP
+The main concern is having basic Linux utilities (\f[V]mount\f[R]),
+basic user management utilities (\f[V]usermod, passwd\f[R]), and
+\f[V]sudo\f[R] correctly set.
+.SS Supported container managers
+.PP
+\f[V]distrobox\f[R] can run on either \f[V]podman\f[R] or
+\f[V]docker\f[R]
+.PP
+It depends either on \f[V]podman\f[R] configured in
+\f[V]rootless mode\f[R] or on \f[V]docker\f[R] configured without sudo
+(follow THIS
+instructions (https://docs.docker.com/engine/install/linux-postinstall/))
+.IP \[bu] 2
+Minimum podman version: \f[B]2.1.0\f[R]
+.IP \[bu] 2
+Minimum docker version: \f[B]18.06.1\f[R]
+.PP
Follow the official installation guide here:
-.IP "\[ci]" 4
-\fIhttps://podman\.io/getting\-started/installation\fR
-.IP "\[ci]" 4
-\fIhttps://docs\.docker\.com/engine/install\fR
-.IP "\[ci]" 4
-\fIhttps://docs\.docker\.com/engine/install/linux\-postinstall/\fR
-.IP "" 0
-.SH "Containers Distros"
-Distrobox guests tested successfully with the following container images:
+.IP \[bu] 2
+<https://podman.io/getting-started/installation>
+.IP \[bu] 2
+<https://docs.docker.com/engine/install>
+.IP \[bu] 2
+<https://docs.docker.com/engine/install/linux-postinstall/>
+.SS Containers Distros
+.PP
+Distrobox guests tested successfully with the following container
+images:
+.PP
.TS
-allbox;
-l l l.
-Distro Version Images
-AlmaLinux 8 docker\.io/library/almalinux:8
-AlmaLinux (UBI) 8 docker\.io/almalinux/8\-base
-.br
-docker\.io/almalinux/8\-init
-Alpine Linux 3\.14
-.br
-3\.15 docker\.io/library/alpine:latest
-AmazonLinux 2 docker\.io/library/amazonlinux:2\.0\.20211005\.0
-AmazonLinux 2022 public\.ecr\.aws/amazonlinux/amazonlinux:2022
-Archlinux \~ docker\.io/library/archlinux:latest
-ClearLinux \~ docker\.io/library/clearlinux:latest
-.br
-docker\.io/library/clearlinux:base
-CentOS 7 quay\.io/centos/centos:7
-CentOS Stream 8
-.br
-9 quay\.io/centos/centos:stream8
-.br
-quay\.io/centos/centos:stream9
-RedHat (UBI) 7
-.br
-8 registry\.access\.redhat\.com/ubi7/ubi
-.br
-registry\.access\.redhat\.com/ubi7/ubi\-init
-.br
-registry\.access\.redhat\.com/ubi8/ubi
-.br
-registry\.access\.redhat\.com/ubi8/ubi\-init
-Debian 7
-.br
+tab(@);
+lw(23.3n) lw(23.3n) lw(23.3n).
+T{
+Distro
+T}@T{
+Version
+T}@T{
+Images
+T}
+_
+T{
+AlmaLinux
+T}@T{
+8 8-minimal 9 9-minimal
+T}@T{
+docker.io/library/almalinux:8 docker.io/library/almalinux:9
+docker.io/library/almalinux:9-minimal
+T}
+T{
+AlmaLinux (UBI)
+T}@T{
8
-.br
-9
-.br
-10
-.br
-11 docker\.io/debian/eol:wheezy
-.br
-docker\.io/library/debian:8
-.br
-docker\.io/library/debian:9
-.br
-docker\.io/library/debian:10
-.br
-docker\.io/library/debian:stable
-.br
-docker\.io/library/debian:stable\-backports
-Debian Testing docker\.io/library/debian:testing
-.br
-docker\.io/library/debian:testing\-backports
-Debian Unstable docker\.io/library/debian:unstable
-Neurodebian nd100 docker\.io/library/neurodebian:nd100
-Fedora 34
-.br
-35
-.br
-36
-.br
-37
-.br
-Rawhide registry\.fedoraproject\.org/fedora\-toolbox:34
-.br
-docker\.io/library/fedora:34
-.br
-registry\.fedoraproject\.org/fedora\-toolbox:35
-.br
-docker\.io/library/fedora:35
-.br
-docker\.io/library/fedora:36
-.br
-registry\.fedoraproject\.org/fedora:37
-.br
-docker\.io/library/fedora:rawhide
-Mageia 8 docker\.io/library/mageia
-Opensuse Leap registry\.opensuse\.org/opensuse/leap:latest
-Opensuse Tumbleweed registry\.opensuse\.org/opensuse/tumbleweed:latest
-.br
-registry\.opensuse\.org/opensuse/toolbox:latest
-Oracle Linux 7
-.br
-8 container\-registry\.oracle\.com/os/oraclelinux:7
-.br
-container\-registry\.oracle\.com/os/oraclelinux:8
-Rocky Linux 8 docker\.io/rockylinux/rockylinux:8
-Scientific Linux 7 docker\.io/library/sl:7
-Slackware 14\.2 docker\.io/vbatts/slackware:14\.2
-Ubuntu 14\.04
-.br
-16\.04
-.br
-18\.04
-.br
-20\.04
-.br
-21\.10
-.br
-22\.04 docker\.io/library/ubuntu:14\.04
-.br
-docker\.io/library/ubuntu:16\.04
-.br
-docker\.io/library/ubuntu:18\.04
-.br
-docker\.io/library/ubuntu:20\.04
-.br
-docker\.io/library/ubuntu:21\.10
-.br
-docker\.io/library/ubuntu:22\.04
-Kali Linux rolling docker\.io/kalilinux/kali\-rolling:latest
-Void Linux \~ ghcr\.io/void\-linux/void\-linux:latest\-full\-x86_64
-.br
-ghcr\.io/void\-linux/void\-linux:latest\-full\-x86_64\-musl
-Gentoo Linux rolling You will have to Build your own \fIdistrobox_gentoo\.md\fR to have a complete Gentoo docker image
+T}@T{
+docker.io/almalinux/8-base docker.io/almalinux/8-init
+T}
+T{
+Alpine Linux
+T}@T{
+3.14 3.15
+T}@T{
+docker.io/library/alpine:latest
+T}
+T{
+AmazonLinux
+T}@T{
+2
+T}@T{
+docker.io/library/amazonlinux:2.0.20211005.0
+T}
+T{
+AmazonLinux
+T}@T{
+2022
+T}@T{
+public.ecr.aws/amazonlinux/amazonlinux:2022
+T}
+T{
+Archlinux
+T}@T{
+T}@T{
+docker.io/library/archlinux:latest
+T}
+T{
+ClearLinux
+T}@T{
+T}@T{
+docker.io/library/clearlinux:latest docker.io/library/clearlinux:base
+T}
+T{
+CentOS
+T}@T{
+7
+T}@T{
+quay.io/centos/centos:7
+T}
+T{
+CentOS Stream
+T}@T{
+8 9
+T}@T{
+quay.io/centos/centos:stream8 quay.io/centos/centos:stream9
+T}
+T{
+RedHat (UBI)
+T}@T{
+7 8 9
+T}@T{
+registry.access.redhat.com/ubi7/ubi
+registry.access.redhat.com/ubi7/ubi-init
+registry.access.redhat.com/ubi7/ubi-minimal
+registry.access.redhat.com/ubi8/ubi
+registry.access.redhat.com/ubi8/ubi-init
+registry.access.redhat.com/ubi8/ubi-minimal
+registry.access.redhat.com/ubi9/ubi
+registry.access.redhat.com/ubi9/ubi-init
+registry.access.redhat.com/ubi9/ubi-minimal
+T}
+T{
+Debian
+T}@T{
+7 8 9 10 11
+T}@T{
+docker.io/debian/eol:wheezy docker.io/library/debian:8
+docker.io/library/debian:9 docker.io/library/debian:10
+docker.io/library/debian:stable
+docker.io/library/debian:stable-backports
+T}
+T{
+Debian
+T}@T{
+Testing
+T}@T{
+docker.io/library/debian:testing
+docker.io/library/debian:testing-backports
+T}
+T{
+Debian
+T}@T{
+Unstable
+T}@T{
+docker.io/library/debian:unstable
+T}
+T{
+Neurodebian
+T}@T{
+nd100
+T}@T{
+docker.io/library/neurodebian:nd100
+T}
+T{
+Fedora
+T}@T{
+34 35 36 37 Rawhide
+T}@T{
+registry.fedoraproject.org/fedora-toolbox:34 docker.io/library/fedora:34
+registry.fedoraproject.org/fedora-toolbox:35 docker.io/library/fedora:35
+docker.io/library/fedora:36 registry.fedoraproject.org/fedora:37
+docker.io/library/fedora:rawhide
+T}
+T{
+Mageia
+T}@T{
+8
+T}@T{
+docker.io/library/mageia
+T}
+T{
+Opensuse
+T}@T{
+Leap
+T}@T{
+registry.opensuse.org/opensuse/leap:latest
+T}
+T{
+Opensuse
+T}@T{
+Tumbleweed
+T}@T{
+registry.opensuse.org/opensuse/tumbleweed:latest
+registry.opensuse.org/opensuse/toolbox:latest
+T}
+T{
+Oracle Linux
+T}@T{
+7 8
+T}@T{
+container-registry.oracle.com/os/oraclelinux:7
+container-registry.oracle.com/os/oraclelinux:8
+T}
+T{
+Rocky Linux
+T}@T{
+8
+T}@T{
+docker.io/rockylinux/rockylinux:8
+T}
+T{
+Scientific Linux
+T}@T{
+7
+T}@T{
+docker.io/library/sl:7
+T}
+T{
+Slackware
+T}@T{
+14.2
+T}@T{
+docker.io/vbatts/slackware:14.2
+T}
+T{
+Ubuntu
+T}@T{
+14.04 16.04 18.04 20.04 21.10 22.04
+T}@T{
+docker.io/library/ubuntu:14.04 docker.io/library/ubuntu:16.04
+docker.io/library/ubuntu:18.04 docker.io/library/ubuntu:20.04
+docker.io/library/ubuntu:21.10 docker.io/library/ubuntu:22.04
+T}
+T{
+Kali Linux
+T}@T{
+rolling
+T}@T{
+docker.io/kalilinux/kali-rolling:latest
+T}
+T{
+Void Linux
+T}@T{
+T}@T{
+ghcr.io/void-linux/void-linux:latest-full-x86_64
+ghcr.io/void-linux/void-linux:latest-full-x86_64-musl
+T}
+T{
+Gentoo Linux
+T}@T{
+rolling
+T}@T{
+You will have to Build your own to have a complete Gentoo docker image
+T}
.TE
-.P
-Note however that if you use a non\-toolbox preconfigured image (e\.g\. images pre\-baked to work with \fIhttps://github\.com/containers/toolbox),\fR the \fBfirst\fR \fBdistrobox\-enter\fR you\'ll perform can take a while as it will download and install the missing dependencies\.
-.P
-A small time tax to pay for the ability to use any type of image\. This will \fBnot\fR occur after the first time, \fBsubsequent enters will be much faster\.\fR
-.P
-NixOS is not a supported container distro, and there are currently no plans to bring support to it\. If you are looking for unprivlaged NixOS environments, we suggest you look into nix\-shell \fIhttps://nixos\.org/manual/nix/unstable/command\-ref/nix\-shell\.html\fR\.
-.SS "New Distro support"
-If your distro of choice is not on the list, open an issue requesting support for it, we can work together to check if it is possible to add support for it\.
-.P
-Or just try using it anyway, if it works, open an issue and it will be added to the list!
-.SS "Older distributions"
-For older distributions like CentOS 5, CentOS 6, Debian 6, Ubuntu 12\.04, compatibility is not assured\.
-.P
-Their \fBlibc\fR version is incompatible with kernel releases after \fB>=4\.11\fR\. A work around this is to use the \fBvsyscall=emulate\fR flag in the bootloader of the host\.
-.P
-Keep also in mind that mirrors could be down for such old releases, so you will need to build a custom distrobox image to ensure basic dependencies are met \fI\./distrobox_custom\.md\fR\.
+.PP
+Note however that if you use a non-toolbox preconfigured image (e.g.
+images pre-baked to work with <https://github.com/containers/toolbox),>
+the \f[B]first\f[R] \f[V]distrobox-enter\f[R] you\[cq]ll perform can
+take a while as it will download and install the missing dependencies.
+.PP
+A small time tax to pay for the ability to use any type of image.
+This will \f[B]not\f[R] occur after the first time, \f[B]subsequent
+enters will be much faster.\f[R]
+.PP
+NixOS is not a supported container distro, and there are currently no
+plans to bring support to it.
+If you are looking for unprivlaged NixOS environments, we suggest you
+look into
+nix-shell (https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html).
+.SS New Distro support
+.PP
+If your distro of choice is not on the list, open an issue requesting
+support for it, we can work together to check if it is possible to add
+support for it.
+.PP
+Or just try using it anyway, if it works, open an issue and it will be
+added to the list!
+.SS Older distributions
+.PP
+For older distributions like CentOS 5, CentOS 6, Debian 6, Ubuntu 12.04,
+compatibility is not assured.
+.PP
+Their \f[V]libc\f[R] version is incompatible with kernel releases after
+\f[V]>=4.11\f[R].
+A work around this is to use the \f[V]vsyscall=emulate\f[R] flag in the
+bootloader of the host.
+.PP
+Keep also in mind that mirrors could be down for such old releases, so
+you will need to build a custom distrobox image to ensure basic
+dependencies are met.
diff --git a/man/man1/distrobox-create.1 b/man/man1/distrobox-create.1
index 9fd99c3..956d8a7 100644
--- a/man/man1/distrobox-create.1
+++ b/man/man1/distrobox-create.1
@@ -1,131 +1,183 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-CREATE\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-create\.1\fR
-.P
-# Create the distrobox
-.P
-distrobox\-create takes care of creating the container with input name and image\. The created container will be tightly integrated with the host, allowing sharing of the HOME directory of the user, external storage, external usb devices and graphical apps (X11/Wayland), and audio\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-CREATE" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Create the distrobox
+.PP
+distrobox-create takes care of creating the container with input name
+and image.
+The created container will be tightly integrated with the host, allowing
+sharing of the HOME directory of the user, external storage, external
+usb devices and graphical apps (X11/Wayland), and audio.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-create \-\-image registry\.fedoraproject\.org/fedora\-toolbox:35 \-\-name fedora\-toolbox\-35
-distrobox\-create \-\-clone fedora\-toolbox\-35 \-\-name fedora\-toolbox\-35\-copy
-distrobox\-create \-\-image alpine my\-alpine\-container
-distrobox create \-\-image fedora:35 \-\-name test \-\-volume /opt/my\-dir:/usr/local/my\-dir:rw \-\-additional\-flags "\-\-pids\-limit \-1"
-distrobox create \-\-image fedora:35 \-\-name test \-\-additional\-flags "\-\-env MY_VAR\-value"
-distrobox create \-\-image alpine:latest \-\-name test \-\-init\-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
-distrobox create \-i docker\.io/almalinux/8\-init \-\-init \-\-name test
+\f[C]
+distrobox create --image alpine:latest --name test --init-hooks \[dq]touch /var/tmp/test1 && touch /var/tmp/test2\[dq]
+distrobox create --image fedora:35 --name test --additional-flags \[dq]--env MY_VAR-value\[dq]
+distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags \[dq]--pids-limit -1\[dq]
+distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks \[dq]dnf config-manager --enable powertools && dnf -y install epel-release\[dq]
+distrobox create --clone fedora-35 --name fedora-35-copy
+distrobox create --image alpine my-alpine-container
+distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
+distrobox create --pull --image centos:stream9 --home \[ti]/distrobox/centos9
+\f[R]
.fi
-.IP "" 0
-.P
-You can also use environment variables to specify container name and image
-.IP "" 4
+.PP
+You can also use environment variables to specify container name, image
+and container manager:
+.IP
.nf
-DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test\-alpine DBX_CONTAINER_IMAGE=alpine distrobox\-create
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test-alpine DBX_CONTAINER_IMAGE=alpine distrobox-create
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Supported environment variables:
-.IP "" 4
+.IP
.nf
-DBX_NON_INTERACTIVE
-DBX_CONTAINER_NAME
+\f[C]
+DBX_CONTAINER_ALWAYS_PULL
+DBX_CONTAINER_CUSTOM_HOME
DBX_CONTAINER_IMAGE
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-image/\-i: image to use for the container default: registry\.fedoraproject\.org/fedora\-toolbox:35
-\-\-name/\-n: name for the distrobox default: fedora\-toolbox\-35
-\-\-yes/\-Y: non\-interactive, pull images without asking
-\-\-clone/\-c: name of the distrobox container to use as base for a new container
- this will be useful to either rename an existing distrobox or have multiple copies
- of the same environment\.
-\-\-home/\-H select a custom HOME directory for the container\. Useful to avoid host\'s home littering with temp files\.
-\-\-volume additional volumes to add to the container
-\-\-additional\-flags/\-a: additional flags to pass to the container manager command
-\-\-init\-hooks additional commands to execute during container initialization
-\-\-init/\-I use init system (like systemd) inside the container\.
- this will make host\'s processes not visible from within the container\.
-\-\-help/\-h: show this message
-\-\-dry\-run/\-d: only print the container manager command generated
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:36
+--name/-n: name for the distrobox default: my-distrobox
+--pull/-p: pull latest image unconditionally without asking
+--yes/-Y: non-interactive, pull images without asking
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--clone/-c: name of the distrobox container to use as base for a new container
+ this will be useful to either rename an existing distrobox or have multiple copies
+ of the same environment.
+--home/-H select a custom HOME directory for the container. Useful to avoid host\[aq]s home littering with temp files.
+--volume additional volumes to add to the container
+--additional-flags/-a: additional flags to pass to the container manager command
+--init-hooks additional commands to execute during container initialization
+--pre-init-hooks additional commands to execute prior to container initialization
+--init/-I use init system (like systemd) inside the container.
+ this will make host\[aq]s processes not visible from within the container.
+--help/-h: show this message
+--dry-run/-d: only print the container manager command generated
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Compatibility:
-.IP "" 4
+.IP
.nf
+\f[C]
for a list of compatible images and container managers, please consult the man page:
- man distrobox
- man distrobox\-compatibility
-or consult the documentation page on: https://github\.com/89luca89/distrobox/blob/main/docs/compatibility\.md#containers\-distros
+ man distrobox
+ man distrobox-compatibility
+or consult the documentation page on: https://github.com/89luca89/distrobox/blob/main/docs/compatibility.md#containers-distros
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-additional\-flags\fR or \fB\-a\fR is useful to modify defaults in the container creations\. For example:
-.IP "" 4
+.PP
+The \f[V]--additional-flags\f[R] or \f[V]-a\f[R] is useful to modify
+defaults in the container creations.
+For example:
+.IP
.nf
-distrobox create \-i docker\.io/library/archlinux \-n dev\-arch
+\f[C]
+distrobox create -i docker.io/library/archlinux -n dev-arch
-podman container inspect dev\-arch | jq \'\.[0]\.HostConfig\.PidsLimit\'
+podman container inspect dev-arch | jq \[aq].[0].HostConfig.PidsLimit\[aq]
2048
-distrobox rm \-f dev\-arch
-distrobox create \-i docker\.io/library/archlinux \-n dev\-arch \-\-volume $CBL_TC:/tc \-\-additional\-flags "\-\-pids\-limit \-1"
+distrobox rm -f dev-arch
+distrobox create -i docker.io/library/archlinux -n dev-arch --volume $CBL_TC:/tc --additional-flags \[dq]--pids-limit -1\[dq]
-podman container inspect dev\-arch | jq \'\.[0]\.HostConfig,\.PidsLimit\'
+podman container inspect dev-arch | jq \[aq].[0].HostConfig,.PidsLimit\[aq]
0
+\f[R]
.fi
-.IP "" 0
-.P
-Additional volumes can be specified using the \fB\-\-volume\fR flag\. This flag follows the same standard as \fBdocker\fR and \fBpodman\fR to specify the mount point so \fB\-\-volume SOURCE_PATH:DEST_PATH:MODE\fR\.
-.IP "" 4
+.PP
+Additional volumes can be specified using the \f[V]--volume\f[R] flag.
+This flag follows the same standard as \f[V]docker\f[R] and
+\f[V]podman\f[R] to specify the mount point so
+\f[V]--volume SOURCE_PATH:DEST_PATH:MODE\f[R].
+.IP
.nf
-distrobox create \-\-image docker\.io/library/archlinux \-\-name dev\-arch \-\-volume /usr/share/:/var/test:ro
+\f[C]
+distrobox create --image docker.io/library/archlinux --name dev-arch --volume /usr/share/:/var/test:ro
+\f[R]
.fi
-.IP "" 0
-.P
-During container creation, it is possible to specify (using the additional\-flags) some environment variables that will persist in the container and be independent from your environment:
-.IP "" 4
+.PP
+During container creation, it is possible to specify (using the
+additional-flags) some environment variables that will persist in the
+container and be independent from your environment:
+.IP
.nf
-distrobox create \-\-image fedora:35 \-\-name test \-\-additional\-flags "\-\-env MY_VAR\-value"
+\f[C]
+distrobox create --image fedora:35 --name test --additional-flags \[dq]--env MY_VAR-value\[dq]
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-init\-hooks\fR is useful to add commands to the entrypoint (init) of the container\. This could be useful to create containers with a set of programs already installed, add users, groups\.
-.IP "" 4
+.PP
+The \f[V]--init-hooks\f[R] is useful to add commands to the entrypoint
+(init) of the container.
+This could be useful to create containers with a set of programs already
+installed, add users, groups.
+.IP
.nf
-distrobox create \-\-image fedora:35 \-\-name test \-\-init\-hooks "dnf groupinstall \-y \e"C Development Tools and Libraries\e""
+\f[C]
+distrobox create --image fedora:35 --name test --init-hooks \[dq]dnf groupinstall -y \[rs]\[dq]C Development Tools and Libraries\[rs]\[dq]\[dq]
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-init\fR is useful to create a container that will use its own separate init system within\. For example using:
-.IP "" 4
+.PP
+The \f[V]--init\f[R] is useful to create a container that will use its
+own separate init system within.
+For example using:
+.IP
.nf
-distrobox create \-i docker\.io/almalinux/8\-init \-\-init\-hooks "dnf install \-y openssh\-server" \-\-init \-\-name test
+\f[C]
+distrobox create -i docker.io/almalinux/8-init --init-hooks \[dq]dnf install -y openssh-server\[dq] --init --name test
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Inside the container we will be able to use normal systemd units:
-.IP "" 4
+.IP
.nf
-~$ distrobox enter test
-user at test:~$ sudo systemctl enable \-\-now sshd
-user at test:~$ sudo systemctl status sshd
- ● sshd\.service \- OpenSSH server daemon
- Loaded: loaded (/usr/lib/systemd/system/sshd\.service; enabled; vendor preset: enabled)
- Active: active (running) since Fri 2022\-01\-28 22:54:50 CET; 17s ago
- Docs: man:sshd(8)
- man:sshd_config(5)
- Main PID: 291 (sshd)
+\f[C]
+\[ti]$ distrobox enter test
+user\[at]test:\[ti]$ sudo systemctl enable --now sshd
+user\[at]test:\[ti]$ sudo systemctl status sshd
+ \[u25CF] sshd.service - OpenSSH server daemon
+ Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
+ Active: active (running) since Fri 2022-01-28 22:54:50 CET; 17s ago
+ Docs: man:sshd(8)
+ man:sshd_config(5)
+ Main PID: 291 (sshd)
+\f[R]
.fi
-.IP "" 0
-.P
-Note that enabling \fB\-\-init\fR \fBwill disable host\'s process integration\fR\. From within the container you will not be able to see and manage host\'s processes\. This is needed because \fB/sbin/init\fR must be pid 1\.
+.PP
+Note that enabling \f[V]--init\f[R] \f[B]will disable host\[cq]s process
+integration\f[R].
+From within the container you will not be able to see and manage
+host\[cq]s processes.
+This is needed because \f[V]/sbin/init\f[R] must be pid 1.
diff --git a/man/man1/distrobox-enter.1 b/man/man1/distrobox-enter.1
index 7d57441..70ac564 100644
--- a/man/man1/distrobox-enter.1
+++ b/man/man1/distrobox-enter.1
@@ -1,60 +1,99 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-ENTER\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-enter\.1\fR
-.P
-# Enter the distrobox
-.P
-distrobox\-enter takes care of entering the container with the name specified\. Default command executed is your SHELL, but you can specify different shells or entire commands to execute\. If using it inside a script, an application, or a service, you can specify the \-\-headless mode to disable tty and interactivity\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-ENTER" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Enter the distrobox
+.PP
+distrobox-enter takes care of entering the container with the name
+specified.
+Default command executed is your SHELL, but you can specify different
+shells or entire commands to execute.
+If using it inside a script, an application, or a service, you can
+specify the \[en]headless mode to disable tty and interactivity.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-enter \-\-name fedora\-toolbox\-35 \-\- bash \-l
-distrobox\-enter my\-alpine\-container \-\- sh \-l
-distrobox\-enter \-\-additional\-flags "\-\-preserve\-fds" \-\-name test \-\- bash \-l
-distrobox\-enter \-\-additional\-flags "\-\-env MY_VAR=value" \-\-name test \-\- bash \-l
-MY_VAR=value distrobox\-enter \-\-additional\-flags "\-\-preserve\-fds" \-\-name test \-\- bash \-l
+\f[C]
+distrobox-enter --name fedora-toolbox-35 -- bash -l
+distrobox-enter my-alpine-container -- sh -l
+distrobox-enter --additional-flags \[dq]--preserve-fds\[dq] --name test -- bash -l
+distrobox-enter --additional-flags \[dq]--env MY_VAR=value\[dq] --name test -- bash -l
+MY_VAR=value distrobox-enter --additional-flags \[dq]--preserve-fds\[dq] --name test -- bash -l
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+You can also use environment variables to specify container manager and
+container name:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-enter
+\f[R]
+.fi
+.PP
Supported environment variables:
-.IP "" 4
+.IP
.nf
+\f[C]
DBX_CONTAINER_NAME
+DBX_CONTAINER_MANAGER
+DBX_SKIP_WORKDIR
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: name for the distrobox default: fedora\-toolbox\-35
-\-\-/\-e: end arguments execute the rest as command to execute at login default: bash \-l
-\-\-no\-tty/\-T: do not instantiate a tty
-\-\-additional\-flags/\-a: additional flags to pass to the container manager command
-\-\-help/\-h: show this message
-\-\-dry\-run/\-d: only print the container manager command generated
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--name/-n: name for the distrobox default: my-distrobox
+--/-e: end arguments execute the rest as command to execute at login default: bash -l
+--no-tty/-T: do not instantiate a tty
+--no-workdir/-nw: always start the container from container\[aq]s home directory
+--additional-flags/-a: additional flags to pass to the container manager command
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--dry-run/-d: only print the container manager command generated
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-.P
-This is used to enter the distrobox itself\. Personally, I just create multiple profiles in my \fBgnome\-terminal\fR to have multiple distros accessible\.
-.P
-The \fB\-\-additional\-flags\fR or \fB\-a\fR is useful to modify default command when executing in the container\. For example:
-.IP "" 4
+.PP
+This is used to enter the distrobox itself.
+Personally, I just create multiple profiles in my
+\f[V]gnome-terminal\f[R] to have multiple distros accessible.
+.PP
+The \f[V]--additional-flags\f[R] or \f[V]-a\f[R] is useful to modify
+default command when executing in the container.
+For example:
+.IP
.nf
-distrobox enter \-n dev\-arch \-\-additional\-flags "\-\-env my_var=test" \-\- printenv &| grep my_var
+\f[C]
+distrobox enter -n dev-arch --additional-flags \[dq]--env my_var=test\[dq] -- printenv &| grep my_var
my_var=test
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
This is possible also using normal env variables:
-.IP "" 4
+.IP
.nf
-my_var=test distrobox enter \-n dev\-arch \-\-additional\-flags \-\- printenv &| grep my_var
+\f[C]
+my_var=test distrobox enter -n dev-arch --additional-flags -- printenv &| grep my_var
my_var=test
+\f[R]
.fi
-.IP "" 0
-
diff --git a/man/man1/distrobox-export.1 b/man/man1/distrobox-export.1
index 6ff87ab..a0cfeb2 100644
--- a/man/man1/distrobox-export.1
+++ b/man/man1/distrobox-export.1
@@ -1,115 +1,169 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-EXPORT\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-export\.1\fR
-.P
-# Application and service exporting
-.P
-distrobox\-export takes care of exporting an app a binary or a service from the container to the host\.
-.P
-The exported app will be easily available in your normal launcher and it will automatically be launched from the container it is exported from\.
-.P
-The exported services will be available in the host\'s user\'s systemd session, so
-.IP "" 4
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-EXPORT" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Application and service exporting
+.PP
+distrobox-export takes care of exporting an app a binary or a service
+from the container to the host.
+.PP
+The exported app will be easily available in your normal launcher and it
+will automatically be launched from the container it is exported from.
+.PP
+The exported services will be available in the host\[cq]s user\[cq]s
+systemd session, so
+.IP
.nf
-systemctl \-\-user status exported_service_name
+\f[C]
+systemctl --user status exported_service_name
+\f[R]
.fi
-.IP "" 0
-.P
-will show the status of the service exported\.
-.P
-The exported binaries will be exported in the "\-\-export\-path" of choice as a wrapper script that acts naturally both on the host and in the container\. Note that "\-\-export\-path" is NOT OPTIONAL, you have to explicitly set it\.
-.P
-You can specify additional flags to add to the command, for example if you want to export an electron app, you could add the "\-\-foreground" flag to the command:
-.IP "" 4
+.PP
+will show the status of the service exported.
+.PP
+The exported binaries will be exported in the \[lq]\[en]export-path\[rq]
+of choice as a wrapper script that acts naturally both on the host and
+in the container.
+Note that \[lq]\[en]export-path\[rq] is NOT OPTIONAL, you have to
+explicitly set it.
+.PP
+You can specify additional flags to add to the command, for example if
+you want to export an electron app, you could add the
+\[lq]\[en]foreground\[rq] flag to the command:
+.IP
.nf
-distrobox\-export \-\-app atom \-\-extra\-flags "\-\-foreground"
-distrobox\-export \-\-bin /usr/bin/vim \-\-export\-path ~/\.local/bin \-\-extra\-flags "\-p"
-distrobox\-export \-\-service syncthing \-\-extra\-flags "\-allow\-newer\-config"
+\f[C]
+distrobox-export --app atom --extra-flags \[dq]--foreground\[dq]
+distrobox-export --bin /usr/bin/vim --export-path \[ti]/.local/bin --extra-flags \[dq]-p\[dq]
+distrobox-export --service syncthing --extra-flags \[dq]-allow-newer-config\[dq]
+\f[R]
.fi
-.IP "" 0
-.P
-This works for services, binaries, and apps\. Extra flags are only used then the exported app, binary, or service is used from the host, using them inside the container will not include them\.
-.P
-The option "\-\-delete" will un\-export an app, binary, or service\.
-.IP "" 4
+.PP
+This works for services, binaries, and apps.
+Extra flags are only used then the exported app, binary, or service is
+used from the host, using them inside the container will not include
+them.
+.PP
+The option \[lq]\[en]delete\[rq] will un-export an app, binary, or
+service.
+.IP
.nf
-distrobox\-export \-\-app atom \-\-delete
-distrobox\-export \-\-bin /usr/bin/vim \-\-export\-path ~/\.local/bin \-\-delete
-distrobox\-export \-\-service syncthing \-\-delete
-distrobox\-export \-\-service nginx \-\-delete
+\f[C]
+distrobox-export --app atom --delete
+distrobox-export --bin /usr/bin/vim --export-path \[ti]/.local/bin --delete
+distrobox-export --service syncthing --delete
+distrobox-export --service nginx --delete
+\f[R]
.fi
-.IP "" 0
-.P
-The option "\-\-sudo" will launch the exported item as root inside the distrobox\.
-.P
-Note you can use \-\-app OR \-\-bin OR \-\-service but not together\.
-.IP "" 4
+.PP
+The option \[lq]\[en]sudo\[rq] will launch the exported item as root
+inside the distrobox.
+.PP
+Note you can use \[en]app OR \[en]bin OR \[en]service but not together.
+.IP
.nf
-distrobox\-export \-\-service nginx \-\-sudo
+\f[C]
+distrobox-export --service nginx --sudo
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-app mpv [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
-distrobox\-export \-\-service syncthing [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
-distrobox\-export \-\-bin /path/to/bin \-\-export\-path ~/\.local/bin [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
+\f[C]
+distrobox-export --app mpv [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+distrobox-export --service syncthing [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+distrobox-export --bin /path/to/bin --export-path \[ti]/.local/bin [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-app/\-a: name of the application to export
-\-\-bin/\-b: absolute path of the binary to export
-\-\-service/\-s: name of the service to export
-\-\-delete/\-d: delete exported application or service
-\-\-export\-label/\-el: label to add to exported application name\.
- Defaults to (on \e$container_name)
-\-\-export\-path/\-ep: path where to export the binary
-\-\-extra\-flags/\-ef: extra flags to add to the command
-\-\-sudo/\-S: specify if the exported item should be ran as sudo
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--app/-a: name of the application to export
+--bin/-b: absolute path of the binary to export
+--service/-s: name of the service to export
+--delete/-d: delete exported application or service
+--export-label/-el: label to add to exported application name.
+ Defaults to (on \[rs]$container_name)
+--export-path/-ep: path where to export the binary
+--extra-flags/-ef: extra flags to add to the command
+--sudo/-S: specify if the exported item should be ran as sudo
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-.P
-You may want to install graphical applications or user services in your distrobox\. Using \fBdistrobox\-export\fR from \fBinside\fR the container will let you use them from the host itself\.
-.P
+.PP
+You may want to install graphical applications or user services in your
+distrobox.
+Using \f[V]distrobox-export\f[R] from \f[B]inside\f[R] the container
+will let you use them from the host itself.
+.PP
App export example:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-app abiword
+\f[C]
+distrobox-export --app abiword
+\f[R]
.fi
-.IP "" 0
-.P
-This tool will simply copy the original \fB\.desktop\fR files along with needed icons, add the prefix \fB/usr/local/bin/distrobox\-enter \-n distrobox_name \-e \|\.\|\.\|\.\fR to the commands to run, and save them in your home to be used directly from the host as a normal app\.
-.P
+.PP
+This tool will simply copy the original \f[V].desktop\f[R] files along
+with needed icons, add the prefix
+\f[V]/usr/local/bin/distrobox-enter -n distrobox_name -e ...\f[R] to the
+commands to run, and save them in your home to be used directly from the
+host as a normal app.
+.PP
Service export example:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-service syncthing \-\-extra\-flags "\-\-allow\-newer\-config"
-distrobox\-export \-\-service nginx \-\-sudo
+\f[C]
+distrobox-export --service syncthing --extra-flags \[dq]--allow-newer-config\[dq]
+distrobox-export --service nginx --sudo
+\f[R]
.fi
-.IP "" 0
-.P
-For services, it will similarly export the systemd unit inside the container to a \fBsystemctl \-\-user\fR service, prefixing the various \fBExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost\fR with the \fBdistrobox\-enter\fR command prefix\.
-.P
+.PP
+For services, it will similarly export the systemd unit inside the
+container to a \f[V]systemctl --user\f[R] service, prefixing the various
+\f[V]ExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost\f[R]
+with the \f[V]distrobox-enter\f[R] command prefix.
+.PP
Binary export example:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-bin /usr/bin/code \-\-extra\-flags "\-\-foreground" \-\-export\-path $HOME/\.local/bin
+\f[C]
+distrobox-export --bin /usr/bin/code --extra-flags \[dq]--foreground\[dq] --export-path $HOME/.local/bin
+\f[R]
.fi
-.IP "" 0
-.P
-In the case of exporting binaries, you will have to specify \fBwhere\fR to export it (\fB\-\-export\-path\fR) and the tool will create a little wrapper script that will \fBdistrobox\-enter \-e\fR from the host, the desired binary\. This can be handy with the use of \fBdirenv\fR to have different versions of the same binary based on your \fBenv\fR or project\.
-.P
-.P
-.P
-NOTE: some electron apps such as vscode and atom need additional flags to work from inside the container, use the \fB\-\-extra\-flags\fR option to provide a series of flags, for example:
-.P
-\fBdistrobox\-export \-\-app atom \-\-extra\-flags "\-\-foreground"\fR
+.PP
+In the case of exporting binaries, you will have to specify
+\f[B]where\f[R] to export it (\f[V]--export-path\f[R]) and the tool will
+create a little wrapper script that will \f[V]distrobox-enter -e\f[R]
+from the host, the desired binary.
+This can be handy with the use of \f[V]direnv\f[R] to have different
+versions of the same binary based on your \f[V]env\f[R] or project.
+.PP
+[IMAGE: app-export (https://user-images.githubusercontent.com/598882/144294795-c7785620-bf68-4d1b-b251-1e1f0a32a08d.png)]
+.PP
+[IMAGE: service-export (https://user-images.githubusercontent.com/598882/144294314-29a8921f-4511-453d-bf8e-d0d1e336db91.png)]
+.PP
+NOTE: some electron apps such as vscode and atom need additional flags
+to work from inside the container, use the \f[V]--extra-flags\f[R]
+option to provide a series of flags, for example:
+.PP
+\f[V]distrobox-export --app atom --extra-flags \[dq]--foreground\[dq]\f[R]
diff --git a/man/man1/distrobox-host-exec.1 b/man/man1/distrobox-host-exec.1
new file mode 100644
index 0000000..1fb327e
--- /dev/null
+++ b/man/man1/distrobox-host-exec.1
@@ -0,0 +1,60 @@
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-HOST-EXEC" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Host Command Execution
+.PP
+distrobox-host-exec lets one execute command on the host, while inside
+of a container.
+.PP
+If \[lq]flatpak-spawn\[rq] is installed in the container, this is what
+is used, and it is the most powerful and recommended method.
+If, instead, \[lq]flatpak-spawn\[rq] can\[cq]t be found, it still try to
+get the job done with \[lq]chroot\[rq] (but beware that not all
+commands/programs will work well in this mode).
+.PP
+Just pass to \[lq]distrobox-host-exec\[rq] any command and all its
+arguments, if any.
+.IP
+.nf
+\f[C]
+distrobox-host-exec [command [arguments]]
+\f[R]
+.fi
+.PP
+If no command is provided, it will execute \[lq]/bin/sh\[rq].
+.PP
+Example usage:
+.IP
+.nf
+\f[C]
+distrobox-host-exec ls
+distrobox-host-exec bash -l
+distrobox-host-exec flatpak run org.mozilla.firefox
+distrobox-host-exec podman ps -a
+\f[R]
+.fi
+.PP
+Options:
+.IP
+.nf
+\f[C]
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
+.fi
diff --git a/man/man1/distrobox-init.1 b/man/man1/distrobox-init.1
index b075154..a5d6fcc 100644
--- a/man/man1/distrobox-init.1
+++ b/man/man1/distrobox-init.1
@@ -1,39 +1,61 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-INIT\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-init\.1\fR
-.P
-# Init the distrobox (not to be launched manually)
-.P
-distrobox\-init is the entrypoint of a created distrobox\. Note that this HAS to run from inside a distrobox, will not work if you run it from your host\.
-.P
-This is not intended to be used manually, but instead used by distrobox\-enter to set up the container\'s entrypoint\.
-.P
-distrobox\-init will take care of installing missing dependencies (eg\. sudo), set up the user and groups, mount directories from the host to ensure the tight integration\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-INIT" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Init the distrobox (not to be launched manually)
+.PP
+distrobox-init is the entrypoint of a created distrobox.
+Note that this HAS to run from inside a distrobox, will not work if you
+run it from your host.
+.PP
+This is not intended to be used manually, but instead used by
+distrobox-enter to set up the container\[cq]s entrypoint.
+.PP
+distrobox-init will take care of installing missing dependencies (eg.
+sudo), set up the user and groups, mount directories from the host to
+ensure the tight integration.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-init \-\-name test\-user \-\-user 1000 \-\-group 1000 \-\-home /home/test\-user
+\f[C]
+distrobox-init --name test-user --user 1000 --group 1000 --home /home/test-user
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: user name
-\-\-user/\-u: uid of the user
-\-\-group/\-g: gid of the user
-\-\-home/\-d: path/to/home of the user
-\-\-help/\-h: show this message
-\-\-init/\-I: whether to use or not init
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
-\-\-: end arguments execute the rest as command to execute during init
+\f[C]
+--name/-n: user name
+--user/-u: uid of the user
+--group/-g: gid of the user
+--home/-d: path/to/home of the user
+--help/-h: show this message
+--init/-I: whether to use or not init
+--pre-init-hooks: commands to execute prior to init
+--verbose/-v: show more verbosity
+--version/-V: show version
+--: end arguments execute the rest as command to execute during init
+\f[R]
.fi
-.IP "" 0
-.P
-This is used as entrypoint for the created container, it will take care of creating the users, setting up sudo, mountpoints, and exports\.
-.P
-\fBYou should not have to launch this manually\fR, this is used by \fBdistrobox create\fR to set up container\'s entrypoint\.
+.PP
+This is used as entrypoint for the created container, it will take care
+of creating the users, setting up sudo, mountpoints, and exports.
+.PP
+\f[B]You should not have to launch this manually\f[R], this is used by
+\f[V]distrobox create\f[R] to set up container\[cq]s entrypoint.
diff --git a/man/man1/distrobox-list.1 b/man/man1/distrobox-list.1
index 3f8f634..8316db4 100644
--- a/man/man1/distrobox-list.1
+++ b/man/man1/distrobox-list.1
@@ -1,27 +1,62 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-LIST\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-list\.1\fR
-.P
-# List containers
-.P
-distrobox\-list lists available distroboxes\. It detects them and lists them separately from the rest of normal podman or docker containers\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-LIST" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH List containers
+.PP
+distrobox-list lists available distroboxes.
+It detects them and lists them separately from the rest of normal podman
+or docker containers.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-list
+\f[C]
+distrobox-list
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+You can also use environment variables to specify container manager
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] distrobox-list
+\f[R]
+.fi
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--size/-s: show also container size
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-.P
-
+.PP
+[IMAGE: image (https://user-images.githubusercontent.com/598882/147831082-24b5bc2e-b47e-49ac-9b1a-a209478c9705.png)]
diff --git a/man/man1/distrobox-rm.1 b/man/man1/distrobox-rm.1
index df82833..1eb7edb 100644
--- a/man/man1/distrobox-rm.1
+++ b/man/man1/distrobox-rm.1
@@ -1,29 +1,63 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-RM\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-rm\.1\fR
-.P
-# Remove containers
-.P
-distrobox\-rm delete one of the available distroboxes\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-RM" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Remove containers
+.PP
+distrobox-rm delete one of the available distroboxes.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-rm \-\-name container\-name [\-\-force]
-distrobox\-rm container\-name [\-f]
+\f[C]
+distrobox-rm --name container-name [--force]
+distrobox-rm container-name [-f]
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+You can also use environment variables to specify container manager and
+name:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-rm
+\f[R]
+.fi
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: name for the distrobox
-\-\-force/\-f: force deletion
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--name/-n: name for the distrobox
+--force/-f: force deletion
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-
diff --git a/man/man1/distrobox-stop.1 b/man/man1/distrobox-stop.1
index 99a18d5..11bf35f 100644
--- a/man/man1/distrobox-stop.1
+++ b/man/man1/distrobox-stop.1
@@ -1,29 +1,67 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-STOP\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-stop\.1\fR
-.P
-# Stop containers
-.P
-distrobox\-rm delete one of the available distroboxes\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-STOP" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Stop containers
+.PP
+distrobox-stop stop a running distrobox.
+.PP
+Distroboxes are left running, even after exiting out of them, so that
+subsequent enters are really quick.
+This is how they can be stopped.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-rm \-\-name container\-name
-distrobox\-rm container\-name
+\f[C]
+distrobox-stop --name container-name
+distrobox-stop container-name
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+You can also use environment variables to specify container manager and
+name:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-stop
+\f[R]
+.fi
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: name for the distrobox
-\-\-yes/\-Y: non\-interactive, stop without asking
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--name/-n: name for the distrobox
+--yes/-Y: non-interactive, stop without asking
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-
diff --git a/man/man1/distrobox.1 b/man/man1/distrobox.1
index 4afb54d..31139e3 100644
--- a/man/man1/distrobox.1
+++ b/man/man1/distrobox.1
@@ -1,594 +1,1071 @@
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-COMPATIBILITY\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-compatibility\.1\fR \- Compatibility
-.P
-This project \fBdoes not need a dedicated image\fR\. It can use any OCI images from docker\-hub, quay\.io, or any registry of your choice\.
-.P
-Granted, they may not be as featureful as expected (some of them do not even have \fBwhich\fR, \fBmount\fR, \fBless\fR or \fBvi\fR) but that\'s all doable in the container itself after bootstrapping it\.
-.P
-The main concern is having basic Linux utilities (\fBmount\fR), basic user management utilities (\fBusermod, passwd\fR), and \fBsudo\fR correctly set\.
-.SH "Supported container managers"
-\fBdistrobox\fR can run on either \fBpodman\fR or \fBdocker\fR
-.P
-It depends either on \fBpodman\fR configured in \fBrootless mode\fR or on \fBdocker\fR configured without sudo (follow THIS instructions \fIhttps://docs\.docker\.com/engine/install/linux\-postinstall/\fR)
-.IP "\[ci]" 4
-Minimum podman version: \fB2\.1\.0\fR
-.IP "\[ci]" 4
-Minimum docker version: \fB18\.06\.1\fR
-.IP "" 0
-.P
+'\" t
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Compatibility
+.PP
+This project \f[B]does not need a dedicated image\f[R].
+It can use any OCI images from docker-hub, quay.io, or any registry of
+your choice.
+.PP
+Granted, they may not be as featureful as expected (some of them do not
+even have \f[V]which\f[R], \f[V]mount\f[R], \f[V]less\f[R] or
+\f[V]vi\f[R]) but that\[cq]s all doable in the container itself after
+bootstrapping it.
+.PP
+The main concern is having basic Linux utilities (\f[V]mount\f[R]),
+basic user management utilities (\f[V]usermod, passwd\f[R]), and
+\f[V]sudo\f[R] correctly set.
+.SS Supported container managers
+.PP
+\f[V]distrobox\f[R] can run on either \f[V]podman\f[R] or
+\f[V]docker\f[R]
+.PP
+It depends either on \f[V]podman\f[R] configured in
+\f[V]rootless mode\f[R] or on \f[V]docker\f[R] configured without sudo
+(follow THIS
+instructions (https://docs.docker.com/engine/install/linux-postinstall/))
+.IP \[bu] 2
+Minimum podman version: \f[B]2.1.0\f[R]
+.IP \[bu] 2
+Minimum docker version: \f[B]18.06.1\f[R]
+.PP
Follow the official installation guide here:
-.IP "\[ci]" 4
-\fIhttps://podman\.io/getting\-started/installation\fR
-.IP "\[ci]" 4
-\fIhttps://docs\.docker\.com/engine/install\fR
-.IP "\[ci]" 4
-\fIhttps://docs\.docker\.com/engine/install/linux\-postinstall/\fR
-.IP "" 0
-.SH "Containers Distros"
-Distrobox guests tested successfully with the following container images:
+.IP \[bu] 2
+<https://podman.io/getting-started/installation>
+.IP \[bu] 2
+<https://docs.docker.com/engine/install>
+.IP \[bu] 2
+<https://docs.docker.com/engine/install/linux-postinstall/>
+.SS Containers Distros
+.PP
+Distrobox guests tested successfully with the following container
+images:
+.PP
.TS
-allbox;
-l l l.
-Distro Version Images
-AlmaLinux 8 docker\.io/library/almalinux:8
-AlmaLinux (UBI) 8 docker\.io/almalinux/8\-base
-.br
-docker\.io/almalinux/8\-init
-Alpine Linux 3\.14
-.br
-3\.15 docker\.io/library/alpine:latest
-AmazonLinux 2 docker\.io/library/amazonlinux:2\.0\.20211005\.0
-AmazonLinux 2022 public\.ecr\.aws/amazonlinux/amazonlinux:2022
-Archlinux \~ docker\.io/library/archlinux:latest
-ClearLinux \~ docker\.io/library/clearlinux:latest
-.br
-docker\.io/library/clearlinux:base
-CentOS 7 quay\.io/centos/centos:7
-CentOS Stream 8
-.br
-9 quay\.io/centos/centos:stream8
-.br
-quay\.io/centos/centos:stream9
-RedHat (UBI) 7
-.br
-8 registry\.access\.redhat\.com/ubi7/ubi
-.br
-registry\.access\.redhat\.com/ubi7/ubi\-init
-.br
-registry\.access\.redhat\.com/ubi8/ubi
-.br
-registry\.access\.redhat\.com/ubi8/ubi\-init
-Debian 7
-.br
+tab(@);
+lw(23.3n) lw(23.3n) lw(23.3n).
+T{
+Distro
+T}@T{
+Version
+T}@T{
+Images
+T}
+_
+T{
+AlmaLinux
+T}@T{
+8 8-minimal 9 9-minimal
+T}@T{
+docker.io/library/almalinux:8 docker.io/library/almalinux:9
+docker.io/library/almalinux:9-minimal
+T}
+T{
+AlmaLinux (UBI)
+T}@T{
8
-.br
-9
-.br
-10
-.br
-11 docker\.io/debian/eol:wheezy
-.br
-docker\.io/library/debian:8
-.br
-docker\.io/library/debian:9
-.br
-docker\.io/library/debian:10
-.br
-docker\.io/library/debian:stable
-.br
-docker\.io/library/debian:stable\-backports
-Debian Testing docker\.io/library/debian:testing
-.br
-docker\.io/library/debian:testing\-backports
-Debian Unstable docker\.io/library/debian:unstable
-Neurodebian nd100 docker\.io/library/neurodebian:nd100
-Fedora 34
-.br
-35
-.br
-36
-.br
-37
-.br
-Rawhide registry\.fedoraproject\.org/fedora\-toolbox:34
-.br
-docker\.io/library/fedora:34
-.br
-registry\.fedoraproject\.org/fedora\-toolbox:35
-.br
-docker\.io/library/fedora:35
-.br
-docker\.io/library/fedora:36
-.br
-registry\.fedoraproject\.org/fedora:37
-.br
-docker\.io/library/fedora:rawhide
-Mageia 8 docker\.io/library/mageia
-Opensuse Leap registry\.opensuse\.org/opensuse/leap:latest
-Opensuse Tumbleweed registry\.opensuse\.org/opensuse/tumbleweed:latest
-.br
-registry\.opensuse\.org/opensuse/toolbox:latest
-Oracle Linux 7
-.br
-8 container\-registry\.oracle\.com/os/oraclelinux:7
-.br
-container\-registry\.oracle\.com/os/oraclelinux:8
-Rocky Linux 8 docker\.io/rockylinux/rockylinux:8
-Scientific Linux 7 docker\.io/library/sl:7
-Slackware 14\.2 docker\.io/vbatts/slackware:14\.2
-Ubuntu 14\.04
-.br
-16\.04
-.br
-18\.04
-.br
-20\.04
-.br
-21\.10
-.br
-22\.04 docker\.io/library/ubuntu:14\.04
-.br
-docker\.io/library/ubuntu:16\.04
-.br
-docker\.io/library/ubuntu:18\.04
-.br
-docker\.io/library/ubuntu:20\.04
-.br
-docker\.io/library/ubuntu:21\.10
-.br
-docker\.io/library/ubuntu:22\.04
-Kali Linux rolling docker\.io/kalilinux/kali\-rolling:latest
-Void Linux \~ ghcr\.io/void\-linux/void\-linux:latest\-full\-x86_64
-.br
-ghcr\.io/void\-linux/void\-linux:latest\-full\-x86_64\-musl
-Gentoo Linux rolling You will have to Build your own \fIdistrobox_gentoo\.md\fR to have a complete Gentoo docker image
+T}@T{
+docker.io/almalinux/8-base docker.io/almalinux/8-init
+T}
+T{
+Alpine Linux
+T}@T{
+3.14 3.15
+T}@T{
+docker.io/library/alpine:latest
+T}
+T{
+AmazonLinux
+T}@T{
+2
+T}@T{
+docker.io/library/amazonlinux:2.0.20211005.0
+T}
+T{
+AmazonLinux
+T}@T{
+2022
+T}@T{
+public.ecr.aws/amazonlinux/amazonlinux:2022
+T}
+T{
+Archlinux
+T}@T{
+T}@T{
+docker.io/library/archlinux:latest
+T}
+T{
+ClearLinux
+T}@T{
+T}@T{
+docker.io/library/clearlinux:latest docker.io/library/clearlinux:base
+T}
+T{
+CentOS
+T}@T{
+7
+T}@T{
+quay.io/centos/centos:7
+T}
+T{
+CentOS Stream
+T}@T{
+8 9
+T}@T{
+quay.io/centos/centos:stream8 quay.io/centos/centos:stream9
+T}
+T{
+RedHat (UBI)
+T}@T{
+7 8 9
+T}@T{
+registry.access.redhat.com/ubi7/ubi
+registry.access.redhat.com/ubi7/ubi-init
+registry.access.redhat.com/ubi7/ubi-minimal
+registry.access.redhat.com/ubi8/ubi
+registry.access.redhat.com/ubi8/ubi-init
+registry.access.redhat.com/ubi8/ubi-minimal
+registry.access.redhat.com/ubi9/ubi
+registry.access.redhat.com/ubi9/ubi-init
+registry.access.redhat.com/ubi9/ubi-minimal
+T}
+T{
+Debian
+T}@T{
+7 8 9 10 11
+T}@T{
+docker.io/debian/eol:wheezy docker.io/library/debian:8
+docker.io/library/debian:9 docker.io/library/debian:10
+docker.io/library/debian:stable
+docker.io/library/debian:stable-backports
+T}
+T{
+Debian
+T}@T{
+Testing
+T}@T{
+docker.io/library/debian:testing
+docker.io/library/debian:testing-backports
+T}
+T{
+Debian
+T}@T{
+Unstable
+T}@T{
+docker.io/library/debian:unstable
+T}
+T{
+Neurodebian
+T}@T{
+nd100
+T}@T{
+docker.io/library/neurodebian:nd100
+T}
+T{
+Fedora
+T}@T{
+34 35 36 37 Rawhide
+T}@T{
+registry.fedoraproject.org/fedora-toolbox:34 docker.io/library/fedora:34
+registry.fedoraproject.org/fedora-toolbox:35 docker.io/library/fedora:35
+docker.io/library/fedora:36 registry.fedoraproject.org/fedora:37
+docker.io/library/fedora:rawhide
+T}
+T{
+Mageia
+T}@T{
+8
+T}@T{
+docker.io/library/mageia
+T}
+T{
+Opensuse
+T}@T{
+Leap
+T}@T{
+registry.opensuse.org/opensuse/leap:latest
+T}
+T{
+Opensuse
+T}@T{
+Tumbleweed
+T}@T{
+registry.opensuse.org/opensuse/tumbleweed:latest
+registry.opensuse.org/opensuse/toolbox:latest
+T}
+T{
+Oracle Linux
+T}@T{
+7 8
+T}@T{
+container-registry.oracle.com/os/oraclelinux:7
+container-registry.oracle.com/os/oraclelinux:8
+T}
+T{
+Rocky Linux
+T}@T{
+8
+T}@T{
+docker.io/rockylinux/rockylinux:8
+T}
+T{
+Scientific Linux
+T}@T{
+7
+T}@T{
+docker.io/library/sl:7
+T}
+T{
+Slackware
+T}@T{
+14.2
+T}@T{
+docker.io/vbatts/slackware:14.2
+T}
+T{
+Ubuntu
+T}@T{
+14.04 16.04 18.04 20.04 21.10 22.04
+T}@T{
+docker.io/library/ubuntu:14.04 docker.io/library/ubuntu:16.04
+docker.io/library/ubuntu:18.04 docker.io/library/ubuntu:20.04
+docker.io/library/ubuntu:21.10 docker.io/library/ubuntu:22.04
+T}
+T{
+Kali Linux
+T}@T{
+rolling
+T}@T{
+docker.io/kalilinux/kali-rolling:latest
+T}
+T{
+Void Linux
+T}@T{
+T}@T{
+ghcr.io/void-linux/void-linux:latest-full-x86_64
+ghcr.io/void-linux/void-linux:latest-full-x86_64-musl
+T}
+T{
+Gentoo Linux
+T}@T{
+rolling
+T}@T{
+You will have to Build your own to have a complete Gentoo docker image
+T}
.TE
-.P
-Note however that if you use a non\-toolbox preconfigured image (e\.g\. images pre\-baked to work with \fIhttps://github\.com/containers/toolbox),\fR the \fBfirst\fR \fBdistrobox\-enter\fR you\'ll perform can take a while as it will download and install the missing dependencies\.
-.P
-A small time tax to pay for the ability to use any type of image\. This will \fBnot\fR occur after the first time, \fBsubsequent enters will be much faster\.\fR
-.P
-NixOS is not a supported container distro, and there are currently no plans to bring support to it\. If you are looking for unprivlaged NixOS environments, we suggest you look into nix\-shell \fIhttps://nixos\.org/manual/nix/unstable/command\-ref/nix\-shell\.html\fR\.
-.SS "New Distro support"
-If your distro of choice is not on the list, open an issue requesting support for it, we can work together to check if it is possible to add support for it\.
-.P
-Or just try using it anyway, if it works, open an issue and it will be added to the list!
-.SS "Older distributions"
-For older distributions like CentOS 5, CentOS 6, Debian 6, Ubuntu 12\.04, compatibility is not assured\.
-.P
-Their \fBlibc\fR version is incompatible with kernel releases after \fB>=4\.11\fR\. A work around this is to use the \fBvsyscall=emulate\fR flag in the bootloader of the host\.
-.P
-Keep also in mind that mirrors could be down for such old releases, so you will need to build a custom distrobox image to ensure basic dependencies are met \fI\./distrobox_custom\.md\fR\.
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-CREATE\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-create\.1\fR
-.P
-# Create the distrobox
-.P
-distrobox\-create takes care of creating the container with input name and image\. The created container will be tightly integrated with the host, allowing sharing of the HOME directory of the user, external storage, external usb devices and graphical apps (X11/Wayland), and audio\.
-.P
+.PP
+Note however that if you use a non-toolbox preconfigured image (e.g.
+images pre-baked to work with <https://github.com/containers/toolbox),>
+the \f[B]first\f[R] \f[V]distrobox-enter\f[R] you\[cq]ll perform can
+take a while as it will download and install the missing dependencies.
+.PP
+A small time tax to pay for the ability to use any type of image.
+This will \f[B]not\f[R] occur after the first time, \f[B]subsequent
+enters will be much faster.\f[R]
+.PP
+NixOS is not a supported container distro, and there are currently no
+plans to bring support to it.
+If you are looking for unprivlaged NixOS environments, we suggest you
+look into
+nix-shell (https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html).
+.SS New Distro support
+.PP
+If your distro of choice is not on the list, open an issue requesting
+support for it, we can work together to check if it is possible to add
+support for it.
+.PP
+Or just try using it anyway, if it works, open an issue and it will be
+added to the list!
+.SS Older distributions
+.PP
+For older distributions like CentOS 5, CentOS 6, Debian 6, Ubuntu 12.04,
+compatibility is not assured.
+.PP
+Their \f[V]libc\f[R] version is incompatible with kernel releases after
+\f[V]>=4.11\f[R].
+A work around this is to use the \f[V]vsyscall=emulate\f[R] flag in the
+bootloader of the host.
+.PP
+Keep also in mind that mirrors could be down for such old releases, so
+you will need to build a custom distrobox image to ensure basic
+dependencies are met.
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-CREATE" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Create the distrobox
+.PP
+distrobox-create takes care of creating the container with input name
+and image.
+The created container will be tightly integrated with the host, allowing
+sharing of the HOME directory of the user, external storage, external
+usb devices and graphical apps (X11/Wayland), and audio.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-create \-\-image registry\.fedoraproject\.org/fedora\-toolbox:35 \-\-name fedora\-toolbox\-35
-distrobox\-create \-\-clone fedora\-toolbox\-35 \-\-name fedora\-toolbox\-35\-copy
-distrobox\-create \-\-image alpine my\-alpine\-container
-distrobox create \-\-image fedora:35 \-\-name test \-\-volume /opt/my\-dir:/usr/local/my\-dir:rw \-\-additional\-flags "\-\-pids\-limit \-1"
-distrobox create \-\-image fedora:35 \-\-name test \-\-additional\-flags "\-\-env MY_VAR\-value"
-distrobox create \-\-image alpine:latest \-\-name test \-\-init\-hooks "touch /var/tmp/test1 && touch /var/tmp/test2"
-distrobox create \-i docker\.io/almalinux/8\-init \-\-init \-\-name test
+\f[C]
+distrobox create --image alpine:latest --name test --init-hooks \[dq]touch /var/tmp/test1 && touch /var/tmp/test2\[dq]
+distrobox create --image fedora:35 --name test --additional-flags \[dq]--env MY_VAR-value\[dq]
+distrobox create --image fedora:35 --name test --volume /opt/my-dir:/usr/local/my-dir:rw --additional-flags \[dq]--pids-limit -1\[dq]
+distrobox create -i docker.io/almalinux/8-init --init --name test --pre-init-hooks \[dq]dnf config-manager --enable powertools && dnf -y install epel-release\[dq]
+distrobox create --clone fedora-35 --name fedora-35-copy
+distrobox create --image alpine my-alpine-container
+distrobox create --image registry.fedoraproject.org/fedora-toolbox:35 --name fedora-toolbox-35
+distrobox create --pull --image centos:stream9 --home \[ti]/distrobox/centos9
+\f[R]
.fi
-.IP "" 0
-.P
-You can also use environment variables to specify container name and image
-.IP "" 4
+.PP
+You can also use environment variables to specify container name, image
+and container manager:
+.IP
.nf
-DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test\-alpine DBX_CONTAINER_IMAGE=alpine distrobox\-create
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_NON_INTERACTIVE=1 DBX_CONTAINER_NAME=test-alpine DBX_CONTAINER_IMAGE=alpine distrobox-create
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Supported environment variables:
-.IP "" 4
+.IP
.nf
-DBX_NON_INTERACTIVE
-DBX_CONTAINER_NAME
+\f[C]
+DBX_CONTAINER_ALWAYS_PULL
+DBX_CONTAINER_CUSTOM_HOME
DBX_CONTAINER_IMAGE
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
-.nf
-\-\-image/\-i: image to use for the container default: registry\.fedoraproject\.org/fedora\-toolbox:35
-\-\-name/\-n: name for the distrobox default: fedora\-toolbox\-35
-\-\-yes/\-Y: non\-interactive, pull images without asking
-\-\-clone/\-c: name of the distrobox container to use as base for a new container
- this will be useful to either rename an existing distrobox or have multiple copies
- of the same environment\.
-\-\-home/\-H select a custom HOME directory for the container\. Useful to avoid host\'s home littering with temp files\.
-\-\-volume additional volumes to add to the container
-\-\-additional\-flags/\-a: additional flags to pass to the container manager command
-\-\-init\-hooks additional commands to execute during container initialization
-\-\-init/\-I use init system (like systemd) inside the container\.
- this will make host\'s processes not visible from within the container\.
-\-\-help/\-h: show this message
-\-\-dry\-run/\-d: only print the container manager command generated
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
-.fi
-.IP "" 0
-.P
+.IP
+.nf
+\f[C]
+--image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:36
+--name/-n: name for the distrobox default: my-distrobox
+--pull/-p: pull latest image unconditionally without asking
+--yes/-Y: non-interactive, pull images without asking
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--clone/-c: name of the distrobox container to use as base for a new container
+ this will be useful to either rename an existing distrobox or have multiple copies
+ of the same environment.
+--home/-H select a custom HOME directory for the container. Useful to avoid host\[aq]s home littering with temp files.
+--volume additional volumes to add to the container
+--additional-flags/-a: additional flags to pass to the container manager command
+--init-hooks additional commands to execute during container initialization
+--pre-init-hooks additional commands to execute prior to container initialization
+--init/-I use init system (like systemd) inside the container.
+ this will make host\[aq]s processes not visible from within the container.
+--help/-h: show this message
+--dry-run/-d: only print the container manager command generated
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
+.fi
+.PP
Compatibility:
-.IP "" 4
+.IP
.nf
+\f[C]
for a list of compatible images and container managers, please consult the man page:
- man distrobox
- man distrobox\-compatibility
-or consult the documentation page on: https://github\.com/89luca89/distrobox/blob/main/docs/compatibility\.md#containers\-distros
+ man distrobox
+ man distrobox-compatibility
+or consult the documentation page on: https://github.com/89luca89/distrobox/blob/main/docs/compatibility.md#containers-distros
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-additional\-flags\fR or \fB\-a\fR is useful to modify defaults in the container creations\. For example:
-.IP "" 4
+.PP
+The \f[V]--additional-flags\f[R] or \f[V]-a\f[R] is useful to modify
+defaults in the container creations.
+For example:
+.IP
.nf
-distrobox create \-i docker\.io/library/archlinux \-n dev\-arch
+\f[C]
+distrobox create -i docker.io/library/archlinux -n dev-arch
-podman container inspect dev\-arch | jq \'\.[0]\.HostConfig\.PidsLimit\'
+podman container inspect dev-arch | jq \[aq].[0].HostConfig.PidsLimit\[aq]
2048
-distrobox rm \-f dev\-arch
-distrobox create \-i docker\.io/library/archlinux \-n dev\-arch \-\-volume $CBL_TC:/tc \-\-additional\-flags "\-\-pids\-limit \-1"
+distrobox rm -f dev-arch
+distrobox create -i docker.io/library/archlinux -n dev-arch --volume $CBL_TC:/tc --additional-flags \[dq]--pids-limit -1\[dq]
-podman container inspect dev\-arch | jq \'\.[0]\.HostConfig,\.PidsLimit\'
+podman container inspect dev-arch | jq \[aq].[0].HostConfig,.PidsLimit\[aq]
0
+\f[R]
.fi
-.IP "" 0
-.P
-Additional volumes can be specified using the \fB\-\-volume\fR flag\. This flag follows the same standard as \fBdocker\fR and \fBpodman\fR to specify the mount point so \fB\-\-volume SOURCE_PATH:DEST_PATH:MODE\fR\.
-.IP "" 4
+.PP
+Additional volumes can be specified using the \f[V]--volume\f[R] flag.
+This flag follows the same standard as \f[V]docker\f[R] and
+\f[V]podman\f[R] to specify the mount point so
+\f[V]--volume SOURCE_PATH:DEST_PATH:MODE\f[R].
+.IP
.nf
-distrobox create \-\-image docker\.io/library/archlinux \-\-name dev\-arch \-\-volume /usr/share/:/var/test:ro
+\f[C]
+distrobox create --image docker.io/library/archlinux --name dev-arch --volume /usr/share/:/var/test:ro
+\f[R]
.fi
-.IP "" 0
-.P
-During container creation, it is possible to specify (using the additional\-flags) some environment variables that will persist in the container and be independent from your environment:
-.IP "" 4
+.PP
+During container creation, it is possible to specify (using the
+additional-flags) some environment variables that will persist in the
+container and be independent from your environment:
+.IP
.nf
-distrobox create \-\-image fedora:35 \-\-name test \-\-additional\-flags "\-\-env MY_VAR\-value"
+\f[C]
+distrobox create --image fedora:35 --name test --additional-flags \[dq]--env MY_VAR-value\[dq]
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-init\-hooks\fR is useful to add commands to the entrypoint (init) of the container\. This could be useful to create containers with a set of programs already installed, add users, groups\.
-.IP "" 4
+.PP
+The \f[V]--init-hooks\f[R] is useful to add commands to the entrypoint
+(init) of the container.
+This could be useful to create containers with a set of programs already
+installed, add users, groups.
+.IP
.nf
-distrobox create \-\-image fedora:35 \-\-name test \-\-init\-hooks "dnf groupinstall \-y \e"C Development Tools and Libraries\e""
+\f[C]
+distrobox create --image fedora:35 --name test --init-hooks \[dq]dnf groupinstall -y \[rs]\[dq]C Development Tools and Libraries\[rs]\[dq]\[dq]
+\f[R]
.fi
-.IP "" 0
-.P
-The \fB\-\-init\fR is useful to create a container that will use its own separate init system within\. For example using:
-.IP "" 4
+.PP
+The \f[V]--init\f[R] is useful to create a container that will use its
+own separate init system within.
+For example using:
+.IP
.nf
-distrobox create \-i docker\.io/almalinux/8\-init \-\-init\-hooks "dnf install \-y openssh\-server" \-\-init \-\-name test
+\f[C]
+distrobox create -i docker.io/almalinux/8-init --init-hooks \[dq]dnf install -y openssh-server\[dq] --init --name test
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Inside the container we will be able to use normal systemd units:
-.IP "" 4
-.nf
-~$ distrobox enter test
-user at test:~$ sudo systemctl enable \-\-now sshd
-user at test:~$ sudo systemctl status sshd
- ● sshd\.service \- OpenSSH server daemon
- Loaded: loaded (/usr/lib/systemd/system/sshd\.service; enabled; vendor preset: enabled)
- Active: active (running) since Fri 2022\-01\-28 22:54:50 CET; 17s ago
- Docs: man:sshd(8)
- man:sshd_config(5)
- Main PID: 291 (sshd)
-.fi
-.IP "" 0
-.P
-Note that enabling \fB\-\-init\fR \fBwill disable host\'s process integration\fR\. From within the container you will not be able to see and manage host\'s processes\. This is needed because \fB/sbin/init\fR must be pid 1\.
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-ENTER\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-enter\.1\fR
-.P
-# Enter the distrobox
-.P
-distrobox\-enter takes care of entering the container with the name specified\. Default command executed is your SHELL, but you can specify different shells or entire commands to execute\. If using it inside a script, an application, or a service, you can specify the \-\-headless mode to disable tty and interactivity\.
-.P
+.IP
+.nf
+\f[C]
+\[ti]$ distrobox enter test
+user\[at]test:\[ti]$ sudo systemctl enable --now sshd
+user\[at]test:\[ti]$ sudo systemctl status sshd
+ \[u25CF] sshd.service - OpenSSH server daemon
+ Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
+ Active: active (running) since Fri 2022-01-28 22:54:50 CET; 17s ago
+ Docs: man:sshd(8)
+ man:sshd_config(5)
+ Main PID: 291 (sshd)
+\f[R]
+.fi
+.PP
+Note that enabling \f[V]--init\f[R] \f[B]will disable host\[cq]s process
+integration\f[R].
+From within the container you will not be able to see and manage
+host\[cq]s processes.
+This is needed because \f[V]/sbin/init\f[R] must be pid 1.
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-ENTER" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Enter the distrobox
+.PP
+distrobox-enter takes care of entering the container with the name
+specified.
+Default command executed is your SHELL, but you can specify different
+shells or entire commands to execute.
+If using it inside a script, an application, or a service, you can
+specify the \[en]headless mode to disable tty and interactivity.
+.PP
Usage:
-.IP "" 4
+.IP
+.nf
+\f[C]
+distrobox-enter --name fedora-toolbox-35 -- bash -l
+distrobox-enter my-alpine-container -- sh -l
+distrobox-enter --additional-flags \[dq]--preserve-fds\[dq] --name test -- bash -l
+distrobox-enter --additional-flags \[dq]--env MY_VAR=value\[dq] --name test -- bash -l
+MY_VAR=value distrobox-enter --additional-flags \[dq]--preserve-fds\[dq] --name test -- bash -l
+\f[R]
+.fi
+.PP
+You can also use environment variables to specify container manager and
+container name:
+.IP
.nf
-distrobox\-enter \-\-name fedora\-toolbox\-35 \-\- bash \-l
-distrobox\-enter my\-alpine\-container \-\- sh \-l
-distrobox\-enter \-\-additional\-flags "\-\-preserve\-fds" \-\-name test \-\- bash \-l
-distrobox\-enter \-\-additional\-flags "\-\-env MY_VAR=value" \-\-name test \-\- bash \-l
-MY_VAR=value distrobox\-enter \-\-additional\-flags "\-\-preserve\-fds" \-\-name test \-\- bash \-l
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-enter
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Supported environment variables:
-.IP "" 4
+.IP
.nf
+\f[C]
DBX_CONTAINER_NAME
+DBX_CONTAINER_MANAGER
+DBX_SKIP_WORKDIR
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
-.nf
-\-\-name/\-n: name for the distrobox default: fedora\-toolbox\-35
-\-\-/\-e: end arguments execute the rest as command to execute at login default: bash \-l
-\-\-no\-tty/\-T: do not instantiate a tty
-\-\-additional\-flags/\-a: additional flags to pass to the container manager command
-\-\-help/\-h: show this message
-\-\-dry\-run/\-d: only print the container manager command generated
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
-.fi
-.IP "" 0
-.P
-This is used to enter the distrobox itself\. Personally, I just create multiple profiles in my \fBgnome\-terminal\fR to have multiple distros accessible\.
-.P
-The \fB\-\-additional\-flags\fR or \fB\-a\fR is useful to modify default command when executing in the container\. For example:
-.IP "" 4
-.nf
-distrobox enter \-n dev\-arch \-\-additional\-flags "\-\-env my_var=test" \-\- printenv &| grep my_var
+.IP
+.nf
+\f[C]
+--name/-n: name for the distrobox default: my-distrobox
+--/-e: end arguments execute the rest as command to execute at login default: bash -l
+--no-tty/-T: do not instantiate a tty
+--no-workdir/-nw: always start the container from container\[aq]s home directory
+--additional-flags/-a: additional flags to pass to the container manager command
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--dry-run/-d: only print the container manager command generated
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
+.fi
+.PP
+This is used to enter the distrobox itself.
+Personally, I just create multiple profiles in my
+\f[V]gnome-terminal\f[R] to have multiple distros accessible.
+.PP
+The \f[V]--additional-flags\f[R] or \f[V]-a\f[R] is useful to modify
+default command when executing in the container.
+For example:
+.IP
+.nf
+\f[C]
+distrobox enter -n dev-arch --additional-flags \[dq]--env my_var=test\[dq] -- printenv &| grep my_var
my_var=test
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
This is possible also using normal env variables:
-.IP "" 4
+.IP
.nf
-my_var=test distrobox enter \-n dev\-arch \-\-additional\-flags \-\- printenv &| grep my_var
+\f[C]
+my_var=test distrobox enter -n dev-arch --additional-flags -- printenv &| grep my_var
my_var=test
+\f[R]
.fi
-.IP "" 0
-
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-EXPORT\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-export\.1\fR
-.P
-# Application and service exporting
-.P
-distrobox\-export takes care of exporting an app a binary or a service from the container to the host\.
-.P
-The exported app will be easily available in your normal launcher and it will automatically be launched from the container it is exported from\.
-.P
-The exported services will be available in the host\'s user\'s systemd session, so
-.IP "" 4
-.nf
-systemctl \-\-user status exported_service_name
-.fi
-.IP "" 0
-.P
-will show the status of the service exported\.
-.P
-The exported binaries will be exported in the "\-\-export\-path" of choice as a wrapper script that acts naturally both on the host and in the container\. Note that "\-\-export\-path" is NOT OPTIONAL, you have to explicitly set it\.
-.P
-You can specify additional flags to add to the command, for example if you want to export an electron app, you could add the "\-\-foreground" flag to the command:
-.IP "" 4
-.nf
-distrobox\-export \-\-app atom \-\-extra\-flags "\-\-foreground"
-distrobox\-export \-\-bin /usr/bin/vim \-\-export\-path ~/\.local/bin \-\-extra\-flags "\-p"
-distrobox\-export \-\-service syncthing \-\-extra\-flags "\-allow\-newer\-config"
-.fi
-.IP "" 0
-.P
-This works for services, binaries, and apps\. Extra flags are only used then the exported app, binary, or service is used from the host, using them inside the container will not include them\.
-.P
-The option "\-\-delete" will un\-export an app, binary, or service\.
-.IP "" 4
-.nf
-distrobox\-export \-\-app atom \-\-delete
-distrobox\-export \-\-bin /usr/bin/vim \-\-export\-path ~/\.local/bin \-\-delete
-distrobox\-export \-\-service syncthing \-\-delete
-distrobox\-export \-\-service nginx \-\-delete
-.fi
-.IP "" 0
-.P
-The option "\-\-sudo" will launch the exported item as root inside the distrobox\.
-.P
-Note you can use \-\-app OR \-\-bin OR \-\-service but not together\.
-.IP "" 4
-.nf
-distrobox\-export \-\-service nginx \-\-sudo
-.fi
-.IP "" 0
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-EXPORT" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Application and service exporting
+.PP
+distrobox-export takes care of exporting an app a binary or a service
+from the container to the host.
+.PP
+The exported app will be easily available in your normal launcher and it
+will automatically be launched from the container it is exported from.
+.PP
+The exported services will be available in the host\[cq]s user\[cq]s
+systemd session, so
+.IP
+.nf
+\f[C]
+systemctl --user status exported_service_name
+\f[R]
+.fi
+.PP
+will show the status of the service exported.
+.PP
+The exported binaries will be exported in the \[lq]\[en]export-path\[rq]
+of choice as a wrapper script that acts naturally both on the host and
+in the container.
+Note that \[lq]\[en]export-path\[rq] is NOT OPTIONAL, you have to
+explicitly set it.
+.PP
+You can specify additional flags to add to the command, for example if
+you want to export an electron app, you could add the
+\[lq]\[en]foreground\[rq] flag to the command:
+.IP
+.nf
+\f[C]
+distrobox-export --app atom --extra-flags \[dq]--foreground\[dq]
+distrobox-export --bin /usr/bin/vim --export-path \[ti]/.local/bin --extra-flags \[dq]-p\[dq]
+distrobox-export --service syncthing --extra-flags \[dq]-allow-newer-config\[dq]
+\f[R]
+.fi
+.PP
+This works for services, binaries, and apps.
+Extra flags are only used then the exported app, binary, or service is
+used from the host, using them inside the container will not include
+them.
+.PP
+The option \[lq]\[en]delete\[rq] will un-export an app, binary, or
+service.
+.IP
+.nf
+\f[C]
+distrobox-export --app atom --delete
+distrobox-export --bin /usr/bin/vim --export-path \[ti]/.local/bin --delete
+distrobox-export --service syncthing --delete
+distrobox-export --service nginx --delete
+\f[R]
+.fi
+.PP
+The option \[lq]\[en]sudo\[rq] will launch the exported item as root
+inside the distrobox.
+.PP
+Note you can use \[en]app OR \[en]bin OR \[en]service but not together.
+.IP
+.nf
+\f[C]
+distrobox-export --service nginx --sudo
+\f[R]
+.fi
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-app mpv [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
-distrobox\-export \-\-service syncthing [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
-distrobox\-export \-\-bin /path/to/bin \-\-export\-path ~/\.local/bin [\-\-extra\-flags "flags"] [\-\-delete] [\-\-sudo]
+\f[C]
+distrobox-export --app mpv [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+distrobox-export --service syncthing [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+distrobox-export --bin /path/to/bin --export-path \[ti]/.local/bin [--extra-flags \[dq]flags\[dq]] [--delete] [--sudo]
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
-.nf
-\-\-app/\-a: name of the application to export
-\-\-bin/\-b: absolute path of the binary to export
-\-\-service/\-s: name of the service to export
-\-\-delete/\-d: delete exported application or service
-\-\-export\-label/\-el: label to add to exported application name\.
- Defaults to (on \e$container_name)
-\-\-export\-path/\-ep: path where to export the binary
-\-\-extra\-flags/\-ef: extra flags to add to the command
-\-\-sudo/\-S: specify if the exported item should be ran as sudo
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
-.fi
-.IP "" 0
-.P
-You may want to install graphical applications or user services in your distrobox\. Using \fBdistrobox\-export\fR from \fBinside\fR the container will let you use them from the host itself\.
-.P
+.IP
+.nf
+\f[C]
+--app/-a: name of the application to export
+--bin/-b: absolute path of the binary to export
+--service/-s: name of the service to export
+--delete/-d: delete exported application or service
+--export-label/-el: label to add to exported application name.
+ Defaults to (on \[rs]$container_name)
+--export-path/-ep: path where to export the binary
+--extra-flags/-ef: extra flags to add to the command
+--sudo/-S: specify if the exported item should be ran as sudo
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
+.fi
+.PP
+You may want to install graphical applications or user services in your
+distrobox.
+Using \f[V]distrobox-export\f[R] from \f[B]inside\f[R] the container
+will let you use them from the host itself.
+.PP
App export example:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-app abiword
+\f[C]
+distrobox-export --app abiword
+\f[R]
.fi
-.IP "" 0
-.P
-This tool will simply copy the original \fB\.desktop\fR files along with needed icons, add the prefix \fB/usr/local/bin/distrobox\-enter \-n distrobox_name \-e \|\.\|\.\|\.\fR to the commands to run, and save them in your home to be used directly from the host as a normal app\.
-.P
+.PP
+This tool will simply copy the original \f[V].desktop\f[R] files along
+with needed icons, add the prefix
+\f[V]/usr/local/bin/distrobox-enter -n distrobox_name -e ...\f[R] to the
+commands to run, and save them in your home to be used directly from the
+host as a normal app.
+.PP
Service export example:
-.IP "" 4
+.IP
.nf
-distrobox\-export \-\-service syncthing \-\-extra\-flags "\-\-allow\-newer\-config"
-distrobox\-export \-\-service nginx \-\-sudo
+\f[C]
+distrobox-export --service syncthing --extra-flags \[dq]--allow-newer-config\[dq]
+distrobox-export --service nginx --sudo
+\f[R]
.fi
-.IP "" 0
-.P
-For services, it will similarly export the systemd unit inside the container to a \fBsystemctl \-\-user\fR service, prefixing the various \fBExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost\fR with the \fBdistrobox\-enter\fR command prefix\.
-.P
+.PP
+For services, it will similarly export the systemd unit inside the
+container to a \f[V]systemctl --user\f[R] service, prefixing the various
+\f[V]ExecStart ExecStartPre ExecStartPost ExecReload ExecStop ExecStopPost\f[R]
+with the \f[V]distrobox-enter\f[R] command prefix.
+.PP
Binary export example:
-.IP "" 4
-.nf
-distrobox\-export \-\-bin /usr/bin/code \-\-extra\-flags "\-\-foreground" \-\-export\-path $HOME/\.local/bin
-.fi
-.IP "" 0
-.P
-In the case of exporting binaries, you will have to specify \fBwhere\fR to export it (\fB\-\-export\-path\fR) and the tool will create a little wrapper script that will \fBdistrobox\-enter \-e\fR from the host, the desired binary\. This can be handy with the use of \fBdirenv\fR to have different versions of the same binary based on your \fBenv\fR or project\.
-.P
-.P
-.P
-NOTE: some electron apps such as vscode and atom need additional flags to work from inside the container, use the \fB\-\-extra\-flags\fR option to provide a series of flags, for example:
-.P
-\fBdistrobox\-export \-\-app atom \-\-extra\-flags "\-\-foreground"\fR
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-INIT\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-init\.1\fR
-.P
-# Init the distrobox (not to be launched manually)
-.P
-distrobox\-init is the entrypoint of a created distrobox\. Note that this HAS to run from inside a distrobox, will not work if you run it from your host\.
-.P
-This is not intended to be used manually, but instead used by distrobox\-enter to set up the container\'s entrypoint\.
-.P
-distrobox\-init will take care of installing missing dependencies (eg\. sudo), set up the user and groups, mount directories from the host to ensure the tight integration\.
-.P
+.IP
+.nf
+\f[C]
+distrobox-export --bin /usr/bin/code --extra-flags \[dq]--foreground\[dq] --export-path $HOME/.local/bin
+\f[R]
+.fi
+.PP
+In the case of exporting binaries, you will have to specify
+\f[B]where\f[R] to export it (\f[V]--export-path\f[R]) and the tool will
+create a little wrapper script that will \f[V]distrobox-enter -e\f[R]
+from the host, the desired binary.
+This can be handy with the use of \f[V]direnv\f[R] to have different
+versions of the same binary based on your \f[V]env\f[R] or project.
+.PP
+[IMAGE: app-export (https://user-images.githubusercontent.com/598882/144294795-c7785620-bf68-4d1b-b251-1e1f0a32a08d.png)]
+.PP
+[IMAGE: service-export (https://user-images.githubusercontent.com/598882/144294314-29a8921f-4511-453d-bf8e-d0d1e336db91.png)]
+.PP
+NOTE: some electron apps such as vscode and atom need additional flags
+to work from inside the container, use the \f[V]--extra-flags\f[R]
+option to provide a series of flags, for example:
+.PP
+\f[V]distrobox-export --app atom --extra-flags \[dq]--foreground\[dq]\f[R]
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-HOST-EXEC" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Host Command Execution
+.PP
+distrobox-host-exec lets one execute command on the host, while inside
+of a container.
+.PP
+If \[lq]flatpak-spawn\[rq] is installed in the container, this is what
+is used, and it is the most powerful and recommended method.
+If, instead, \[lq]flatpak-spawn\[rq] can\[cq]t be found, it still try to
+get the job done with \[lq]chroot\[rq] (but beware that not all
+commands/programs will work well in this mode).
+.PP
+Just pass to \[lq]distrobox-host-exec\[rq] any command and all its
+arguments, if any.
+.IP
+.nf
+\f[C]
+distrobox-host-exec [command [arguments]]
+\f[R]
+.fi
+.PP
+If no command is provided, it will execute \[lq]/bin/sh\[rq].
+.PP
+Example usage:
+.IP
+.nf
+\f[C]
+distrobox-host-exec ls
+distrobox-host-exec bash -l
+distrobox-host-exec flatpak run org.mozilla.firefox
+distrobox-host-exec podman ps -a
+\f[R]
+.fi
+.PP
+Options:
+.IP
+.nf
+\f[C]
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
+.fi
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-INIT" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Init the distrobox (not to be launched manually)
+.PP
+distrobox-init is the entrypoint of a created distrobox.
+Note that this HAS to run from inside a distrobox, will not work if you
+run it from your host.
+.PP
+This is not intended to be used manually, but instead used by
+distrobox-enter to set up the container\[cq]s entrypoint.
+.PP
+distrobox-init will take care of installing missing dependencies (eg.
+sudo), set up the user and groups, mount directories from the host to
+ensure the tight integration.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-init \-\-name test\-user \-\-user 1000 \-\-group 1000 \-\-home /home/test\-user
+\f[C]
+distrobox-init --name test-user --user 1000 --group 1000 --home /home/test-user
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
Options:
-.IP "" 4
-.nf
-\-\-name/\-n: user name
-\-\-user/\-u: uid of the user
-\-\-group/\-g: gid of the user
-\-\-home/\-d: path/to/home of the user
-\-\-help/\-h: show this message
-\-\-init/\-I: whether to use or not init
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
-\-\-: end arguments execute the rest as command to execute during init
-.fi
-.IP "" 0
-.P
-This is used as entrypoint for the created container, it will take care of creating the users, setting up sudo, mountpoints, and exports\.
-.P
-\fBYou should not have to launch this manually\fR, this is used by \fBdistrobox create\fR to set up container\'s entrypoint\.
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-LIST\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-list\.1\fR
-.P
-# List containers
-.P
-distrobox\-list lists available distroboxes\. It detects them and lists them separately from the rest of normal podman or docker containers\.
-.P
+.IP
+.nf
+\f[C]
+--name/-n: user name
+--user/-u: uid of the user
+--group/-g: gid of the user
+--home/-d: path/to/home of the user
+--help/-h: show this message
+--init/-I: whether to use or not init
+--pre-init-hooks: commands to execute prior to init
+--verbose/-v: show more verbosity
+--version/-V: show version
+--: end arguments execute the rest as command to execute during init
+\f[R]
+.fi
+.PP
+This is used as entrypoint for the created container, it will take care
+of creating the users, setting up sudo, mountpoints, and exports.
+.PP
+\f[B]You should not have to launch this manually\f[R], this is used by
+\f[V]distrobox create\f[R] to set up container\[cq]s entrypoint.
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-LIST" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH List containers
+.PP
+distrobox-list lists available distroboxes.
+It detects them and lists them separately from the rest of normal podman
+or docker containers.
+.PP
Usage:
-.IP "" 4
+.IP
.nf
-distrobox\-list
+\f[C]
+distrobox-list
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+You can also use environment variables to specify container manager
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] distrobox-list
+\f[R]
+.fi
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--size/-s: show also container size
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-.P
-
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-RM\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-rm\.1\fR
-.P
-# Remove containers
-.P
-distrobox\-rm delete one of the available distroboxes\.
-.P
+.PP
+[IMAGE: image (https://user-images.githubusercontent.com/598882/147831082-24b5bc2e-b47e-49ac-9b1a-a209478c9705.png)]
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-RM" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Remove containers
+.PP
+distrobox-rm delete one of the available distroboxes.
+.PP
Usage:
-.IP "" 4
+.IP
+.nf
+\f[C]
+distrobox-rm --name container-name [--force]
+distrobox-rm container-name [-f]
+\f[R]
+.fi
+.PP
+You can also use environment variables to specify container manager and
+name:
+.IP
.nf
-distrobox\-rm \-\-name container\-name [\-\-force]
-distrobox\-rm container\-name [\-f]
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-rm
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: name for the distrobox
-\-\-force/\-f: force deletion
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--name/-n: name for the distrobox
+--force/-f: force deletion
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--help/-h: show this message
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-
-.\" generated with Ronn-NG/v0.9.1
-.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
-.TH "DISTROBOX\-STOP\.1" "" "April 2022" "Distrobox" "Distrobox"
-.SH "NAME"
-\fBdistrobox\-stop\.1\fR
-.P
-# Stop containers
-.P
-distrobox\-rm delete one of the available distroboxes\.
-.P
+.\
+.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
+.TH "DISTROBOX-STOP" "1" "Jun 2022" "Distrobox" "User Manual"
+.hy
+.SH Stop containers
+.PP
+distrobox-stop stop a running distrobox.
+.PP
+Distroboxes are left running, even after exiting out of them, so that
+subsequent enters are really quick.
+This is how they can be stopped.
+.PP
Usage:
-.IP "" 4
+.IP
+.nf
+\f[C]
+distrobox-stop --name container-name
+distrobox-stop container-name
+\f[R]
+.fi
+.PP
+You can also use environment variables to specify container manager and
+name:
+.IP
.nf
-distrobox\-rm \-\-name container\-name
-distrobox\-rm container\-name
+\f[C]
+DBX_CONTAINER_MANAGER=\[dq]docker\[dq] DBX_CONTAINER_NAME=test-alpine distrobox-stop
+\f[R]
.fi
-.IP "" 0
-.P
+.PP
+Supported environment variables:
+.IP
+.nf
+\f[C]
+DBX_CONTAINER_MANAGER
+DBX_CONTAINER_NAME
+DBX_NON_INTERACTIVE
+\f[R]
+.fi
+.PP
Options:
-.IP "" 4
+.IP
.nf
-\-\-name/\-n: name for the distrobox
-\-\-yes/\-Y: non\-interactive, stop without asking
-\-\-help/\-h: show this message
-\-\-verbose/\-v: show more verbosity
-\-\-version/\-V: show version
+\f[C]
+--name/-n: name for the distrobox
+--yes/-Y: non-interactive, stop without asking
+--help/-h: show this message
+--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
+ way over \[dq]sudo distrobox\[dq]
+--verbose/-v: show more verbosity
+--version/-V: show version
+\f[R]
.fi
-.IP "" 0
-
diff --git a/uninstall b/uninstall
index c41e246..83dd4d0 100755
--- a/uninstall
+++ b/uninstall
@@ -103,9 +103,9 @@ fi
# uninstall
for file in "${dest_path}/distrobox"*; do
- [ -e "${file}" ] && rm -i "${file}"
+ [ -e "${file}" ] && rm "${file}"
done
for file in "${man_dest_path}/distrobox"*; do
- [ -e "${file}" ] && rm -i "${file}"
+ [ -e "${file}" ] && rm "${file}"
done
echo "Thank you for using Distrobox. Uninstall complete."
More information about the Neon-commits
mailing list