[neon/backports-noble/distrobox-noble/Neon/unstable] /: New upstream version 1.4.2.1
Michel Alexandre Salim
null at kde.org
Tue Sep 3 08:26:59 BST 2024
Git commit ddcc2f339e266fb42bfd1c99d39abb04acfebdf2 by Michel Alexandre Salim.
Committed on 22/12/2022 at 21:32.
Pushed by carlosdem into branch 'Neon/unstable'.
New upstream version 1.4.2.1
M +3 -3 .github/workflows/compatibility.yml
M +6 -6 .github/workflows/main.yml
M +5 -3 .github/workflows/manpages.yml
M +1 -1 CONTRIBUTING.md
M +5 -1 completions/distrobox
M +0 -1 completions/distrobox-create
M +0 -1 completions/distrobox-enter
M +0 -1 completions/distrobox-ephemeral
M +0 -1 completions/distrobox-generate-entry
M +0 -1 completions/distrobox-list
M +0 -1 completions/distrobox-rm
M +0 -1 completions/distrobox-stop
M +0 -1 completions/distrobox-upgrade
M +1 -7 distrobox
M +82 -17 distrobox-create
M +30 -12 distrobox-enter
M +1 -1 distrobox-ephemeral
M +34 -17 distrobox-export
M +3 -10 distrobox-generate-entry
M +1 -1 distrobox-host-exec
M +58 -31 distrobox-init
M +1 -1 distrobox-list
M +53 -3 distrobox-rm
M +6 -2 distrobox-stop
M +1 -1 distrobox-upgrade
M +15 -34 docs/README.md
M +5 -5 docs/compatibility.md
M +3 -1 docs/posts/execute_commands_on_host.md
M +8 -4 docs/posts/install_rootless.md
M +2 -0 docs/posts/integrate_vscode_distrobox.md
M +10 -4 docs/posts/run_latest_gnome_kde_on_distrobox.md
A +76 -0 docs/posts/run_libvirt_in_distrobox.md
M +9 -0 docs/usage/distrobox-create.md
M +1 -0 docs/usage/distrobox-rm.md
M +130 -50 docs/useful_tips.md
M +2 -1 extras/install-podman
M +2 -2 install
M +7 -7 man/man1/distrobox-compatibility.1
M +13 -1 man/man1/distrobox-create.1
M +1 -1 man/man1/distrobox-enter.1
M +1 -1 man/man1/distrobox-ephemeral.1
M +1 -1 man/man1/distrobox-export.1
M +1 -1 man/man1/distrobox-generate-entry.1
M +1 -1 man/man1/distrobox-host-exec.1
M +1 -1 man/man1/distrobox-init.1
M +1 -1 man/man1/distrobox-list.1
M +2 -1 man/man1/distrobox-rm.1
M +1 -1 man/man1/distrobox-stop.1
M +1 -1 man/man1/distrobox-upgrade.1
M +31 -18 man/man1/distrobox.1
https://invent.kde.org/neon/backports-noble/distrobox-noble/-/commit/ddcc2f339e266fb42bfd1c99d39abb04acfebdf2
diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml
index 4c68609..7eab6f8 100644
--- a/.github/workflows/compatibility.yml
+++ b/.github/workflows/compatibility.yml
@@ -30,7 +30,7 @@ jobs:
distrobox_changed: ${{ steps.check_file_changed.outputs.distrobox_changed }}
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
@@ -55,7 +55,7 @@ jobs:
github.event.inputs.run_always == 'True'
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
# Fetch from compatibility table all the distros supported
- id: set-matrix
@@ -82,7 +82,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
# Ensure distrobox create works:
- name: Distrobox create
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 44a03bb..f664ab1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
- name: Run dash -n
run: |
@@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
- name: Run shfmt
run: |
@@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
# Exclude from bashate the following rules:
# - SC2310 we don't want to exit if errors happen inside a check, that's why we have a check...
@@ -87,7 +87,7 @@ jobs:
pull-requests: write
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
with:
fetch-depth: 0
@@ -101,7 +101,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
# Exclude from bashate the following rules:
# - E002 we use tab indentation as suggested by shfmt.
@@ -124,7 +124,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
- name: Run markdownlint
run: |
diff --git a/.github/workflows/manpages.yml b/.github/workflows/manpages.yml
index 684a93c..ea8c804 100644
--- a/.github/workflows/manpages.yml
+++ b/.github/workflows/manpages.yml
@@ -21,7 +21,7 @@ jobs:
distrobox_changed: ${{ steps.check_file_changed.outputs.distrobox_changed }}
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
@@ -42,17 +42,19 @@ jobs:
if: needs.check_changes.outputs.distrobox_changed == 'True'
steps:
- - uses: actions/checkout at v2
+ - uses: actions/checkout at v3
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)
+ VERSION=2.19.2
+ RELEASE="jgm/pandoc/releases/download/${VERSION}/pandoc-${VERSION}-1-amd64.deb"
NAME=$(echo $RELEASE | rev | cut -d'/' -f1 | rev)
curl -L https://github.com/$RELEASE -o $NAME
+ sudo apt-get update
sudo apt-get install -y ./$NAME
sudo apt-get install -y ronn
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 260cd5b..bdd223f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -91,7 +91,7 @@ done
- `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`
+ - `bashate -i E002,E003,E010,E011 --max-line-length 120`
- use `markdownlint`
- install using `npm -i -g markdownlint-cli`
- run `markdownlint $(find . -name '*.md' | grep -vF './.git')`
diff --git a/completions/distrobox b/completions/distrobox
index 82f386a..4cdfb02 100644
--- a/completions/distrobox
+++ b/completions/distrobox
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
_generate_from_help() {
@@ -19,6 +18,11 @@ _generate_from_help() {
return 0
fi
+ if [[ ${prev} == "--image" ]] || [[ ${prev} == "-i" ]]; then
+ COMPREPLY+=($(compgen -W "$(distrobox-create --compatibility)" -- ${cur} ))
+ return 0
+ fi
+
if [[ ${cur} == -* ]]; then
COMPREPLY+=($(compgen -W "${opts}" -- ${cur}))
return 0
diff --git a/completions/distrobox-create b/completions/distrobox-create
index d9347cd..53d77bc 100644
--- a/completions/distrobox-create
+++ b/completions/distrobox-create
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-enter b/completions/distrobox-enter
index 8d13ca9..e0970da 100644
--- a/completions/distrobox-enter
+++ b/completions/distrobox-enter
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-ephemeral b/completions/distrobox-ephemeral
index ebcfdf1..d48d934 100644
--- a/completions/distrobox-ephemeral
+++ b/completions/distrobox-ephemeral
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-generate-entry b/completions/distrobox-generate-entry
index 076b73b..6b1db4b 100644
--- a/completions/distrobox-generate-entry
+++ b/completions/distrobox-generate-entry
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-list b/completions/distrobox-list
index 8c7e45c..ce3bf4a 100644
--- a/completions/distrobox-list
+++ b/completions/distrobox-list
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-rm b/completions/distrobox-rm
index 21f0324..74850a5 100644
--- a/completions/distrobox-rm
+++ b/completions/distrobox-rm
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-stop b/completions/distrobox-stop
index 991ba06..95d0c4a 100644
--- a/completions/distrobox-stop
+++ b/completions/distrobox-stop
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/completions/distrobox-upgrade b/completions/distrobox-upgrade
index edb74fd..29657fa 100644
--- a/completions/distrobox-upgrade
+++ b/completions/distrobox-upgrade
@@ -1,4 +1,3 @@
-#!/usr/bin/env bash
# shellcheck disable=all
if [ -e /usr/share/bash-completion/completions/distrobox ]; then
diff --git a/distrobox b/distrobox
index df1f517..3501d5c 100755
--- a/distrobox
+++ b/distrobox
@@ -22,9 +22,7 @@
set -o errexit
set -o nounset
-trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
-
-version="1.4.1"
+version="1.4.2.1"
# Print usage to stdout.
# Arguments:
@@ -89,10 +87,6 @@ case "${distrobox_command}" in
exit 0
;;
help | --help | -h)
- if command -v man > /dev/null; then
- man distrobox || show_help
- exit 0
- fi
show_help
exit 0
;;
diff --git a/distrobox-create b/distrobox-create
index 2d98d41..b68541b 100755
--- a/distrobox-create
+++ b/distrobox-create
@@ -25,15 +25,14 @@
# Optional env variables:
# DBX_CONTAINER_ALWAYS_PULL
# DBX_CONTAINER_CUSTOM_HOME
+# DBX_CONTAINER_HOME_PREFIX
# DBX_CONTAINER_IMAGE
# DBX_CONTAINER_MANAGER
# DBX_CONTAINER_NAME
-# DBX_CONTAINER_ENTRY
+# DBX_CONTAINER_GENERATE_ENTRY
# DBX_NON_INTERACTIVE
# DBX_SUDO_PROGRAM
-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" "$(basename "${0}")"
@@ -45,12 +44,14 @@ fi
# Defaults
container_always_pull=0
container_clone=""
+container_home_prefix=""
container_image=""
container_image_default="registry.fedoraproject.org/fedora-toolbox:36"
+container_name_default="my-distrobox"
container_init_hook=""
container_manager="autodetect"
container_manager_additional_flags=""
-container_entry=1
+container_generate_entry=1
container_name=""
container_pre_init_hook=""
container_user_custom_home=""
@@ -76,7 +77,7 @@ distrobox_hostexec_path="$(cd "$(dirname "${0}")" && pwd)/distrobox-host-exec"
[ ! -e "${distrobox_hostexec_path}" ] && distrobox_hostexec_path="$(command -v distrobox-hostexec)"
rootful=0
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -100,10 +101,11 @@ done
[ -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_HOME_PREFIX}" ] && container_home_prefix="${DBX_CONTAINER_HOME_PREFIX}"
[ -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_CONTAINER_ENTRY}" ] && container_entry="${DBX_CONTAINER_ENTRY}"
+[ -n "${DBX_container_generate_entry}" ] && container_generate_entry="${DBX_container_generate_entry}"
[ -n "${DBX_NON_INTERACTIVE}" ] && non_interactive="${DBX_NON_INTERACTIVE}"
[ -n "${DBX_SUDO_PROGRAM}" ] && distrobox_sudo_program="${DBX_SUDO_PROGRAM}"
@@ -131,8 +133,8 @@ Usage:
Options:
- --image/-i: image to use for the container default: registry.fedoraproject.org/fedora-toolbox:36
- --name/-n: name for the distrobox default: my-distrobox
+ --image/-i: image to use for the container default: ${container_image_default}
+ --name/-n: name for the distrobox default: ${container_name_default}
--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
@@ -148,6 +150,7 @@ Options:
--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.
+ --compatibility/-C: show list of compatible images
--help/-h: show this message
--no-entry: do not generate a container entry in the application list
--dry-run/-d: only print the container manager command generated
@@ -158,10 +161,42 @@ Compatibility:
for a list of compatible images and container managers, please consult the man page:
man distrobox-compatibility
+ or run
+ distrobox create --compatibility
or consult the documentation page on: https://github.com/89luca89/distrobox/blob/main/docs/compatibility.md
EOF
}
+# Print list of compatible images to stdou, caching locally in a file.
+# Arguments:
+# None
+# Outputs:
+# print usage with examples.
+show_compatibility() {
+ if [ ! -e "${HOME}/.cache/distrobox-compatibility-${version}" ]; then
+ mkdir -p "${HOME}/.cache"
+
+ # If we don't have a cache file, we need connectivity. Ensure we have
+ # one and return error if not.
+ if ! curl -s "https://github.com" > /dev/null; then
+ printf >&2 "ERROR: no cache file and no connectivity found, cannot retrieve compatibility list.\n"
+ exit 1
+ fi
+ # We want to download the correspondent version of the compatibility table and extract a list from it.
+ # Always use the docs as source of truth for this.
+ curl -s \
+ "https://raw.githubusercontent.com/89luca89/distrobox/${version}/docs/compatibility.md" |
+ grep -A200 "^## Containers Distros" |
+ grep '|' |
+ cut -d '|' -f 4 |
+ sed 's|<br>|\n|g' |
+ tr -d ' ' |
+ sort -u |
+ tail -n+4 > "${HOME}/.cache/distrobox-compatibility-${version}"
+ fi
+ cat "${HOME}/.cache/distrobox-compatibility-${version}"
+}
+
# Parse arguments
while :; do
case $1 in
@@ -180,7 +215,7 @@ while :; do
;;
--no-entry)
shift
- container_entry=0
+ container_generate_entry=0
;;
-d | --dry-run)
shift
@@ -194,6 +229,10 @@ while :; do
shift
init=1
;;
+ -C | --compatibility)
+ show_compatibility
+ exit 0
+ ;;
-i | --image)
if [ -n "$2" ]; then
container_image="$2"
@@ -253,7 +292,7 @@ while :; do
;;
--pre-init-hooks)
if [ -n "$2" ]; then
- container_pre_init_hook="--pre-init-hooks \"${2}\""
+ container_pre_init_hook="${2}"
shift
shift
fi
@@ -298,7 +337,7 @@ fi
# 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"
+ container_name="${container_name_default}"
fi
# If no container_name is declared, we build our container name starting from the
@@ -495,15 +534,38 @@ generate_command() {
fi
done
+ # If we have a home prefix to use,
+ # 1- override the HOME env variable
+ # 2- export the DISTROBOX_HOST_HOME env variable pointing to original HOME
+ # 3- mount the home inside the container.
+ if [ -n "${container_home_prefix}" ] && [ -z "${container_user_custom_home}" ]; then
+ if [ ! -d "${container_home_prefix}/${container_name}" ]; then
+ if ! mkdir -p "${container_home_prefix}/${container_name}"; then
+ printf >&2 "Do you have permission to write to %s?\n" "${container_home_prefix}"
+ exit 1
+ fi
+ fi
+ result_command="${result_command}
+ --env \"HOME=${container_home_prefix}/${container_name}\"
+ --env \"DISTROBOX_HOST_HOME=${container_user_home}/${container_name}\"
+ --volume ${container_home_prefix}/${container_name}:${container_home_prefix}/${container_name}:rslave"
+ fi
+
# If we have a custom home to use,
# 1- override the HOME env variable
- # 2- expor the DISTROBOX_HOST_HOME env variable pointing to original HOME
+ # 2- export the DISTROBOX_HOST_HOME env variable pointing to original HOME
# 3- mount the custom home inside the container.
if [ -n "${container_user_custom_home}" ]; then
+ if [ ! -d "${container_user_custom_home}" ]; then
+ if ! mkdir -p "${container_user_custom_home}"; then
+ printf >&2 "Do you have permission to write to %s?\n" "${container_user_custom_home}"
+ exit 1
+ fi
+ fi
result_command="${result_command}
--env \"HOME=${container_user_custom_home}\"
--env \"DISTROBOX_HOST_HOME=${container_user_home}\"
- --volume ${container_user_custom_home}:${container_user_custom_home}:rslave"
+ --volume \"${container_user_custom_home}:${container_user_custom_home}:rslave\""
fi
# Mount also the /var/home dir on ostree based systems
@@ -561,13 +623,16 @@ generate_command() {
# inside the container is moved to distrobox-enter, in the start phase.
# This is done to make init, export and host-exec location independent from
# the host, and easier to upgrade.
- result_command="${result_command} ${container_image}
- /usr/bin/entrypoint -v --name \"${container_user_name}\"
+ #
+ # We set the entrypoint _before_ running the container image so that
+ # we can override any user provided entrypoint if need be
+ result_command="${result_command} --entrypoint /usr/bin/entrypoint
+ ${container_image} -v --name \"${container_user_name}\"
--user ${container_user_uid}
--group ${container_user_gid}
--home \"${container_user_custom_home:-"${container_user_home}"}\"
--init \"${init}\"
- ${container_pre_init_hook}
+ --pre-init-hooks \"${container_pre_init_hook}\"
-- '${container_init_hook}'
"
# use container_user_custom_home if defined, else fallback to normal home.
@@ -663,7 +728,7 @@ if eval ${cmd} > /dev/null; then
# We've created the box, let's also create the entry
if [ "${rootful}" -eq 0 ]; then
- if [ "${container_entry}" -ne 0 ]; then
+ if [ "${container_generate_entry}" -ne 0 ]; then
"$(dirname "$(realpath "${0}")")/distrobox-generate-entry" "${container_name}"
fi
fi
diff --git a/distrobox-enter b/distrobox-enter
index 49d283f..3fc5633 100755
--- a/distrobox-enter
+++ b/distrobox-enter
@@ -28,7 +28,7 @@
# DBX_SKIP_WORKDIR
# DBX_SUDO_PROGRAM
-trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n" && rm -f $HOME/.cache/.*.fifo $HOME/.cache/.*.status' EXIT
+trap 'rm -f $HOME/.cache/.*.fifo $HOME/.cache/.*.status' EXIT
# Dont' run this command as sudo.
if [ "$(id -u)" -eq 0 ]; then
@@ -40,11 +40,11 @@ fi
# Defaults
container_command=""
-container_image=""
container_image_default="registry.fedoraproject.org/fedora-toolbox:36"
container_manager="autodetect"
-container_name="my-distrobox"
container_manager_additional_flags=""
+container_name=""
+container_name_default="my-distrobox"
non_interactive=0
distrobox_sudo_program="sudo"
@@ -58,7 +58,7 @@ headless=0
rootful=0
skip_workdir=0
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -80,7 +80,6 @@ done
[ "${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}"
@@ -173,7 +172,23 @@ while :; do
;;
-e | --exec | --)
shift
- container_command=$*
+ # container_command=$*
+ container_command="$1"
+ shift
+ for arg in "$@"; do
+ if echo "${arg}" | grep -Eq "'|\""; then
+ container_command="${container_command} \
+ $(echo "${arg}" | sed 's|\\|\\\\|g' |
+ sed 's| |\\ |g' |
+ sed 's|\$|\\\$|g' |
+ sed "s|'|\\\'|g" |
+ sed 's|"|\\\"|g')"
+ elif echo "${arg}" | grep -q "'"; then
+ container_command="${container_command} \"${arg}\""
+ else
+ container_command="${container_command} '${arg}'"
+ fi
+ done
break
;;
-*) # Invalid options.
@@ -201,6 +216,10 @@ if [ "${verbose}" -ne 0 ]; then
set -o xtrace
fi
+if [ -z "${container_name}" ]; then
+ container_name="${container_name_default}"
+fi
+
# We depend on a container manager let's be sure we have it
# First we use podman, else docker
case "${container_manager}" in
@@ -254,6 +273,7 @@ generate_command() {
result_command="${container_manager} exec"
result_command="${result_command}
--interactive
+ --detach-keys=\"\"
--user=\"${USER}\""
# For some usage, like use in service, or launched by non-terminal
@@ -286,13 +306,14 @@ generate_command() {
fi
result_command="${result_command}
--workdir=\"${workdir}\"
+ --env \"CONTAINER_ID=${container_name}\"
--env \"DISTROBOX_ENTER_PATH=${distrobox_enter_path}\""
# Loop through all the environment vars
# and export them to the container.
set +o xtrace
# disable logging fot this snippet, or it will be too talkative.
for i in $(printenv | grep '=' | grep -Ev ' |"|`|\$' |
- grep -Ev '^(HOST|HOSTNAME|HOME|PATH|SHELL|XDG_.*_DIRS|^_)'); do
+ grep -Ev '^(HOST|HOSTNAME|HOME|LANG|LC_CTYPE|PATH|SHELL|XDG_.*_DIRS|^_)'); do
# We filter the environment so that we do not have strange variables,
# multiline or containing spaces.
# We also NEED to ignore the HOME variable, as this is set at create time
@@ -384,14 +405,11 @@ eval "$(${container_manager} inspect --type container "${container_name}" --form
if [ "${container_status}" = "unknown" ]; then
# If not, prompt to create it first
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}"
+ printf >&2 "Create it now, out of image %s? [Y/n]: " "${container_image_default}"
read -r response
response="${response:-"Y"}"
fi
@@ -404,7 +422,7 @@ if [ "${container_status}" = "unknown" ]; then
if [ "${rootful}" -ne 0 ]; then
create_command="${create_command} --root"
fi
- create_command="${create_command} -i ${container_image} -n ${container_name}"
+ create_command="${create_command} -i ${container_image_default} -n ${container_name}"
printf >&2 "Creating the container with command:\n"
printf >&2 " %s\n" "${create_command}"
if [ "${dryrun}" -ne 1 ]; then
diff --git a/distrobox-ephemeral b/distrobox-ephemeral
index 1331ad1..7a1aaaa 100755
--- a/distrobox-ephemeral
+++ b/distrobox-ephemeral
@@ -39,7 +39,7 @@ distrobox_path="$(dirname "${0}")"
extra_flags=""
rootful=0
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Print usage to stdout.
# Arguments:
diff --git a/distrobox-export b/distrobox-export
index 41c4989..560c5e1 100755
--- a/distrobox-export
+++ b/distrobox-export
@@ -25,8 +25,6 @@
# DISTROBOX_ENTER_PATH
# DISTROBOX_HOST_HOME
-trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
-
# Defaults
dest_path=""
export_action=""
@@ -43,7 +41,7 @@ host_home="${DISTROBOX_HOST_HOME:-"${HOME}"}"
is_sudo=""
rootful=""
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# We depend on some commands, let's be sure we have them
base_dependencies="basename grep sed find"
@@ -214,20 +212,24 @@ if [ -n "${exported_bin}" ] && [ -z "${dest_path}" ]; then
exit 2
fi
-# We can assume this as we set it the same as container name during creation.
-if [ -e /.dockerenv ]; then
+if [ -n "${CONTAINER_ID}" ]; then
+ container_name="${CONTAINER_ID}"
+# if the variable is not set, let's fall back to some tricks.
+elif [ -e /.dockerenv ]; then
# we're in docker, let's use this trick
container_name=$(grep "memory:/" < /proc/self/cgroup | sed 's|.*/||')
elif [ -e /run/.containerenv ]; then
# we're in podman, use this other trick
container_name=$(grep "name=" /run/.containerenv | cut -d'=' -f2- | tr -d '"')
-else
- # fallback to a more simple way but error prone
+fi
+# If one of the previous methods didn't work
+# let's fallback to a more simple way but error prone
+if [ -z "${container_name}" ]; then
container_name=$(uname -n | cut -d'.' -f1)
fi
# Prefix to add to an existing command to work throught the container
-container_command_prefix="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -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
@@ -236,17 +238,33 @@ fi
# Arguments:
# none it will use the ones set up globally
# Outputs:
-# print generated script.
+# print generated script.
generate_script() {
cat << EOF
#!/bin/sh
# distrobox_binary
# name: ${container_name}
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
- ${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- \
-${is_sudo} ${exported_bin} ${extra_flags} "\$@"
+ command="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- \
+${is_sudo} ${exported_bin} ${extra_flags} "
+
+ for arg in "\$@"; do
+ if echo "\${arg}" | grep -Eq "'|\""; then
+ command="\${command} \\
+ \$(echo "\${arg}" | sed 's|\\\|\\\\\\\|g' |
+ sed 's| |\\\ |g' |
+ sed 's|\\$|\\\\\\$|g' |
+ sed "s|'|\\\\\'|g" |
+ sed 's|"|\\\\\"|g')"
+ elif echo "\${arg}" | grep -q "'"; then
+ command="\${command} \"\${arg}\""
+ else
+ command="\${command} '\${arg}'"
+ fi
+ done
+ eval \${command}
else
- ${exported_bin} "\$@"
+ ${exported_bin} "\$@"
fi
EOF
return $?
@@ -312,7 +330,7 @@ export_binary() {
# needed desktop files in /run/host/$host_home/.local/share/applications
# or error code.
export_application() {
-
+ canon_dirs=""
[ -d /usr/share/applications ] && canon_dirs="/usr/share/applications"
[ -d /usr/local/share/applications ] && canon_dirs="${canon_dirs} /usr/local/share/applications"
[ -d /var/lib/flatpak/exports/share/applications ] &&
@@ -392,7 +410,7 @@ export_application() {
# we wanto to export the application's icons
mkdir -p "${icon_home_directory}"
- cp -r "${icon_file}" "${icon_home_directory}"
+ cp -r "$(realpath "${icon_file}")" "${icon_home_directory}"
done
# create desktop files for the distrobox
@@ -415,7 +433,6 @@ export_application() {
# 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" \
@@ -467,6 +484,7 @@ export_service() {
# find the service file in the common
service_file=$(find \
/etc/systemd/system/ /lib/systemd/system/ /usr/lib/systemd/system/ \
+ /lib/systemd/user/ /usr/lib/systemd/user/ \
"${host_home}"/.config/systemd/user/ \
-type f -name "${exported_service}*" 2> /dev/null | tail -1)
@@ -514,8 +532,7 @@ export_service() {
# Add extra flags
# 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}=.*|& ${extra_flags}|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-generate-entry b/distrobox-generate-entry
index 02c5d22..725905a 100755
--- a/distrobox-generate-entry
+++ b/distrobox-generate-entry
@@ -19,16 +19,15 @@
# along with distrobox; if not, see <http://www.gnu.org/licenses/>.
# POSIX
-trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
all=0
container_manager="autodetect"
-container_name="my-distrobox"
+container_name_default="my-distrobox"
delete=0
icon="auto"
icon_default="${HOME}/.local/share/icons/terminal-distrobox-icon.png"
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -73,11 +72,6 @@ Options:
EOF
}
-if [ $# -eq 0 ]; then
- show_help
- exit
-fi
-
# Parse arguments
while :; do
case $1 in
@@ -139,8 +133,7 @@ if [ "${verbose}" -ne 0 ]; then
fi
if [ -z "${container_name}" ]; then
- printf >&2 "Please specify the name of the container.\n"
- exit 1
+ container_name="${container_name_default}"
fi
if [ "${all}" -ne 0 ]; then
diff --git a/distrobox-host-exec b/distrobox-host-exec
index 12e8f7e..730b077 100755
--- a/distrobox-host-exec
+++ b/distrobox-host-exec
@@ -28,7 +28,7 @@ fi
distrobox_host_exec_default_command="${SHELL:-/bin/sh}"
host_spawn_version="1.2.1"
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Print usage to stdout.
# Arguments:
diff --git a/distrobox-init b/distrobox-init
index 65833b8..99e2a04 100755
--- a/distrobox-init
+++ b/distrobox-init
@@ -32,7 +32,7 @@ init_hook=""
upgrade=0
pre_init_hook=""
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Print usage to stdout.
# Arguments:
# None
@@ -120,9 +120,9 @@ while :; do
--pre-init-hooks)
if [ -n "$2" ]; then
pre_init_hook="$2"
- shift
- shift
fi
+ shift
+ shift
;;
--)
shift
@@ -180,7 +180,7 @@ mount_bind() (
! [ -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
+ if [ -e "${target_dir}" ] && findmnt "${target_dir}" > /dev/null; then
umount "${target_dir}"
fi
# if the source_dir exists, then create the target_dir
@@ -252,7 +252,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! apk add "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
apk add \
@@ -297,7 +296,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! apt-get install -y "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
apt-get install -y \
@@ -349,7 +347,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! dnf install -y "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
dnf install -y --allowerasing \
@@ -382,28 +379,39 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
fi
elif command -v emerge; then
+ # Check if the container we are using has a ::gentoo repo defined,
+ # if it is defined and it is empty, then synchroznize it.
+ gentoo_repo="$(portageq get_repo_path / gentoo)"
+ if [ -n "${gentoo_repo}" ] && [ ! -e "${gentoo_repo}" ]; then
+ emerge-webrsync
+ fi
+ # If we need to upgrade, do it and exit, no further action required.
+ if [ "${upgrade}" -ne 0 ]; then
+ emerge --sync
+ exit
+ fi
# 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 ! emerge --ask=n --autounmask-continue "${shell_pkg}"; then
- SHELL="/bin/bash"
+ if ! emerge --ask=n --autounmask-continue --noreplace --quiet-build "${shell_pkg}"; then
shell_pkg="bash"
fi
- emerge --ask=n --autounmask-continue --quiet-build \
+ emerge --ask=n --autounmask-continue --noreplace --quiet-build \
"${shell_pkg}" \
- bc \
- net-misc/curl \
+ app-crypt/gnupg \
+ sys-devel/bc \
diffutils \
findutils \
less \
ncurses \
+ net-misc/curl \
pinentry \
procps \
shadow \
sudo \
+ sys-process/lsof \
util-linux \
- wget \
- vte
+ wget
elif command -v microdnf; then
# If we need to upgrade, do it and exit, no further action required.
@@ -415,7 +423,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# 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 \
@@ -462,7 +469,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# that it is set up correctly for the user.
pacman --noconfirm -Syyu
if ! pacman -Sy --noconfirm "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
pacman -Sy --noconfirm \
@@ -502,7 +508,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! yes | slackpkg install -default_answer=yes -batch=yes "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
yes | slackpkg install -default_answer=yes -batch=yes \
@@ -558,11 +563,13 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
fi
# Ensure we avoid errors by keeping xbps updated
xbps-install -Syu xbps
+ # We have to lock this package, as it's incompatible with distrobox's
+ # mount process.
+ xbps-pkgdb -m repolock base-files
# 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 ! xbps-install -Sy "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
xbps-install -Sy \
@@ -600,7 +607,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# fall back to bash, and we set the SHELL variable to bash so
# that it is set up correctly for the user.
if ! yum install -y "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
yum install -y \
@@ -637,7 +643,6 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
exit
fi
if ! zypper install -y "${shell_pkg}"; then
- SHELL="/bin/bash"
shell_pkg="bash"
fi
zypper install -y \
@@ -658,7 +663,8 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
systemd \
time \
wget \
- util-linux
+ util-linux \
+ util-linux-systemd
# These are graphics drivers for 3d applications
zypper install -y \
@@ -687,6 +693,13 @@ if [ "${upgrade}" -ne 0 ] || ! command -v find || ! command -v mount || ! comman
# Exit as command not found
exit 127
fi
+ # 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="/bin/sh"
+ else
+ SHELL="$(command -v "${shell_pkg}")"
+ fi
fi
###############################################################################
@@ -757,11 +770,13 @@ printf "distrobox: Setting up host's sockets integration...\n"
# for example using `podman --remote` to control the host's podman from inside
# the container or accessing docker and libvirt sockets.
host_sockets="$(find /run/host/run -name 'user' \
+ -prune -o -path /run/host/run/media \
-prune -o -name 'nscd' \
-prune -o -name 'bees' \
-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.
@@ -843,7 +858,7 @@ if [ -d "/etc/dpkg/dpkg.cfg.d/" ]; then
printf "distrobox: Setting up apt hooks...\n"
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' \
+ printf 'DPkg::Pre-Invoke {"if findmnt %s >/dev/null; 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
@@ -863,7 +878,7 @@ if [ -d "/usr/share/libalpm/scripts" ]; then
printf "#!/bin/sh\n" > /usr/share/libalpm/scripts/02_distrobox_post_hook.sh
chmod +x /usr/share/libalpm/scripts/*distrobox*.sh
for net_mount in ${HOST_MOUNTS_RO}; do
- printf "if mountpoint %s; then umount %s; fi\n" \
+ printf "if findmnt %s >/dev/null; then umount %s; fi\n" \
"${net_mount}" "${net_mount}" >> /usr/share/libalpm/scripts/00_distrobox_pre_hook.sh
printf "if [ -e /run/host/%s ]; then mount --rbind -o ro /run/host/%s %s; fi\n" \
"${net_mount}" "${net_mount}" "${net_mount}" >> /usr/share/libalpm/scripts/02_distrobox_post_hook.sh
@@ -902,7 +917,7 @@ if ! grep -q 'Defaults !fqdn' /etc/sudoers.d/sudoers; then
printf "Defaults !fqdn\n" >> /etc/sudoers.d/sudoers
fi
# Ensure passwordless sudo is set up for user
-if ! grep -q "${container_user_name} ALL = (root) NOPASSWD:ALL" /etc/sudoers.d/sudoers; then
+if ! grep -q "\"${container_user_name}\" ALL = (root) NOPASSWD:ALL" /etc/sudoers.d/sudoers; then
printf "\"%s\" ALL = (root) NOPASSWD:ALL\n" "${container_user_name}" >> /etc/sudoers.d/sudoers
fi
@@ -919,7 +934,10 @@ fi
printf "distrobox: Setting up users...\n"
# Setup kerberos integration with the host
-if [ -d "/etc/krb5.conf.d" ] && [ ! -e "/etc/krb5.conf.d/kcm_default_ccache" ]; then
+if [ -d "/run/host/var/kerberos" ] &&
+ [ -d "/etc/krb5.conf.d" ] &&
+ [ ! -e "/etc/krb5.conf.d/kcm_default_ccache" ]; then
+
cat << EOF > "/etc/krb5.conf.d/kcm_default_ccache"
# # To disable the KCM credential cache, comment out the following lines.
[libdefaults]
@@ -949,7 +967,9 @@ if ! grep -q "^$(printf '%s' "${container_user_name}" | tr '\\' '.'):" /etc/pass
"${container_user_home}" "${SHELL:-"/bin/bash"}" >> /etc/passwd
printf "%s::1::::::" "${container_user_name}" >> /etc/shadow
fi
-else
+# Ensure we're not using the specified SHELL. Run it only once, so that future
+# user's preferences are not overwritten at each start.
+elif [ ! -e /etc/passwd.done ]; then
# This situation is presented when podman or docker already creates the user
# for us inside container. We should modify the user's prepopulated shadowfile
# entry though as per user's active preferences.
@@ -962,6 +982,7 @@ else
printf "Warning: there was a problem setting up the user\n"
fi
+ touch /etc/passwd.done
fi
# We generate a random password to initialize the entry for the user and root.
@@ -979,7 +1000,7 @@ 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
+if [ -n "${DISTROBOX_HOST_HOME:-}" ] && [ -d "/etc/skel" ]; then
skel_files="$(find /etc/skel/ -type f || :)"
for skel_file in ${skel_files}; do
if [ ! -f "${container_user_home}/$(basename "${skel_file}")" ] &&
@@ -1032,7 +1053,7 @@ if [ "${init}" -eq 0 ]; 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}" &&
+ findmnt "${file_watch}" > /dev/null &&
umount "${file_watch}" &&
mount_bind "/run/host${file_watch}" "${file_watch}" rw
fi
@@ -1048,12 +1069,12 @@ printf "distrobox: Setting up init system...\n"
# 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
+ if findmnt "${host_mount}" > /dev/null; then umount "${host_mount}"; fi
done
if command -v systemctl 2> /dev/null; then
# Cleanup systemd to not interfere with the host
+ # /etc/systemd/system/*.wants/
UNIT_TARGETS="
- /etc/systemd/system/*.wants/*
/usr/lib/systemd/system/basic.target.wants/*
/usr/lib/systemd/system/local-fs.target.wants/*
/usr/lib/systemd/system/multi-user.target.wants/*
@@ -1061,9 +1082,15 @@ if command -v systemctl 2> /dev/null; then
/usr/lib/systemd/system/sockets.target.wants/*initctl*
/usr/lib/systemd/system/sockets.target.wants/*udev*
/usr/lib/systemd/system/sysinit.target.wants/*
+ /usr/lib/systemd/system/systemd-tmpfiles*
/usr/lib/systemd/system/systemd-update-utmp*
+ /usr/lib/systemd/system/NetworkManager-wait-online.service
+ /usr/lib/systemd/system/auditd.service
+ /usr/lib/systemd/system/libstoragemgmt.service
+ /usr/lib/systemd/system/mcelog.service
"
- for unit in $(find "${UNIT_TARGETS}" 2> /dev/null | grep -v systemd-tmpfiles-setup); do
+ # shellcheck disable=SC2086,SC2044
+ for unit in $(find ${UNIT_TARGETS} 2> /dev/null); do
systemctl mask "$(basename "${unit}")"
done
fi
diff --git a/distrobox-list b/distrobox-list
index 4a76d47..9c8e8a6 100755
--- a/distrobox-list
+++ b/distrobox-list
@@ -35,7 +35,7 @@ fi
no_color=0
rootful=0
verbose=0
-version="1.4.1"
+version="1.4.2.1"
container_manager="autodetect"
distrobox_sudo_program="sudo"
diff --git a/distrobox-rm b/distrobox-rm
index 76b7a26..6f8ec00 100755
--- a/distrobox-rm
+++ b/distrobox-rm
@@ -22,6 +22,7 @@
# Optional env variables:
# DBX_CONTAINER_MANAGER
# DBX_CONTAINER_NAME
+# DBX_CONTAINER_RM_CUSTOM_HOME
# DBX_NON_INTERACTIVE
# DBX_SUDO_PROGRAM
@@ -39,8 +40,9 @@ force=0
non_interactive=0
rootful=0
verbose=0
+rm_home=0
distrobox_sudo_program="sudo"
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -63,6 +65,7 @@ done
[ "${non_interactive}" = "false" ] && non_interactive=0
[ -n "${DBX_CONTAINER_MANAGER}" ] && container_manager="${DBX_CONTAINER_MANAGER}"
+[ -n "${DBX_CONTAINER_RM_CUSTOM_HOME}" ] && rm_home="${DBX_CONTAINER_RM_CUSTOM_HOME}"
[ -n "${DBX_NON_INTERACTIVE}" ] && non_interactive="${DBX_NON_INTERACTIVE}"
[ -n "${DBX_SUDO_PROGRAM}" ] && distrobox_sudo_program="${DBX_SUDO_PROGRAM}"
@@ -86,6 +89,7 @@ Usage:
Options:
--name/-n: name for the distrobox
+ --rm-home: remove the mounted home if it differs from the host user's one
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
way over "sudo distrobox" (note: if using a program other than 'sudo' for root privileges is necessary,
specify it through the DBX_SUDO_PROGRAM env variable, or 'distrobox_sudo_program' config variable)
@@ -107,6 +111,10 @@ while :; do
shift
rootful=1
;;
+ --rm-home)
+ shift
+ rm_home=1
+ ;;
-v | --verbose)
verbose=1
shift
@@ -230,8 +238,9 @@ for container_name in ${container_name_list}; do
exit 1
fi
fi
+
+ # Prompt for confirmation
if [ "${non_interactive}" -eq 0 ] && [ "${force}" -eq 0 ]; then
- # Prompt to download it.
printf "Do you really want to delete %s? [Y/n]: " "${container_name}"
read -r response
response="${response:-"Y"}"
@@ -239,16 +248,57 @@ for container_name in ${container_name_list}; do
response="yes"
fi
+ # Retrieve container's HOME, and check if it's different from host's one. In
+ # this case we prompt for deletion of the custom home.
+ container_home=$(${container_manager} inspect "${container_name}" --format \
+ '{{range .Config.Env}}{{if slice . 0 5 | eq "HOME="}}{{slice . 5}}{{end}}{{end}}')
+ # Prompt for confirmation
+ if [ "${non_interactive}" -eq 0 ] && [ "${container_home}" != "${HOME}" ] && [ "${rm_home}" -eq 0 ]; then
+ printf "Do you want to remove custom home of container %s (%s)? [Y/n]: " "${container_name}" "${container_home}"
+ read -r response_rm_home
+ response_rm_home="${response_rm_home:-"Y"}"
+ elif [ "${container_home}" != "${HOME}" ]; then
+ if [ "${rm_home}" -eq 0 ]; then
+ response_rm_home="N"
+ else
+ response_rm_home="Y"
+ fi
+ else
+ response_rm_home="N"
+ fi
+
+ # Validate home response
+ # Accept only y,Y,Yes,yes,n,N,No,no.
+ case "${response_rm_home}" in
+ y | Y | Yes | yes | YES)
+ rm_home_local=1
+ ;;
+ n | N | No | no | NO)
+ rm_home_local=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
+
# Accept only y,Y,Yes,yes,n,N,No,no.
case "${response}" in
y | Y | Yes | yes | YES)
- # We're going to deleted the box, let's also delete the entry
+ # We're going to delete the box, let's also delete the entry
if [ "${rootful}" -eq 0 ]; then
"$(dirname "$(realpath "${0}")")/distrobox-generate-entry" "${container_name}" --delete
fi
# Remove the container
${container_manager} rm "${container_name}"
+
+ # Remove custom home
+ if [ "${rm_home_local}" -eq 1 ]; then
+ rm -r "${container_home}"
+ printf "Successfully removed %s\n" "${container_home}"
+ fi
;;
n | N | No | no | NO)
printf "Aborted.\n"
diff --git a/distrobox-stop b/distrobox-stop
index 3cf032b..06ad341 100755
--- a/distrobox-stop
+++ b/distrobox-stop
@@ -35,12 +35,12 @@ fi
# Defaults
container_manager="autodetect"
-container_name="my-distrobox"
+container_name_default="my-distrobox"
non_interactive=0
rootful=0
verbose=0
distrobox_sudo_program="sudo"
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
@@ -154,6 +154,10 @@ if [ "${verbose}" -ne 0 ]; then
set -o xtrace
fi
+if [ -z "${container_name}" ]; then
+ container_name="${container_name_default}"
+fi
+
# We depend on a container manager let's be sure we have it
# First we use podman, else docker
case "${container_manager}" in
diff --git a/distrobox-upgrade b/distrobox-upgrade
index 96d4f9b..3ebf155 100755
--- a/distrobox-upgrade
+++ b/distrobox-upgrade
@@ -33,7 +33,7 @@ distrobox_path="$(dirname "$(realpath "${0}")")"
distrobox_sudo_program="sudo"
rootful=0
verbose=0
-version="1.4.1"
+version="1.4.2.1"
# Source configuration files, this is done in an hierarchy so local files have
# priority over system defaults
diff --git a/docs/README.md b/docs/README.md
index c77d788..b4e3a22 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -41,7 +41,6 @@ graphical apps (X11/Wayland), and audio.
- [Alternative methods](#alternative-methods)
- [Curl](#curl)
- [Git](#git)
- - [Flatpak](#flatpak)
- [Dependencies](#dependencies)
- [Install Podman without root](compatibility.md#install-podman-in-a-static-manner)
- [Uninstallation](#uninstallation)
@@ -54,9 +53,11 @@ graphical apps (X11/Wayland), and audio.
- [distrobox-create](usage/distrobox-create.md)
- [distrobox-enter](usage/distrobox-enter.md)
- [distrobox-ephemeral](usage/distrobox-ephemeral.md)
+ - [distrobox-generate-entry](usage/distrobox-generate-entry.md)
- [distrobox-list](usage/distrobox-list.md)
- [distrobox-rm](usage/distrobox-rm.md)
- [distrobox-stop](usage/distrobox-stop.md)
+ - [distrobox-upgrade](usage/distrobox-upgrade.md)
- [Inside the distrobox](usage/usage.md#inside-the-distrobox)
- [distrobox-export](usage/distrobox-export.md)
- [distrobox-host-exec](usage/distrobox-host-exec.md)
@@ -77,16 +78,17 @@ graphical apps (X11/Wayland), and audio.
- [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)
- [Check used resources](useful_tips.md#check-used-resources)
- [Build a Gentoo distrobox container](distrobox_gentoo.md)
- [Build a Dedicated distrobox container](distrobox_custom.md)
- [Posts](posts/posts.md)
+ - [Run Libvirt using distrobox](posts/run_libvirt_in_distrobox.md)
- [Run latest GNOME and KDE Plasma using distrobox](posts/run_latest_gnome_kde_on_distrobox.md)
- [Integrate VSCode and Distrobox](posts/integrate_vscode_distrobox.md)
- [Execute a command on the Host](posts/execute_commands_on_host.md)
+ - [Apply resource limitation on the fly](useful_tips.md#apply-resource-limitation-on-the-fly)
- [Featured Articles](featured_articles.md)
- [Articles](featured_articles.md#articles)
- [Run Distrobox on Fedora Linux - Fedora Magazine](https://fedoramagazine.org/run-distrobox-on-fedora-linux/)
@@ -102,9 +104,12 @@ graphical apps (X11/Wayland), and audio.
- [Japanese input on Clear Linux with Mozc via Ubuntu container with Distrobox](https://impsbl.hatenablog.jp/entry/JapaneseInputOnClearLinuxWithMozc_en)
- [MID (MaXX Interactive Desktop) on Clear Linux via Ubuntu container with Distrobox](https://impsbl.hatenablog.jp/entry/MIDonClearLinuxWithDistrobox_en)
- [Running Other Linux Distros with Distrobox on Fedora Linux - bandithijo's blog](featured_articles.md)
- - [Talks](featured_articles.md#talks)
+ - [Talks and Videos](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)
+ - [Opensource Summit 2022 - Distrobox: Run Any App On Any Distro](https://www.youtube.com/watch?v=eM1p47tow4o)
- [A "Box" Full of Tools and Distros - Dario Faggioli @ OpenSUSE Conference 2022](https://www.youtube.com/watch?v=_RzARte80SQ)
+ - [Podman Community Meeting October 4, 2022](https://www.youtube.com/watch?v=JNijOHL4_Ko)
+ - [Distrobox opens the Steam Deck to a whole new world (GUIDE) - GamingOnLinux](https://www.youtube.com/watch?v=kkkyNA31KOA)
- [Podcasts](featured_articles.md#podcasts)
---
@@ -266,11 +271,13 @@ 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_generate_entry=0
container_manager="docker"
-container_name="test-name-1"
-container_entry=0
+container_image_default="registry.opensuse.org/opensuse/toolbox:latest"
+container_name_default="test-name-1"
+container_user_custom_home="$HOME/.local/share/container-home-test"
+container_init_hook="~/.local/distrobox/a_custom_default_init_hook.sh"
+container_pre_init_hook="~/a_custom_default_pre_init_hook.sh"
non_interactive="1"
skip_workdir="0"
```
@@ -348,32 +355,6 @@ such as `./install --prefix ~/.distrobox`.
Prefix explained: main distrobox files get installed to `${prefix}/bin` whereas
the manpages get installed to `${prefix}/share/man`.
-### Flatpak
-
-⚠️ ⚠️ ⚠️ This is experimental! ⚠️ ⚠️ ⚠️
-
-You can find flatpak builds of distrobox here:
-[io.github.luca.distrobox](https://github.com/89luca89/io.github.luca.distrobox/releases)
-Download the latest release flatpak and run
-
-```sh
-flatpak install io.github.luca.distrobox.flatpak
-```
-
-You can then run distrobox with:
-
-```sh
-flatpak run io.github.luca.distrobox create ...
-flatpak run io.github.luca.distrobox enter ...
-flatpak run io.github.luca.distrobox list ...
-[...]
-```
-
-It will be handy to add an `alias distrobox="flatpak run io.github.luca.distrobox"` to your shell,
-so that you can run distrobox commands normally.
-
-Being experimental, please if you encounter problems, report them!
-
---
Check the [Host Distros](compatibility.md#host-distros) compatibility list for
@@ -388,7 +369,7 @@ Please look in the [Compatibility Table](compatibility.md#host-distros) for your
distribution notes.
There are ways to install [Podman without root privileges and in home.](compatibility.md#install-podman-in-a-static-manner)
-This should play well with completely sudoless setups and with devices like the Stean Deck.
+This should play well with completely sudoless setups and with devices like the Steam Deck.
---
diff --git a/docs/compatibility.md b/docs/compatibility.md
index 56ce309..c5fea9b 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -58,7 +58,7 @@ Distrobox has been successfully tested on:
| Fedora | 35 <br> 36 <br> Rawhide | `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) |
| Manjaro | | To setup rootless podman, look [HERE](https://wiki.archlinux.org/title/Podman) |
-| 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) |
+| NixOS | 21.11 | 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) |
| 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, Use the following repository links in the `zypper addrepo` command: [15.4](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.4/home:dfaggioli:microos-desktop.repo), [15.3](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.3/home:dfaggioli:microos-desktop.repo), [15.2](https://download.opensuse.org/repositories/home:dfaggioli:microos-desktop/15.2/home:dfaggioli:microos-desktop.repo). Then: <br> `zypper refresh && zypper install distrobox`. <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) is fixed, or ``podman`` loggin is configured properly. |
| 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, do: `pkcon install distrobox` and reboot the system. |
| 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). Then: <br> `zypper refresh && zypper install distrobox`. <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) is fixed, or ``podman`` loggin is configured properly. |
@@ -150,11 +150,11 @@ Distrobox guests tested successfully with the following container images:
| CentOS Stream | 8 <br> 9 | quay.io/centos/centos:stream8 <br> quay.io/centos/centos:stream9 |
| CentOS | 7 | quay.io/centos/centos:7 |
| ClearLinux | | docker.io/library/clearlinux:latest <br> docker.io/library/clearlinux:base |
-| 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 | 7 <br> 8 <br> 9 <br> 10 <br> 11 | docker.io/debian/eol:wheezy <br> docker.io/debian/eol:jessie <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 |
-| Fedora | 35 <br> 36 <br> 37 <br> Rawhide | registry.fedoraproject.org/fedora-toolbox:35 <br> quay.io/fedora/fedora:35 <br> quay.io/fedora/fedora:36 <br> registry.fedoraproject.org/fedora:37 <br> quay.io/fedora/fedora:rawhide |
-| Gentoo Linux | rolling | You will have to [Build your own](distrobox_gentoo.md) to have a complete Gentoo docker image |
+| Fedora | 35 <br> 36 <br> 37 <br> 38 <br> Rawhide | registry.fedoraproject.org/fedora-toolbox:37 <br> quay.io/fedora/fedora:35 <br> quay.io/fedora/fedora:36 <br> registry.fedoraproject.org/fedora:37 <br> quay.io/fedora/fedora:38 |
+| Gentoo Linux | rolling | docker.io/gentoo/stage3:latest |
| Kali Linux | rolling | docker.io/kalilinux/kali-rolling:latest |
| Mageia | 8 | docker.io/library/mageia |
| Neurodebian | nd100 | docker.io/library/neurodebian:nd100 |
@@ -169,7 +169,7 @@ Distrobox guests tested successfully with the following container images:
| Void Linux | | ghcr.io/void-linux/void-linux:latest-full-x86_64 <br> ghcr.io/void-linux/void-linux:latest-full-x86_64-musl |
Note however that if you use a non-toolbox preconfigured image (e.g.
-images pre-baked to work with <https://github.com/containers/toolbox),>
+images pre-baked to work with <https://github.com/containers/toolbox>),
the **first** `distrobox-enter` you'll perform
can take a while as it will download and install the missing dependencies.
diff --git a/docs/posts/execute_commands_on_host.md b/docs/posts/execute_commands_on_host.md
index c70c814..6995299 100644
--- a/docs/posts/execute_commands_on_host.md
+++ b/docs/posts/execute_commands_on_host.md
@@ -89,6 +89,8 @@ if [ -n "${ZSH_VERSION-}" ]; then
fi
```
+And then, run `source ~/.profile` to reload `.profile` in the current session.
+
## fish
Place this snippet in a new fish function file (`~/.config/fish/functions/fish_command_not_found.fish`):
@@ -97,7 +99,7 @@ Place this snippet in a new fish function file (`~/.config/fish/functions/fish_c
function fish_command_not_found
# "In a container" check
if test -e /run/.containerenv -o -e /.dockerenv
- distrobox-host-exec "$argv"
+ distrobox-host-exec $argv
else
__fish_default_command_not_found_handler $argv
end
diff --git a/docs/posts/install_rootless.md b/docs/posts/install_rootless.md
index 4343a73..76199ff 100644
--- a/docs/posts/install_rootless.md
+++ b/docs/posts/install_rootless.md
@@ -4,16 +4,20 @@
Installing distrobox on SteamOS is quite straightforward:
-1 - Install `distrobox` in your HOME following the `curl` instructions: [INSTALL](../README.md#curl)
-2 - Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/bin`. [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
+1. Install `distrobox` in your HOME following the `curl` instructions:
+ - [INSTALL](../README.md#curl)
+2. Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/bin`.
+ - [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
## Step 2
We now need `podman` to be installed in order for `distrobox` to work.
The easiest way is to use the script to install it in HOME, so it will survive future updates:
-1 - Install `podman` in your HOME following the `curl` command: [INSTALL](../compatibility.md#install-podman-in-a-static-manner)
-2 - Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/podman/bin`. [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
+1. Install `podman` in your HOME following the `curl` command:
+ - [INSTALL](../compatibility.md#install-podman-in-a-static-manner)
+2. Add the Path you've choosen to install to your PATH (by default it's `$HOME/.local/podman/bin`.
+ - [See here how to do it](https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/)
## Step 3
diff --git a/docs/posts/integrate_vscode_distrobox.md b/docs/posts/integrate_vscode_distrobox.md
index 514fc67..1e6bc86 100644
--- a/docs/posts/integrate_vscode_distrobox.md
+++ b/docs/posts/integrate_vscode_distrobox.md
@@ -99,6 +99,8 @@ else
fi
```
+and make it executable: `chmod +x ~/.local/bin/podman-host`.
+
Open VSCode settings (Ctrl+,) and head to `Remote>Containers>Docker Path` and
set it to the path of `podman-exec`, like in the example
diff --git a/docs/posts/run_latest_gnome_kde_on_distrobox.md b/docs/posts/run_latest_gnome_kde_on_distrobox.md
index ba6b62b..5d33a5e 100644
--- a/docs/posts/run_latest_gnome_kde_on_distrobox.md
+++ b/docs/posts/run_latest_gnome_kde_on_distrobox.md
@@ -12,6 +12,8 @@
---
+⚠️ **BE CAREFUL**:⚠️ THIS IS EXPERIMENTAL, JUST FOOD FOR TOUGHTS
+
# Using a stable-release distribution
Lots of people prefer to run a distribution following a stable-LTS release cycle
@@ -49,6 +51,8 @@ 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/
```
+If you get an error message, you might have to manually create the folders `/run/systemd` and `/run/dbus` with `sudo mkdir`.
+
Then we can proceed to install GNOME in the container:
```shell
@@ -70,7 +74,7 @@ container so we need to change the ownership from `root` to `$USER` each time.
Let's add:
```shell
-chown -R $USER:$USER /tmp/.X11-unix
+chown -f -R $USER:$USER /tmp/.X11-unix
```
to `/etc/profile.d/fix_tmp.sh` file.
@@ -78,7 +82,7 @@ to `/etc/profile.d/fix_tmp.sh` file.
This is needed for the XWayland session to work properly which right now is
necessary to run gnome-shell even on wayland.
-Then we need to add a desktop file for the session on the host's file system,
+Then we need to add a desktop file for the session on the **host's** file system,
so that it appears on your login manager (Be it SSDM or GDM)
```shell
@@ -92,6 +96,7 @@ X-GDM-SessionRegisters=true
```
This file should be placed under `/usr/local/share/wayland-sessions/distrobox-gnome.desktop`
+(If it doesn't show up, you can place it under `/usr/share/xsessions/distrobox-gnome.desktop`)
Let's log out and voilá!
@@ -123,7 +128,7 @@ user at fedora-rawhide:~$ sudo dnf groupinstall KDE
### Generate session file - Plasma
-We need to add a desktop file for the session on the host's file system,
+We need to add a desktop file for the session on the **host's** file system,
so that it appears on your login manager (Be it SSDM or GDM)
```shell
@@ -135,6 +140,7 @@ X-KDE-PluginInfo-Version=5.23.3
```
This file should be placed under `/usr/local/share/wayland-sessions/distrobox-plasma.desktop`
+(If it doesn't show up, you can place it under `/usr/share/xsessions/distrobox-plasma.desktop`)
### Add a couple of fixes
@@ -148,7 +154,7 @@ container so we need to change the ownership from `root` to `$USER` each time.
Let's add:
```shell
-chown -R $USER:$USER /tmp/.X11-unix
+chown -f -R $USER:$USER /tmp/.X11-unix
```
to `/etc/profile.d/fix_tmp.sh` file.
diff --git a/docs/posts/run_libvirt_in_distrobox.md b/docs/posts/run_libvirt_in_distrobox.md
new file mode 100644
index 0000000..b7adad7
--- /dev/null
+++ b/docs/posts/run_libvirt_in_distrobox.md
@@ -0,0 +1,76 @@
+- [Distrobox](../README.md)
+ - [Run Libvirt using distrobox](run_libvirt_in_distrobox.md)
+ - [Prepare the container](#prepare-the-container)
+ - [Connect from the host](#connect-from-the-host)
+
+# Using an immutable distribution
+
+If you are on an immutable distribution (Silverblue/Kionite, MicroOS) chances are that
+installing lots and lots of packages on the base system is not advisable.
+
+One way is to use a distrobox for them.
+
+## Prepare the container
+
+To run libvirt/qemu/kvm we need a systemd container and we need a **rootful** container
+to be able to use it, see [this tip](../useful_tips.md#using-init-system-inside-a-distrobox)
+to have a list of compatible images.
+We will use in this example AlmaLinux 8:
+
+```console
+:~> distrobox create --root --init --image quay.io/almalinux/8-init:8 --name libvirtd-container
+:~> distrobox enter --root libvirtd-container
+```
+
+Let it initalize, then we can install all the packages we need:
+
+```console
+:~> distrobox enter --root libvirtd-container
+:~$ # We're now inside the container
+:~$ sudo dnf groupinstall Virtualization Host --allowerasing
+...
+:~$ sudo systemctl enable --now libvirtd
+```
+
+Now we need to allow host to connect to the guest's libvirt session, we will use
+ssh for it:
+
+```console
+:~$ # We're now inside the container
+:~$ sudo dnf install openssh-server
+:-$ echo "ListenAddress 127.0.0.1
+Port 2222" | sudo tee -a /etc/ssh/sshd_config
+:-$ sudo systemctl enable --now sshd
+:-$ sudo systemctl restart sshd
+:~$ sudo su -
+:~# passwd
+```
+
+Now set a password for root user.
+
+## Connect from the host
+
+You can now install VirtManager, you can either use a normal (non root) distrobox, and export the app
+
+Now you will need to **Add a connection**:
+
+![image](https://user-images.githubusercontent.com/598882/208441337-4dbade85-4c72-4342-b9ee-acd76b9b1675.png)
+
+Then set it like this:
+
+![image](https://user-images.githubusercontent.com/598882/208441499-e612868f-d9d1-452c-8bfb-110440e2e891.png)
+
+- Tick the "Use ssh" option
+- username: root
+- hostname: 127.0.0.1:2222
+
+Optionally you can set it to autoconnect.
+
+Now you can simply double click the connection to activate it, you'll be prompted
+with a password, insert the one you used in the `passwd` step previously:
+
+![image](https://user-images.githubusercontent.com/598882/208441932-f561af0b-9c19-45f7-bacc-d690d80b75e1.png)
+
+And you should be good to go!
+
+![image](https://user-images.githubusercontent.com/598882/208442009-fe9df606-e6a8-44f9-94c2-1c2bfba4ca15.png)
diff --git a/docs/usage/distrobox-create.md b/docs/usage/distrobox-create.md
index 56cf86d..ad8b50f 100644
--- a/docs/usage/distrobox-create.md
+++ b/docs/usage/distrobox-create.md
@@ -32,6 +32,7 @@ graphical apps (X11/Wayland), and audio.
--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.
+ --compatibility/-C: show list of compatible images
--help/-h: show this message
--no-entry: do not generate a container entry in the application list
--dry-run/-d: only print the container manager command generated
@@ -64,12 +65,16 @@ Supported environment variables:
DBX_CONTAINER_ALWAYS_PULL
DBX_CONTAINER_CUSTOM_HOME
+ DBX_CONTAINER_HOME_PREFIX
DBX_CONTAINER_IMAGE
DBX_CONTAINER_MANAGER
DBX_CONTAINER_NAME
DBX_NON_INTERACTIVE
DBX_SUDO_PROGRAM
+DBX_CONTAINER_HOME_PREFIX defines where containers' home directories will be located.
+If you define it as ~/dbx then all future containers' home directories will be ~/dbx/$container_name
+
The `--additional-flags` or `-a` is useful to modify defaults in the container creations.
For example:
@@ -120,5 +125,9 @@ Note that enabling `--init` **will disable host's process integration**.
From within the container you will not be able to see and manage host's processes.
This is needed because `/sbin/init` must be pid 1.
+The `--home` flag let's you specify a custom HOME for the container.
+Note that this will NOT prevent the mount of the host's home directory,
+but will ensure that configs and dotfiles will not litter it.
+
From version 1.4.0 of distrobox, when you create a new container, it will also generate
an entry in the applications list.
diff --git a/docs/usage/distrobox-rm.md b/docs/usage/distrobox-rm.md
index 2a9f5e5..f9bd306 100644
--- a/docs/usage/distrobox-rm.md
+++ b/docs/usage/distrobox-rm.md
@@ -14,6 +14,7 @@ distrobox-rm delete one of the available distroboxes.
--name/-n: name for the distrobox
--force/-f: force deletion
+ --rm-home: remove the mounted home if it differs from the host user's one
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
way over "sudo distrobox" (note: if using a program other than 'sudo' for root privileges is necessary,
specify it through the DBX_SUDO_PROGRAM env variable, or 'distrobox_sudo_program' config variable)
diff --git a/docs/useful_tips.md b/docs/useful_tips.md
index d36f5a6..995a2bf 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)
+ - [Launch a distrobox from you applications list](#launch-a-distrobox-from-you-applications-list)
- [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)
@@ -10,18 +10,15 @@
- [Execute commands on the host](#execute-commands-on-the-host)
- [Enable SSH X-Forwarding when SSH-ing in a distrobox](#enable-ssh-x-forwarding-when-ssh-ing-in-a-distrobox)
- [Use distrobox to install different flatpaks from the host](#use-distrobox-to-install-different-flatpaks-from-the-host)
- - [Using podman inside a distrobox](#using-podman-inside-a-distrobox)
- - [Using docker inside a distrobox](#using-docker-inside-a-distrobox)
+ - [Using podman or docker inside a distrobox](#using-podman-or-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)
- [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)
+ - [Apply resource limitation on the fly](#apply-resource-limitation-on-the-fly)
---
@@ -38,20 +35,6 @@ To delete it:
`distrobox generate-entry you-container-name --delete`
-## 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.
-
-For example:
-
-`distrobox enter test -- bash -l -c '"echo \$HOME && whoami"'`
-
-Note the use of **single quotes around double quotes**, this is necessary so that
-quotes are preserved inside the arguments. Also note the **dollar escaping** needed
-so that $HOME is not evaluated at the time of the command launch, but directly
-inside the container.
-
## Create a distrobox with a custom HOME directory
`distrobox create` supports the use of the `--home` flag, as specified in the
@@ -59,7 +42,7 @@ 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-chosen-image:tag --home /your/custom/home`
## Mount additional volumes in a distrobox
@@ -68,7 +51,7 @@ 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-chosen-image:tag --volume /your/custom/volume/path`
## Use a different shell than the host
@@ -97,7 +80,7 @@ Instead of running `sudo distrobox` to do stuff, it is better to simply use norm
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`
+`distrobox create --name test --image your-chosen-image:tag --root`
## Using a command other than sudo to run a rootful container
@@ -180,7 +163,7 @@ 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-chosen-image:tag \
--init-hooks '"$(uname -n)" > /etc/hostname'`
```
@@ -197,34 +180,30 @@ 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-chosen-image:tag \
--init-hooks 'umount /var/lib/flatpak'`
```
After that you'll be able to have separate flatpaks between host and distrobox.
You can procede to export them using `distrobox-export` (for distrobox 1.2.14+)
-## Using podman inside a distrobox
-
-If `distrobox` is using `podman` as the container engine, you can use
-`podman socket` to control host's podman from inside a `distrobox`, just use:
-
-`podman --remote`
-
-inside the `distrobox` to use it.
+## Using podman or docker inside a distrobox
-It may be necessary to enable the socket on your host system by using:
+You can easily control host's instance of docker or podman, using `distrobox-host-exec`
+You can use:
-`systemctl --user enable --now podman.socket`
+```console
+sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/podman
+```
-## Using docker inside a distrobox
+or
-You can use `docker` to control host's podman from inside a `distrobox`,
-by default if `distrobox` is using docker as a container engine, it will mount the
-docker.sock into the container.
+```console
+sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/docker
+```
-So in the container just install `docker`, add yourself to the `docker` group, and
-you should be good to go.
+This will create a `podman` or `docker` command inside the distrobox that will
+trasparently execute the command on the host.
## Using init system inside a distrobox
@@ -234,6 +213,9 @@ Example of such images are:
- docker.io/almalinux/8-init
- registry.access.redhat.com/ubi7/ubi-init
- registry.access.redhat.com/ubi8/ubi-init
+- registry.access.redhat.com/ubi9/ubi-init
+- registry.opensuse.org/opensuse/leap:latest
+- registry.opensuse.org/opensuse/tumbleweed:latest
You can use such feature using:
@@ -296,15 +278,6 @@ 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
-
-`systemctl --user enable --now podman.socket`
-
-this will improve a lot `podman`'s command performances.
-
## 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`
@@ -404,3 +377,110 @@ distrobox create -i docker.io/library/almalinux:9 -n alma9 --pre-init-hooks "dnf
```shell
distrobox create -i quay.io/centos/centos:stream9 c9s --pre-init-hooks "dnf -y install dnf-plugins-core && dnf config-manager --enable crb && dnf -y install epel-next-release"
```
+
+## Apply resource limitation on the fly
+
+Podman has `--cpuset-cpus` and `--memory` flags to apply limitation on how much resources a container can use. However,
+these flags only work during container creation (`podman create` / `podman run`) and not after it's created
+(`podman exec`, which is used by Distrobox to execute commands inside of container), which means changing resource
+limitation requires recreation of a container.
+
+Nontheless you can still apply resource limitation using systemd's resource control functionality. It's not recommended
+to pass resource limitation arguments (e.g. `--cpuset-cpus` and `--memory`) to `distrobox create --additional-flags`
+as systemd already provides much more flexible resource control functionality.
+
+To list all distroboxes and their full IDs:
+
+```bash
+podman ps --all --no-trunc --format "{{.Names}} {{.ID}} {{.Labels}}" | grep "manager:distrobox" | cut -d " " -f1,2 | column -t
+```
+
+- Removing `--all` flag will cause the output to only contain currently running distroboxes
+
+To check your container status with `systemctl`:
+
+```bash
+systemctl --user status libpod-$UUID.scope
+```
+
+- Your distrobox needs to be running for its scope to present (e.g. `distrobox enter` before running this command)
+- Replace `$UUID` with your container's real full ID
+- To make things easier when tweaking properties, optionally set a environment variable for the current shell:
+
+ bash/zsh:
+
+ ```bash
+ UUID=XXXXXXXXX
+ ```
+
+ fish:
+
+ ```fish
+ set UUID XXXXXXXXX
+ ```
+
+Everything provided by `systemd.resource-control` could be applied to your distrobox. For example:
+
+To make your distrobox only run on CPU0 and CPU1:
+
+```bash
+systemctl --user set-property libpod-$UUID.scope AllowedCPUs=0,1
+```
+
+To hard throttle your distrobox to not use above 20% of CPU:
+
+```bash
+systemctl --user set-property libpod-$UUID.scope CPUQuota=20%
+```
+
+To limit your distrobox's maximum amount of memory:
+
+```bash
+systemctl --user set-property libpod-$UUID.scope MemoryMax=2G
+```
+
+To give your distrobox less IO bandwidth when IO is overloaded:
+
+```bash
+systemctl --user set-property libpod-$UUID.scope IOWeight=1
+```
+
+- `IOWeight` accepts value from `1` to `10000`, higher means more bandwidth.
+
+To see all applicable properties:
+
+```bash
+man systemd.resource-control
+```
+
+Changes are transient, meaning you lose the resource limitation properties when distrobox is stopped and restarted.
+
+To make certain changes persistent, first check the currently active properties:
+
+```bash
+systemctl --user status libpod-$UUID.scope
+```
+
+Look for the `Drop-In` lines. Something like this should be shown:
+
+```console
+ Drop-In: /run/user/1000/systemd/transient/libpod-45ae38d61c9a636230b2ba89ea07792d662e01cd9ee38d04feb0a994b039a271.scope.d
+ └─50-AllowedCPUs.conf
+```
+
+Move the transient overrides to persistent overrides:
+
+```bash
+mkdir -p ~/.config/systemd/user/libpod-$UUID.scope.d
+mv --target-directory="$HOME/.config/systemd/user/libpod-$UUID.scope.d" \
+ "/run/user/$(id -u)/systemd/transient/libpod-$UUID.scope.d/50-AllowedCPUs.conf"
+```
+
+- Replace `$(id -u)` with your real user id if it did not get expanded properly.
+- `50-AllowedCPUs.conf` is only an example. Replace it with something you want to keep persistently.
+
+Then reload systemd daemon to apply the changes:
+
+```bash
+systemctl --user daemon-reload
+```
diff --git a/extras/install-podman b/extras/install-podman
index 0531981..b87075b 100755
--- a/extras/install-podman
+++ b/extras/install-podman
@@ -161,7 +161,6 @@ exit_command_delay = 10
# can be runc, crun
runtime = "crun"
stop_timeout = 5
-cni_plugin_dirs = [ "${dest_path}/lib/cni" ]
conmon_path=[ "${dest_path}/lib/podman/conmon" ]
helper_binaries_dir = [ "${dest_path}/lib/podman" ]
static_dir = "${dest_path}/share/podman/libpod"
@@ -169,6 +168,8 @@ volume_path = "${dest_path}/share/podman/volume"
[engine.runtimes]
crun = [ "${dest_path}/bin/crun" ]
runc = [ "${dest_path}/bin/runc" ]
+[network]
+cni_plugin_dirs = [ "${dest_path}/lib/cni" ]
EOF
# Same for mouning programs
diff --git a/install b/install
index b482912..dcb4b81 100755
--- a/install
+++ b/install
@@ -21,6 +21,7 @@
next=0
verbose=0
+version=1.4.2.1
# Print usage to stdout.
# Arguments:
@@ -131,8 +132,7 @@ else
printf >&2 "\033[1;31m Downloading...\n\033[0m"
if [ "${next}" -eq 0 ]; then
- release_ver=$(${download} - https://github.com/89luca89/distrobox/releases/latest |
- grep 'refs/tags' | tail -1 | cut -d'"' -f2)
+ release_ver="89luca89/distrobox/archive/refs/tags/${version}.tar.gz"
release_name=$(echo "${release_ver}" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.tar\.gz$')
else
release_ver="89luca89/distrobox/archive/refs/heads/main.tar.gz"
diff --git a/man/man1/distrobox-compatibility.1 b/man/man1/distrobox-compatibility.1
index 92c3471..46d0e9e 100644
--- a/man/man1/distrobox-compatibility.1
+++ b/man/man1/distrobox-compatibility.1
@@ -15,7 +15,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH COMPATIBILITY
.PP
@@ -134,7 +134,7 @@ Debian
T}@T{
7 8 9 10 11
T}@T{
-docker.io/debian/eol:wheezy docker.io/library/debian:8
+docker.io/debian/eol:wheezy docker.io/debian/eol:jessie
docker.io/library/debian:9 docker.io/library/debian:10
docker.io/library/debian:stable
docker.io/library/debian:stable-backports
@@ -157,18 +157,18 @@ T}
T{
Fedora
T}@T{
-35 36 37 Rawhide
+35 36 37 38 Rawhide
T}@T{
-registry.fedoraproject.org/fedora-toolbox:35 quay.io/fedora/fedora:35
+registry.fedoraproject.org/fedora-toolbox:37 quay.io/fedora/fedora:35
quay.io/fedora/fedora:36 registry.fedoraproject.org/fedora:37
-quay.io/fedora/fedora:rawhide
+quay.io/fedora/fedora:38
T}
T{
Gentoo Linux
T}@T{
rolling
T}@T{
-You will have to Build your own to have a complete Gentoo docker image
+docker.io/gentoo/stage3:latest
T}
T{
Kali Linux
@@ -273,7 +273,7 @@ T}
.TE
.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),>
+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
diff --git a/man/man1/distrobox-create.1 b/man/man1/distrobox-create.1
index ba36f82..cda2a1a 100644
--- a/man/man1/distrobox-create.1
+++ b/man/man1/distrobox-create.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-CREATE" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-CREATE" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -54,6 +54,7 @@ usb devices and graphical apps (X11/Wayland), and audio.
--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.
+--compatibility/-C: show list of compatible images
--help/-h: show this message
--no-entry: do not generate a container entry in the application list
--dry-run/-d: only print the container manager command generated
@@ -101,6 +102,7 @@ Supported environment variables:
\f[C]
DBX_CONTAINER_ALWAYS_PULL
DBX_CONTAINER_CUSTOM_HOME
+DBX_CONTAINER_HOME_PREFIX
DBX_CONTAINER_IMAGE
DBX_CONTAINER_MANAGER
DBX_CONTAINER_NAME
@@ -109,6 +111,11 @@ DBX_SUDO_PROGRAM
\f[R]
.fi
.PP
+DBX_CONTAINER_HOME_PREFIX defines where containers\[cq] home directories
+will be located.
+If you define it as \[ti]/dbx then all future containers\[cq] home
+directories will be \[ti]/dbx/$container_name
+.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:
@@ -192,5 +199,10 @@ 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.
.PP
+The \f[V]--home\f[R] flag let\[cq]s you specify a custom HOME for the
+container.
+Note that this will NOT prevent the mount of the host\[cq]s home
+directory, but will ensure that configs and dotfiles will not litter it.
+.PP
From version 1.4.0 of distrobox, when you create a new container, it
will also generate an entry in the applications list.
diff --git a/man/man1/distrobox-enter.1 b/man/man1/distrobox-enter.1
index d6763a1..a03c953 100644
--- a/man/man1/distrobox-enter.1
+++ b/man/man1/distrobox-enter.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-ENTER" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-ENTER" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-ephemeral.1 b/man/man1/distrobox-ephemeral.1
index dd79d04..6d5e0c5 100644
--- a/man/man1/distrobox-ephemeral.1
+++ b/man/man1/distrobox-ephemeral.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-EPHEMERAL" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-EPHEMERAL" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-export.1 b/man/man1/distrobox-export.1
index 51bd291..639cb28 100644
--- a/man/man1/distrobox-export.1
+++ b/man/man1/distrobox-export.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-EXPORT" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-EXPORT" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-generate-entry.1 b/man/man1/distrobox-generate-entry.1
index eb7ac2d..208ac3d 100644
--- a/man/man1/distrobox-generate-entry.1
+++ b/man/man1/distrobox-generate-entry.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-GENERATE-ENTRY" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-GENERATE-ENTRY" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-host-exec.1 b/man/man1/distrobox-host-exec.1
index 44e017a..7748b7a 100644
--- a/man/man1/distrobox-host-exec.1
+++ b/man/man1/distrobox-host-exec.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-HOST-EXEC" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-HOST-EXEC" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-init.1 b/man/man1/distrobox-init.1
index 664460a..091de7a 100644
--- a/man/man1/distrobox-init.1
+++ b/man/man1/distrobox-init.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-INIT" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-INIT" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-list.1 b/man/man1/distrobox-list.1
index 24c2912..cc3cff7 100644
--- a/man/man1/distrobox-list.1
+++ b/man/man1/distrobox-list.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-LIST" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-LIST" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-rm.1 b/man/man1/distrobox-rm.1
index 8c20a92..8a78a7c 100644
--- a/man/man1/distrobox-rm.1
+++ b/man/man1/distrobox-rm.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-RM" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-RM" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -35,6 +35,7 @@ distrobox-rm delete one of the available distroboxes.
\f[C]
--name/-n: name for the distrobox
--force/-f: force deletion
+--rm-home: remove the mounted home if it differs from the host user\[aq]s one
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
way over \[dq]sudo distrobox\[dq] (note: if using a program other than \[aq]sudo\[aq] for root privileges is necessary,
specify it through the DBX_SUDO_PROGRAM env variable, or \[aq]distrobox_sudo_program\[aq] config variable)
diff --git a/man/man1/distrobox-stop.1 b/man/man1/distrobox-stop.1
index 1162b68..6b82113 100644
--- a/man/man1/distrobox-stop.1
+++ b/man/man1/distrobox-stop.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-STOP" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-STOP" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox-upgrade.1 b/man/man1/distrobox-upgrade.1
index 4f1f769..da29b5e 100644
--- a/man/man1/distrobox-upgrade.1
+++ b/man/man1/distrobox-upgrade.1
@@ -14,7 +14,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-UPGRADE" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-UPGRADE" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
diff --git a/man/man1/distrobox.1 b/man/man1/distrobox.1
index 4a86117..677aec6 100644
--- a/man/man1/distrobox.1
+++ b/man/man1/distrobox.1
@@ -15,7 +15,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH COMPATIBILITY
.PP
@@ -134,7 +134,7 @@ Debian
T}@T{
7 8 9 10 11
T}@T{
-docker.io/debian/eol:wheezy docker.io/library/debian:8
+docker.io/debian/eol:wheezy docker.io/debian/eol:jessie
docker.io/library/debian:9 docker.io/library/debian:10
docker.io/library/debian:stable
docker.io/library/debian:stable-backports
@@ -157,18 +157,18 @@ T}
T{
Fedora
T}@T{
-35 36 37 Rawhide
+35 36 37 38 Rawhide
T}@T{
-registry.fedoraproject.org/fedora-toolbox:35 quay.io/fedora/fedora:35
+registry.fedoraproject.org/fedora-toolbox:37 quay.io/fedora/fedora:35
quay.io/fedora/fedora:36 registry.fedoraproject.org/fedora:37
-quay.io/fedora/fedora:rawhide
+quay.io/fedora/fedora:38
T}
T{
Gentoo Linux
T}@T{
rolling
T}@T{
-You will have to Build your own to have a complete Gentoo docker image
+docker.io/gentoo/stage3:latest
T}
T{
Kali Linux
@@ -273,7 +273,7 @@ T}
.TE
.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),>
+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
@@ -323,7 +323,7 @@ dependencies are met.
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-CREATE" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-CREATE" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -363,6 +363,7 @@ usb devices and graphical apps (X11/Wayland), and audio.
--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.
+--compatibility/-C: show list of compatible images
--help/-h: show this message
--no-entry: do not generate a container entry in the application list
--dry-run/-d: only print the container manager command generated
@@ -410,6 +411,7 @@ Supported environment variables:
\f[C]
DBX_CONTAINER_ALWAYS_PULL
DBX_CONTAINER_CUSTOM_HOME
+DBX_CONTAINER_HOME_PREFIX
DBX_CONTAINER_IMAGE
DBX_CONTAINER_MANAGER
DBX_CONTAINER_NAME
@@ -418,6 +420,11 @@ DBX_SUDO_PROGRAM
\f[R]
.fi
.PP
+DBX_CONTAINER_HOME_PREFIX defines where containers\[cq] home directories
+will be located.
+If you define it as \[ti]/dbx then all future containers\[cq] home
+directories will be \[ti]/dbx/$container_name
+.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:
@@ -501,6 +508,11 @@ 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.
.PP
+The \f[V]--home\f[R] flag let\[cq]s you specify a custom HOME for the
+container.
+Note that this will NOT prevent the mount of the host\[cq]s home
+directory, but will ensure that configs and dotfiles will not litter it.
+.PP
From version 1.4.0 of distrobox, when you create a new container, it
will also generate an entry in the applications list.
.\
@@ -519,7 +531,7 @@ will also generate an entry in the applications list.
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-ENTER" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-ENTER" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -645,7 +657,7 @@ run distrobox commands involving rootful containers using `doas'.
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-EPHEMERAL" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-EPHEMERAL" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -726,7 +738,7 @@ a list of supported environment variables to use.
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-EXPORT" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-EXPORT" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -981,7 +993,7 @@ option to provide a series of flags, for example:
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-GENERATE-ENTRY" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-GENERATE-ENTRY" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1032,7 +1044,7 @@ distrobox-generate-entry container-name [--delete] [--icon [auto,/path/to/icon]]
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-HOST-EXEC" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-HOST-EXEC" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1104,7 +1116,7 @@ distrobox-host-exec podman ps -a
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-INIT" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-INIT" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1170,7 +1182,7 @@ distrobox-init --upgrade
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-LIST" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-LIST" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1243,7 +1255,7 @@ DBX_SUDO_PROGRAM
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-RM" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-RM" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1264,6 +1276,7 @@ distrobox-rm delete one of the available distroboxes.
\f[C]
--name/-n: name for the distrobox
--force/-f: force deletion
+--rm-home: remove the mounted home if it differs from the host user\[aq]s one
--root/-r: launch podman/docker with root privileges. Note that if you need root this is the preferred
way over \[dq]sudo distrobox\[dq] (note: if using a program other than \[aq]sudo\[aq] for root privileges is necessary,
specify it through the DBX_SUDO_PROGRAM env variable, or \[aq]distrobox_sudo_program\[aq] config variable)
@@ -1316,7 +1329,7 @@ DBX_SUDO_PROGRAM
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-STOP" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-STOP" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
@@ -1393,7 +1406,7 @@ DBX_SUDO_PROGRAM
. ftr VB CB
. ftr VBI CBI
.\}
-.TH "DISTROBOX-UPGRADE" "1" "Sep 2022" "Distrobox" "User Manual"
+.TH "DISTROBOX-UPGRADE" "1" "Dec 2022" "Distrobox" "User Manual"
.hy
.SH NAME
.IP
More information about the Neon-commits
mailing list