mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
docs: update and format docs
This commit is contained in:
+1
-1
@@ -6,4 +6,4 @@ Just follow them:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
**Let's just all be wholesome to each other please**
|
## Let's just all be wholesome to each other please
|
||||||
|
|||||||
+35
-16
@@ -1,6 +1,7 @@
|
|||||||
# Contributing to Distrobox
|
# Contributing to Distrobox
|
||||||
|
|
||||||
We greatly appreciate your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
|
We greatly appreciate your input! We want to make contributing to this project
|
||||||
|
as easy and transparent as possible, whether it's:
|
||||||
|
|
||||||
- Reporting a bug
|
- Reporting a bug
|
||||||
- Discussing the current state of the code
|
- Discussing the current state of the code
|
||||||
@@ -21,7 +22,9 @@ We actively welcome your pull requests:
|
|||||||
|
|
||||||
## Any contributions you make will be under the GPLv3 Software License
|
## Any contributions you make will be under the GPLv3 Software License
|
||||||
|
|
||||||
In short, when you submit code changes, your submissions are understood to be under the same [GPLv3 License](https://choosealicense.com/licenses/gpl-3.0/) that covers the project.
|
In short, when you submit code changes, your submissions are understood to be
|
||||||
|
under the same [GPLv3 License](https://choosealicense.com/licenses/gpl-3.0/) that
|
||||||
|
covers the project.
|
||||||
Feel free to contact the maintainers if that's a concern.
|
Feel free to contact the maintainers if that's a concern.
|
||||||
|
|
||||||
## Suggestions
|
## Suggestions
|
||||||
@@ -29,22 +32,27 @@ Feel free to contact the maintainers if that's a concern.
|
|||||||
Suggestions are welcome, be sure:
|
Suggestions are welcome, be sure:
|
||||||
|
|
||||||
- it is not already being discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
|
- it is not already being discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
|
||||||
- If it has and is marked as OPEN, go ahead and share your own thoughts about the topic!
|
- If it has and is marked as OPEN, go ahead and share your own
|
||||||
- If it has and is marked as CLOSED, please read the ticket and depending on whether the suggestion was accepted or not consider if it is worth opening a new issue or not.
|
thoughts about the topic!
|
||||||
|
- If it has and is marked as CLOSED, please read the ticket and depending on
|
||||||
|
whether the suggestion was accepted or not consider if it is worth opening
|
||||||
|
a new issue or not.
|
||||||
- Consider if the suggestion is not too out of scope of the project.
|
- Consider if the suggestion is not too out of scope of the project.
|
||||||
- Mark them with a [Suggestion] in the title
|
- Mark them with a [Suggestion] in the title
|
||||||
|
|
||||||
## Report bugs using Github's [issues](https://github.com/89luca89/distrobox/issues)
|
## Report bugs using Github's [issues](https://github.com/89luca89/distrobox/issues)
|
||||||
|
|
||||||
We use GitHub issues to track public bugs.
|
We use GitHub issues to track public bugs.
|
||||||
Report a bug by [opening a new issue](); it's that easy!
|
Report a bug by
|
||||||
|
[opening a new issue](https://github.com/89luca89/distrobox/issues); it's that easy!
|
||||||
|
|
||||||
### Write bug reports with detail, background, and sample code
|
### Write bug reports with detail, background, and sample code
|
||||||
|
|
||||||
**A good bug report** should have:
|
**A good bug report** should have:
|
||||||
|
|
||||||
- Check that the bug is not already discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
|
- Check that the bug is not already discussed in the [issue tracker](https://github.com/89luca89/distrobox/issues)
|
||||||
- See our [documentation](https://github.com/89luca89/distrobox/tree/main/docs) if there are some steps that could help you solve your issue
|
- See our [documentation](https://github.com/89luca89/distrobox/tree/main/docs)
|
||||||
|
if there are some steps that could help you solve your issue
|
||||||
- Mark them with an [Error] in the title
|
- Mark them with an [Error] in the title
|
||||||
- A quick summary and/or background
|
- A quick summary and/or background
|
||||||
- Steps to reproduce
|
- Steps to reproduce
|
||||||
@@ -52,28 +60,39 @@ Report a bug by [opening a new issue](); it's that easy!
|
|||||||
- Provide logs (terminal output, runs with verbose mode)
|
- Provide logs (terminal output, runs with verbose mode)
|
||||||
- What you expected would happen
|
- What you expected would happen
|
||||||
- What actually happens
|
- What actually happens
|
||||||
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
|
- Notes (possibly including why you think this might be happening, or stuff you
|
||||||
|
tried that didn't work)
|
||||||
|
|
||||||
## Use a Consistent Coding Style
|
## Use a Consistent Coding Style
|
||||||
|
|
||||||
- use `shellcheck` to check for posix compliance and bashisms using:
|
- use `shellcheck` to check for posix compliance and bashisms using:
|
||||||
- `shellcheck -s sh -o all -Cnever -Sstyle -a -f gcc -x`
|
- `shellcheck -s sh -o all -Cnever -Sstyle -a -f gcc -x`
|
||||||
- install from: [HERE](https://github.com/koalaman/shellcheck) following [this](https://github.com/koalaman/shellcheck#installing)
|
- install from: [HERE](https://github.com/koalaman/shellcheck)
|
||||||
|
following [this](https://github.com/koalaman/shellcheck#installing)
|
||||||
- use `shfmt` to style the code using:
|
- use `shfmt` to style the code using:
|
||||||
- `shfmt -s`
|
- `shfmt -s`
|
||||||
- install from [HERE](https://github.com/mvdan/sh) using `go install mvdan.cc/sh/v3/cmd/shfmt@latest`
|
- install from [HERE](https://github.com/mvdan/sh) using `go install mvdan.cc/sh/v3/cmd/shfmt@latest`
|
||||||
- Legibility of the code is more important than code golfing, try to be expressive in the code
|
- Legibility of the code is more important than code golfing, try to be
|
||||||
- Error checking is important! Ensure to LBYL (Look Before You Leap), check for variables and for code success exit codes
|
expressive in the code
|
||||||
- Don't hesitate to comment your code! We're placing high importance on this to maintain the code readable and understandeable
|
- Error checking is important! Ensure to LBYL (Look Before You Leap), check for
|
||||||
- Update documentation to reflect your changes - Manual pages can be found in directory `docs`
|
variables and for code success exit codes
|
||||||
|
- Don't hesitate to comment your code! We're placing high importance on this to
|
||||||
|
maintain the code readable and understandeable
|
||||||
|
- Update documentation to reflect your changes - Manual pages can be found in
|
||||||
|
directory `docs`
|
||||||
|
|
||||||
If you are using Visual Studio Code, there are [plugins](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck) that include all this functionality and throw a warning if you're doing something wrong.
|
If you are using Visual Studio Code, there are [plugins](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck)
|
||||||
If you are using Vim or Emacs there are plenty of linters and checkers that will integrate with the 2 tools listed above.
|
that include all this functionality and throw a warning if you're doing
|
||||||
|
something wrong.
|
||||||
|
If you are using Vim or Emacs there are plenty of linters and checkers that will
|
||||||
|
integrate with the 2 tools listed above.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
By contributing, you agree that your contributions will be licensed under its GPLv3 License.
|
By contributing, you agree that your contributions will be licensed under
|
||||||
|
its GPLv3 License.
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
|
This document was adapted from the open-source contribution guidelines
|
||||||
|
for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
### GNU GENERAL PUBLIC LICENSE
|
# GNU GENERAL PUBLIC LICENSE
|
||||||
|
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ Copyright (C) 2007 Free Software Foundation, Inc.
|
|||||||
Everyone is permitted to copy and distribute verbatim copies of this
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
license document, but changing it is not allowed.
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
### Preamble
|
## Preamble
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
The GNU General Public License is a free, copyleft license for
|
||||||
software and other kinds of works.
|
software and other kinds of works.
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ Usage:
|
|||||||
distrobox-export --service syncthing.service [--extra-flags "flags"] [--delete] [--sudo]
|
distrobox-export --service syncthing.service [--extra-flags "flags"] [--delete] [--sudo]
|
||||||
distrobox-export --bin /path/to/bin --export-path ~/.local/bin [--extra-flags "flags"] [--delete] [--sudo]
|
distrobox-export --bin /path/to/bin --export-path ~/.local/bin [--extra-flags "flags"] [--delete] [--sudo]
|
||||||
|
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
--app/-a: name of the application to export
|
--app/-a: name of the application to export
|
||||||
|
|||||||
+98
-51
@@ -11,10 +11,13 @@
|
|||||||
[](https://github.com/89luca89/distrobox/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
|
[](https://github.com/89luca89/distrobox/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
|
||||||
[](https://github.com/89luca89/distrobox/issues?q=is%3Aissue+is%3Aopen+label%3A%22bug%22)
|
[](https://github.com/89luca89/distrobox/issues?q=is%3Aissue+is%3Aopen+label%3A%22bug%22)
|
||||||
|
|
||||||
Use any Linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with.
|
Use any Linux distribution inside your terminal. Enable both backward and forward
|
||||||
Distrobox uses `podman` or `docker` to create containers using the Linux distribution of your choice.
|
compatibility with software and freedom to use whatever distribution you’re more
|
||||||
The created container will be tightly integrated with the host, allowing sharing of
|
comfortable with.
|
||||||
the HOME directory of the user, external storage, external USB devices and
|
Distrobox uses `podman` or `docker` to create containers using the Linux distribution
|
||||||
|
of your choice.
|
||||||
|
The created container will be tightly integrated with the host, allowing sharing
|
||||||
|
of the HOME directory of the user, external storage, external USB devices and
|
||||||
graphical apps (X11/Wayland), and audio.
|
graphical apps (X11/Wayland), and audio.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -24,9 +27,9 @@ graphical apps (X11/Wayland), and audio.
|
|||||||
---
|
---
|
||||||
|
|
||||||
- [Distrobox](#distrobox)
|
- [Distrobox](#distrobox)
|
||||||
* [What it does](#what-it-does)
|
- [What it does](#what-it-does)
|
||||||
- [See it in action](#see-it-in-action)
|
- [See it in action](#see-it-in-action)
|
||||||
* [Why?](#why-)
|
- [Why?](#why-)
|
||||||
- [Aims](#aims)
|
- [Aims](#aims)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Uninstallation](#uninstallation)
|
- [Uninstallation](#uninstallation)
|
||||||
@@ -35,16 +38,16 @@ graphical apps (X11/Wayland), and audio.
|
|||||||
- [Host Distros](compatibility.md#host-distros)
|
- [Host Distros](compatibility.md#host-distros)
|
||||||
- [Containers Distros](compatibility.md#containers-distros)
|
- [Containers Distros](compatibility.md#containers-distros)
|
||||||
- [Usage](usage/usage.md)
|
- [Usage](usage/usage.md)
|
||||||
* [Outside the distrobox](#outside-the-distrobox)
|
- [Outside the distrobox](#outside-the-distrobox)
|
||||||
- [distrobox-create](usage/distrobox-create.md)
|
- [distrobox-create](usage/distrobox-create.md)
|
||||||
- [distrobox-enter](usage/distrobox-enter.md)
|
- [distrobox-enter](usage/distrobox-enter.md)
|
||||||
- [distrobox-list](usage/distrobox-list.md)
|
- [distrobox-list](usage/distrobox-list.md)
|
||||||
- [distrobox-rm](usage/distrobox-rm.md)
|
- [distrobox-rm](usage/distrobox-rm.md)
|
||||||
- [distrobox-stop](usage/distrobox-stop.md)
|
- [distrobox-stop](usage/distrobox-stop.md)
|
||||||
* [Inside the distrobox](#inside-the-distrobox)
|
- [Inside the distrobox](#inside-the-distrobox)
|
||||||
- [distrobox-export](usage/distrobox-export.md)
|
- [distrobox-export](usage/distrobox-export.md)
|
||||||
- [distrobox-init](usage/distrobox-init.md)
|
- [distrobox-init](usage/distrobox-init.md)
|
||||||
* [Configure distrobox](#configure-distrobox)
|
- [Configure distrobox](#configure-distrobox)
|
||||||
- [Useful tips](useful_tips.md)
|
- [Useful tips](useful_tips.md)
|
||||||
- [Execute complex commands directly from distrobox-enter](useful_tips.md#execute-complex-commands-directly-from-distrobox-enter)
|
- [Execute complex commands directly from distrobox-enter](useful_tips.md#execute-complex-commands-directly-from-distrobox-enter)
|
||||||
- [Create a distrobox with a custom HOME directory](useful_tips.md#create-a-distrobox-with-a-custom-home-directory)
|
- [Create a distrobox with a custom HOME directory](useful_tips.md#create-a-distrobox-with-a-custom-home-directory)
|
||||||
@@ -84,14 +87,18 @@ graphical apps (X11/Wayland), and audio.
|
|||||||
|
|
||||||
## What it does
|
## What it does
|
||||||
|
|
||||||
Simply put it's a fancy wrapper around `podman` or `docker` to create and start containers highly integrated with the hosts.
|
Simply put it's a fancy wrapper around `podman` or `docker` to create and start
|
||||||
|
containers highly integrated with the hosts.
|
||||||
|
|
||||||
The distrobox environment is based on an OCI image.
|
The distrobox environment is based on an OCI image.
|
||||||
This image is used to create a container that seamlessly integrates with the rest of the operating system by providing access to the user's home directory,
|
This image is used to create a container that seamlessly integrates with the
|
||||||
the Wayland and X11 sockets, networking, removable devices (like USB sticks), systemd journal, SSH agent, D-Bus,
|
rest of the operating system by providing access to the user's home directory,
|
||||||
|
the Wayland and X11 sockets, networking, removable devices (like USB sticks),
|
||||||
|
systemd journal, SSH agent, D-Bus,
|
||||||
ulimits, /dev and the udev database, etc...
|
ulimits, /dev and the udev database, etc...
|
||||||
|
|
||||||
It implements the same concepts introduced by <https://github.com/containers/toolbox> but in a simplified way using POSIX sh and aiming at broader compatibility.
|
It implements the same concepts introduced by <https://github.com/containers/toolbox>
|
||||||
|
but in a simplified way using POSIX sh and aiming at broader compatibility.
|
||||||
|
|
||||||
All the props go to them as they had the great idea to implement this stuff.
|
All the props go to them as they had the great idea to implement this stuff.
|
||||||
|
|
||||||
@@ -102,38 +109,54 @@ It is divided into 6 commands:
|
|||||||
- `distrobox-list` - to list containers created with distrobox
|
- `distrobox-list` - to list containers created with distrobox
|
||||||
- `distrobox-rm` - to delete a container created with distrobox
|
- `distrobox-rm` - to delete a container created with distrobox
|
||||||
- `distrobox-stop` - to stop a running container created with distrobox
|
- `distrobox-stop` - to stop a running container created with distrobox
|
||||||
- `distrobox-init` - it's the entrypoint of the container (not meant to be used manually)
|
- `distrobox-init` - the entrypoint of the container (not meant to be used manually)
|
||||||
- `distrobox-export` - it is meant to be used inside the container, useful to export apps and services from the container to the host
|
- `distrobox-export` - it is meant to be used inside the container,
|
||||||
|
useful to export apps and services from the container to the host
|
||||||
|
|
||||||
It also includes a little wrapper to launch commands with `distrobox COMMAND` instead of calling the single files.
|
It also includes a little wrapper to launch commands with `distrobox COMMAND`
|
||||||
|
instead of calling the single files.
|
||||||
|
|
||||||
### See it in action
|
### See it in action
|
||||||
|
|
||||||
Thanks to [castrojo](https://github.com/castrojo), you can see Distrobox in action in this explanatory video on his setup with Distrobox, Toolbx, Fedora Silverblue on his project [ublue](https://github.com/castrojo/ublue) (check it out!)
|
Thanks to [castrojo](https://github.com/castrojo), you can see Distrobox in
|
||||||
|
action in this explanatory video on his setup with Distrobox, Toolbx,
|
||||||
|
Fedora Silverblue on his project [ublue](https://github.com/castrojo/ublue)
|
||||||
|
(check it out!)
|
||||||
|
|
||||||
[](https://www.youtube.com/watch?v=Q2PrISAOtbY)
|
[](https://www.youtube.com/watch?v=Q2PrISAOtbY)
|
||||||
|
|
||||||
## Why
|
## Why
|
||||||
|
|
||||||
- Provide a mutable environment on an immutable OS, like Endless OS, Fedora Silverblue, OpenSUSE MicroOS or SteamOS3
|
- Provide a mutable environment on an immutable OS, like Endless OS,
|
||||||
- Provide a locally privileged environment for sudoless setups (eg. company-provided laptops, security reasons, etc...)
|
Fedora Silverblue, OpenSUSE MicroOS or SteamOS3
|
||||||
- To mix and match a stable base system (eg. Debian Stable, Ubuntu LTS, RedHat) with a bleeding-edge environment for development or gaming (eg. Arch, OpenSUSE Tumbleweed or Fedora with latest Mesa)
|
- Provide a locally privileged environment for sudoless setups
|
||||||
- Leverage high abundance of curated distro images for docker/podman to manage multiple environments
|
(eg. company-provided laptops, security reasons, etc...)
|
||||||
|
- To mix and match a stable base system (eg. Debian Stable, Ubuntu LTS, RedHat)
|
||||||
|
with a bleeding-edge environment for development or gaming
|
||||||
|
(eg. Arch, OpenSUSE Tumbleweed or Fedora with latest Mesa)
|
||||||
|
- Leverage high abundance of curated distro images for docker/podman to
|
||||||
|
manage multiple environments
|
||||||
|
|
||||||
Refer to the compatiblity list for an overview of supported host's distro [HERE](compatibility.md#host-distros) and container's distro [HERE](compatibility.md#containers-distros).
|
Refer to the compatiblity list for an overview of supported host's distro
|
||||||
|
[HERE](compatibility.md#host-distros) and container's distro [HERE](compatibility.md#containers-distros).
|
||||||
|
|
||||||
### Aims
|
### Aims
|
||||||
|
|
||||||
This project aims to bring **any distro userland to any other distro** supporting podman or docker.
|
This project aims to bring **any distro userland to any other distro**
|
||||||
It has been written in POSIX sh to be as portable as possible and not have problems with dependencies and glibc version's compatibility.
|
supporting podman or docker.
|
||||||
|
It has been written in POSIX sh to be as portable as possible and not have
|
||||||
|
problems with dependencies and glibc version's compatibility.
|
||||||
|
|
||||||
Refer [HERE](compatibility.md#supported-container-managers) for a list of supported container managers and minimum supported versions.
|
Refer [HERE](compatibility.md#supported-container-managers) for a list of
|
||||||
|
supported container managers and minimum supported versions.
|
||||||
|
|
||||||
It also aims to enter the container **as fast as possible**, every millisecond adds up if you use the container as your default environment for your terminal:
|
It also aims to enter the container **as fast as possible**, every millisecond
|
||||||
|
adds up if you use the container as your default environment for your terminal:
|
||||||
|
|
||||||
These are some sample results of `distrobox-enter` on the same container on my weak laptop from 2015 with 2 core cpu:
|
These are some sample results of `distrobox-enter` on the same container on my
|
||||||
|
weak laptop from 2015 with 2 core cpu:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
Total time for 100 container enters:
|
Total time for 100 container enters:
|
||||||
|
|
||||||
~$ time (for i in {1..100}; do distrobox-enter --name fedora-toolbox-35 -- whoami; done)
|
~$ time (for i in {1..100}; do distrobox-enter --name fedora-toolbox-35 -- whoami; done)
|
||||||
@@ -146,18 +169,25 @@ Mean:
|
|||||||
36.209s/100 = ~0.362ms mean time to enter the container
|
36.209s/100 = ~0.362ms mean time to enter the container
|
||||||
```
|
```
|
||||||
|
|
||||||
I would like to keep it always below the [Doherty Treshold](https://lawsofux.com/doherty-threshold/) of 400ms.
|
I would like to keep it always below the
|
||||||
|
[Doherty Treshold](https://lawsofux.com/doherty-threshold/) of 400ms.
|
||||||
|
|
||||||
#### Security implications
|
#### Security implications
|
||||||
|
|
||||||
Isolation and sandboxing is **not** the main aim of the project, on the conrary it aims to thightly integrate the container with the host.
|
Isolation and sandboxing is **not** the main aim of the project, on the conrary
|
||||||
The container will have complete access to your home, pen drives and so on, so do not expect it to be highly sandboxed like a plain
|
it aims to thightly integrate the container with the host.
|
||||||
|
The container will have complete access to your home, pen drives and so on,
|
||||||
|
so do not expect it to be highly sandboxed like a plain
|
||||||
docker/podman container or a flatpak.
|
docker/podman container or a flatpak.
|
||||||
|
|
||||||
⚠️ **BE CAREFUL**: if you use docker, the daemon runs as root by default, so **root inside the docker container can modify system stuff outside the container**, if you have security concern for this, **use podman that runs in rootless mode**.
|
⚠️ **BE CAREFUL**: if you use docker, the daemon runs as root by default, so
|
||||||
Rootless docker is still not working as intended and will be included in the future when it will be complete.
|
**root inside the docker container can modify system stuff outside the container**,
|
||||||
|
if you have security concern for this, **use podman that runs in rootless mode**.
|
||||||
|
Rootless docker is still not working as intended and will be included in the future
|
||||||
|
when it will be complete.
|
||||||
|
|
||||||
That said, it is in the works to implement some sort of decoupling with the host, as discussed here: [#28 Sandboxed mode](https://github.com/89luca89/distrobox/issues/28)
|
That said, it is in the works to implement some sort of decoupling with the host,
|
||||||
|
as discussed here: [#28 Sandboxed mode](https://github.com/89luca89/distrobox/issues/28)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -187,7 +217,8 @@ Remove a distrobox
|
|||||||
|
|
||||||
`distrobox rm test`
|
`distrobox rm test`
|
||||||
|
|
||||||
You can check [HERE for more advanced usage](usage/usage.md) and check a [comprehensive list of useful tips HERE](useful_tips.md)
|
You can check [HERE for more advanced usage](usage/usage.md)
|
||||||
|
and check a [comprehensive list of useful tips HERE](useful_tips.md)
|
||||||
|
|
||||||
# Configure Distrobox
|
# Configure Distrobox
|
||||||
|
|
||||||
@@ -220,56 +251,72 @@ Alternatively it is possible to specify preferences using ENV variables:
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
Distrobox is packaged in the following distributions, if your distribution is on this list, you can refer to your repos for installation:
|
Distrobox is packaged in the following distributions, if your distribution is
|
||||||
|
on this list, you can refer to your repos for installation:
|
||||||
|
|
||||||
[](https://repology.org/project/distrobox/versions)
|
[](https://repology.org/project/distrobox/versions)
|
||||||
|
|
||||||
Thanks to the maintainers for their work: [M0Rf30](https://github.com/M0Rf30), [alcir](https://github.com/alcir), [dfaggioli](https://github.com/dfaggioli), [AtilaSaraiva](https://github.com/AtilaSaraiva)
|
Thanks to the maintainers for their work: [M0Rf30](https://github.com/M0Rf30),
|
||||||
|
[alcir](https://github.com/alcir), [dfaggioli](https://github.com/dfaggioli),
|
||||||
|
[AtilaSaraiva](https://github.com/AtilaSaraiva)
|
||||||
|
|
||||||
Else, if you like to live your life dangerously, or you want the latest release, you can trust me and simply run this in your terminal:
|
Else, if you like to live your life dangerously, or you want the latest release,
|
||||||
|
you can trust me and simply run this in your terminal:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
|
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you want to select a custom directory to install without sudo:
|
or if you want to select a custom directory to install without sudo:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
|
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively you can clone the project using `git clone` or using the latest release [HERE](https://github.com/89luca89/distrobox/releases/latest).
|
Alternatively you can clone the project using `git clone` or using the latest
|
||||||
|
release [HERE](https://github.com/89luca89/distrobox/releases/latest).
|
||||||
|
|
||||||
Enter the directory and run `./install`, by default it will attempt to install in `~/.local` but if you run the script as root, it will default to `/usr/local`. You can specify a custom directory with the `--prefix` flag such as `./install --prefix ~/.distrobox`.
|
Enter the directory and run `./install`, by default it will attempt to install
|
||||||
|
in `~/.local` but if you run the script as root, it will default to `/usr/local`.
|
||||||
|
You can specify a custom directory with the `--prefix` flag
|
||||||
|
such as `./install --prefix ~/.distrobox`.
|
||||||
|
|
||||||
Prefix explained: main distrobox files get installed to `${prefix}/bin` whereas the manpages get installed to `${prefix}/share/man`.
|
Prefix explained: main distrobox files get installed to `${prefix}/bin` whereas
|
||||||
|
the manpages get installed to `${prefix}/share/man`.
|
||||||
|
|
||||||
Check the [Host Distros](compatibility.md#host-distros) compatibility list for distro-specific instructions.
|
Check the [Host Distros](compatibility.md#host-distros) compatibility list for
|
||||||
|
distro-specific instructions.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Distrobox depends on a container manager to work, you can choose to install either podman or docker.
|
Distrobox depends on a container manager to work, you can choose to install
|
||||||
Please look in the [Compatibility Table](compatibility.md#host-distros) for your distribution notes.
|
either podman or docker.
|
||||||
|
Please look in the [Compatibility Table](compatibility.md#host-distros) for your
|
||||||
|
distribution notes.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Uninstallation
|
## Uninstallation
|
||||||
|
|
||||||
If you installed distrobox using the `install` script in the default install directory use this:
|
If you installed distrobox using the `install` script in the default install
|
||||||
|
directory use this:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sudo sh
|
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sudo sh
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you specified a custom path:
|
or if you specified a custom path:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sh -s -- --prefix ~/.local
|
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sh -s -- --prefix ~/.local
|
||||||
```
|
```
|
||||||
|
|
||||||
Else if cloned the project using `git clone` or using the latest archive release from [HERE](https://github.com/89luca89/distrobox/releases/latest),
|
Else if cloned the project using `git clone` or using the latest archive release
|
||||||
|
from [HERE](https://github.com/89luca89/distrobox/releases/latest),
|
||||||
|
|
||||||
enter the directory and run `./uninstall`, by default it will assume the install directory was `/usr/local` if ran as root or `~/.local`, you can specify another directory if needed with `./uninstall --prefix ~/.local`
|
enter the directory and run `./uninstall`, by default it will assume the install
|
||||||
|
directory was `/usr/local` if ran as root or `~/.local`,
|
||||||
|
you can specify another directory if needed with `./uninstall --prefix ~/.local`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+35
-21
@@ -10,14 +10,17 @@
|
|||||||
|
|
||||||
# Compatibility
|
# Compatibility
|
||||||
|
|
||||||
This project **does not need a dedicated image**. It can use any OCI images from docker-hub, quay.io, or any registry of your choice.
|
This project **does not need a dedicated image**. It can use any OCI images from
|
||||||
|
docker-hub, quay.io, or any registry of your choice.
|
||||||
|
|
||||||
Granted, they may not be as featureful as expected (some of them do not even have `which`, `mount`, `less` or `vi`)
|
Granted, they may not be as featureful as expected (some of them do not even have
|
||||||
but that's all doable in the container itself after bootstrapping it.
|
`which`, `mount`, `less` or `vi`) but that's all doable in the container itself
|
||||||
|
after bootstrapping it.
|
||||||
|
|
||||||
The main concern is having basic Linux utilities (`mount`), basic user management utilities (`usermod, passwd`), and `sudo` correctly set.
|
The main concern is having basic Linux utilities (`mount`), basic user management
|
||||||
|
utilities (`usermod, passwd`), and `sudo` correctly set.
|
||||||
|
|
||||||
### Supported container managers
|
## Supported container managers
|
||||||
|
|
||||||
`distrobox` can run on either `podman` or `docker`
|
`distrobox` can run on either `podman` or `docker`
|
||||||
|
|
||||||
@@ -33,10 +36,12 @@ Follow the official installation guide here:
|
|||||||
- <https://docs.docker.com/engine/install>
|
- <https://docs.docker.com/engine/install>
|
||||||
- <https://docs.docker.com/engine/install/linux-postinstall/>
|
- <https://docs.docker.com/engine/install/linux-postinstall/>
|
||||||
|
|
||||||
### Host Distros
|
## Host Distros
|
||||||
|
|
||||||
Distrobox has been successfully tested on:
|
Distrobox has been successfully tested on:
|
||||||
|
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
| Distro | Version | Notes |
|
| Distro | Version | Notes |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Alpine Linux | 3.14.3 | To setup rootless podman, look [HERE](https://wiki.alpinelinux.org/wiki/Podman) |
|
| Alpine Linux | 3.14.3 | To setup rootless podman, look [HERE](https://wiki.alpinelinux.org/wiki/Podman) |
|
||||||
@@ -56,29 +61,33 @@ Distrobox has been successfully tested on:
|
|||||||
| Void Linux | glibc | Systemd service export will not work. |
|
| Void Linux | glibc | Systemd service export will not work. |
|
||||||
| NixOS | 21.11 | Currently you must have your default shell set to Bash, if it is not, make sure you edit your configuration.nix so that it is. <br>Also make sure to mind your executable paths. Sometimes a container will not have nix paths, and sometimes it will not have its own paths. <br> Distrobox is available in Nixpkg collection (thanks [AtilaSaraiva](https://github.com/AtilaSaraiva)!)<<br>To setup Docker, look [HERE](https://nixos.wiki/wiki/Docker) <br>To setup Podman, look [HERE](https://nixos.wiki/wiki/Podman) and [HERE](https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947) |
|
| NixOS | 21.11 | Currently you must have your default shell set to Bash, if it is not, make sure you edit your configuration.nix so that it is. <br>Also make sure to mind your executable paths. Sometimes a container will not have nix paths, and sometimes it will not have its own paths. <br> Distrobox is available in Nixpkg collection (thanks [AtilaSaraiva](https://github.com/AtilaSaraiva)!)<<br>To setup Docker, look [HERE](https://nixos.wiki/wiki/Docker) <br>To setup Podman, look [HERE](https://nixos.wiki/wiki/Podman) and [HERE](https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947) |
|
||||||
| Windows WSL2 | | __NOTE WSL2 support is preliminary, and there are many bugs present, any help in improving support is appreciated__ <br> Currently you must work around some incompatibility between WSL2 and Podman, namely [THIS](https://github.com/containers/podman/issues/12236). <br>Install into WSL2 any of the supported distributions in this list. <br> Ensure you have an entry in the `fstab` for the `/tmp` folder:<br> `echo 'tmpfs /tmp tmps defaults 0 0' >> /etc/fstab`.<br>Then reboot the WSL machine `wsl --shutdown` <br>Note that `distrobox export` is not supported on WSL2 and will not work. |
|
| Windows WSL2 | | __NOTE WSL2 support is preliminary, and there are many bugs present, any help in improving support is appreciated__ <br> Currently you must work around some incompatibility between WSL2 and Podman, namely [THIS](https://github.com/containers/podman/issues/12236). <br>Install into WSL2 any of the supported distributions in this list. <br> Ensure you have an entry in the `fstab` for the `/tmp` folder:<br> `echo 'tmpfs /tmp tmps defaults 0 0' >> /etc/fstab`.<br>Then reboot the WSL machine `wsl --shutdown` <br>Note that `distrobox export` is not supported on WSL2 and will not work. |
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
|
||||||
If your container is not able to connect to your host xserver, make sure to install `xhost` on the host machine
|
If your container is not able to connect to your host xserver, make sure to
|
||||||
and run `xhost +si:localuser:$USER`. If you wish to enable this functionality on future reboots add it to your `~/.xinitrc`
|
install `xhost` on the host machine and run `xhost +si:localuser:$USER`.
|
||||||
|
If you wish to enable this functionality on future reboots add it to your `~/.xinitrc`
|
||||||
or somewhere else tailored to your use case where it would be ran on every startup.
|
or somewhere else tailored to your use case where it would be ran on every startup.
|
||||||
|
|
||||||
List of distributions including distrobox in their repositories:
|
List of distributions including distrobox in their repositories:
|
||||||
|
|
||||||
[](https://repology.org/project/distrobox/versions)
|
[](https://repology.org/project/distrobox/versions)
|
||||||
|
|
||||||
#### New Host Distro support
|
### New Host Distro support
|
||||||
|
|
||||||
If your distro of choice is not on the list, open an issue requesting support for it,
|
If your distro of choice is not on the list, open an issue requesting support
|
||||||
we can work together to check if it is possible to add support for it.
|
for it, we can work together to check if it is possible to add support for it.
|
||||||
|
|
||||||
Or just try using it anyway, if it works, open an issue
|
Or just try using it anyway, if it works, open an issue
|
||||||
and it will be added to the list!
|
and it will be added to the list!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Containers Distros
|
## Containers Distros
|
||||||
|
|
||||||
Distrobox guests tested successfully with the following container images:
|
Distrobox guests tested successfully with the following container images:
|
||||||
|
|
||||||
|
<!-- markdownlint-capture -->
|
||||||
|
<!-- markdownlint-disable -->
|
||||||
| Distro | Version | Images |
|
| Distro | Version | Images |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| AlmaLinux | 8 | docker.io/library/almalinux:8 |
|
| AlmaLinux | 8 | docker.io/library/almalinux:8 |
|
||||||
@@ -91,7 +100,7 @@ Distrobox guests tested successfully with the following container images:
|
|||||||
| CentOS | 7 | quay.io/centos/centos:7 |
|
| CentOS | 7 | quay.io/centos/centos:7 |
|
||||||
| CentOS Stream | 8<br>9 | quay.io/centos/centos:stream8<br>quay.io/centos/centos:stream9 |
|
| CentOS Stream | 8<br>9 | quay.io/centos/centos:stream8<br>quay.io/centos/centos:stream9 |
|
||||||
| RedHat (UBI) | 7<br>8 | registry.access.redhat.com/ubi7/ubi<br>registry.access.redhat.com/ubi7/ubi-init<br>registry.access.redhat.com/ubi8/ubi<br>registry.access.redhat.com/ubi8/ubi-init |
|
| RedHat (UBI) | 7<br>8 | registry.access.redhat.com/ubi7/ubi<br>registry.access.redhat.com/ubi7/ubi-init<br>registry.access.redhat.com/ubi8/ubi<br>registry.access.redhat.com/ubi8/ubi-init |
|
||||||
| Debian | 8<br>9<br>10<br>11 | 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/library/debian:8<br>docker.io/library/debian:9<br>docker.io/library/debian:10<br>docker.io/library/debian:stable<br>docker.io/library/debian:stable-backports |
|
||||||
| Debian | Testing | docker.io/library/debian:testing <br> docker.io/library/debian:testing-backports |
|
| Debian | Testing | docker.io/library/debian:testing <br> docker.io/library/debian:testing-backports |
|
||||||
| Debian | Unstable | docker.io/library/debian:unstable |
|
| Debian | Unstable | docker.io/library/debian:unstable |
|
||||||
| Neurodebian | nd100 | docker.io/library/neurodebian:nd100 |
|
| Neurodebian | nd100 | docker.io/library/neurodebian:nd100 |
|
||||||
@@ -107,27 +116,32 @@ Distrobox guests tested successfully with the following container images:
|
|||||||
| Kali Linux | rolling | docker.io/kalilinux/kali-rolling:latest |
|
| Kali Linux | rolling | docker.io/kalilinux/kali-rolling:latest |
|
||||||
| Void Linux | | ghcr.io/void-linux/void-linux:latest-full-x86_64 <br> ghcr.io/void-linux/void-linux:latest-full-x86_64-musl |
|
| Void Linux | | ghcr.io/void-linux/void-linux:latest-full-x86_64 <br> ghcr.io/void-linux/void-linux:latest-full-x86_64-musl |
|
||||||
| Gentoo Linux | rolling | You will have to [Build your own](distrobox_gentoo.md) to have a complete Gentoo docker image |
|
| Gentoo Linux | rolling | You will have to [Build your own](distrobox_gentoo.md) to have a complete Gentoo docker image |
|
||||||
|
<!-- markdownlint-restore -->
|
||||||
|
|
||||||
Note however that if you use a non-toolbox preconfigured image (e.g. images pre-baked to work with <https://github.com/containers/toolbox),> the **first** `distrobox-enter` you'll perform
|
Note however that if you use a non-toolbox preconfigured image (e.g.
|
||||||
|
images pre-baked to work with <https://github.com/containers/toolbox),>
|
||||||
|
the **first** `distrobox-enter` you'll perform
|
||||||
can take a while as it will download and install the missing dependencies.
|
can take a while as it will download and install the missing dependencies.
|
||||||
|
|
||||||
A small time tax to pay for the ability to use any type of image.
|
A small time tax to pay for the ability to use any type of image.
|
||||||
This will **not** occur after the first time, **subsequent enters will be much faster.**
|
This will **not** occur after the first time, **subsequent enters will be much faster.**
|
||||||
|
|
||||||
NixOS is not a supported container distro, and there are currently no plans to bring support to it. If you are looking for unprivlaged NixOS environments, we suggest you look into [nix-shell](https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html).
|
NixOS is not a supported container distro, and there are currently no plans to
|
||||||
|
bring support to it. If you are looking for unprivlaged NixOS environments,
|
||||||
|
we suggest you look into [nix-shell](https://nixos.org/manual/nix/unstable/command-ref/nix-shell.html).
|
||||||
|
|
||||||
#### New Distro support
|
### New Distro support
|
||||||
|
|
||||||
If your distro of choice is not on the list, open an issue requesting support for it,
|
If your distro of choice is not on the list, open an issue requesting support
|
||||||
we can work together to check if it is possible to add support for it.
|
for it, we can work together to check if it is possible to add support for it.
|
||||||
|
|
||||||
Or just try using it anyway, if it works, open an issue
|
Or just try using it anyway, if it works, open an issue
|
||||||
and it will be added to the list!
|
and it will be added to the list!
|
||||||
|
|
||||||
#### Older distributions
|
### Older distributions
|
||||||
|
|
||||||
For older distributions like CentOS 6, Debian 7, Ubuntu 12.04, compatibility is not
|
For older distributions like CentOS 5, CentOS 6, Debian 6, Ubuntu 12.04,
|
||||||
assured.
|
compatibility is not assured.
|
||||||
|
|
||||||
Their `libc` version is incompatible with kernel releases after `>=4.11`.
|
Their `libc` version is incompatible with kernel releases after `>=4.11`.
|
||||||
A work around this is to use the `vsyscall=emulate` flag in the bootloader of the
|
A work around this is to use the `vsyscall=emulate` flag in the bootloader of the
|
||||||
|
|||||||
@@ -5,14 +5,17 @@
|
|||||||
|
|
||||||
# Create a dedicated distrobox container
|
# Create a dedicated distrobox container
|
||||||
|
|
||||||
Distrobox wants to be as generic as possible in supporting OCI images, but sometimes there could be some problems:
|
Distrobox wants to be as generic as possible in supporting OCI images,
|
||||||
|
but sometimes there could be some problems:
|
||||||
|
|
||||||
- The image you want to use is too old and the package manager mirrors are down
|
- The image you want to use is too old and the package manager mirrors are down
|
||||||
- The image you want to use has not a supported package manager or no package manager at all
|
- The image you want to use has not a supported package manager or no package
|
||||||
|
manager at all
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
The only required programs that must be available in the container so that `distrobox-init` won't start the installation are:
|
The only required programs that must be available in the container so that
|
||||||
|
`distrobox-init` won't start the installation are:
|
||||||
|
|
||||||
- the $SHELL you use (bash, zsh, fish etc etc)
|
- the $SHELL you use (bash, zsh, fish etc etc)
|
||||||
- findutils
|
- findutils
|
||||||
@@ -23,7 +26,8 @@ The only required programs that must be available in the container so that `dist
|
|||||||
- libvte
|
- libvte
|
||||||
- util-linux (that provides the mount command)
|
- util-linux (that provides the mount command)
|
||||||
|
|
||||||
If all those dependencies are met, then the `distrobox-init` will simply skip the installation process and work as expected.
|
If all those dependencies are met, then the `distrobox-init`
|
||||||
|
will simply skip the installation process and work as expected.
|
||||||
|
|
||||||
To test if all packages requirements are met just run this in the container:
|
To test if all packages requirements are met just run this in the container:
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
|
|
||||||
# Gentoo as a distrobox container
|
# Gentoo as a distrobox container
|
||||||
|
|
||||||
### Image
|
## Image
|
||||||
|
|
||||||
You need to build your own image. The official resource is [here](https://github.com/gentoo/gentoo-docker-images#using-the-portage-container-in-a-multi-stage-build) but here is a simple Dockerfile:
|
You need to build your own image. The official resource is [here](https://github.com/gentoo/gentoo-docker-images#using-the-portage-container-in-a-multi-stage-build)
|
||||||
|
but here is a simple Dockerfile:
|
||||||
|
|
||||||
``` Dockerfile
|
``` Dockerfile
|
||||||
FROM registry.hub.docker.com/gentoo/portage:latest
|
FROM registry.hub.docker.com/gentoo/portage:latest
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- [Distrobox](README.md)
|
- [Distrobox](README.md)
|
||||||
* [Featured articles](#featured-articles)
|
- [Featured articles](#featured-articles)
|
||||||
* [Podcasts](#podcasts)
|
- [Podcasts](#podcasts)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -12,7 +12,9 @@
|
|||||||
- [Using Distrobox To Augment The Package Selection On Clear Linux - Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Distrobox-Clear-Linux)
|
- [Using Distrobox To Augment The Package Selection On Clear Linux - Phoronix](https://www.phoronix.com/scan.php?page=news_item&px=Distrobox-Clear-Linux)
|
||||||
- [Benchmark: benefits of Clear Linux containers (distrobox) - Phoronix](https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1305326-clear-linux-container-performance-continues-showing-sizable-gains)
|
- [Benchmark: benefits of Clear Linux containers (distrobox) - Phoronix](https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1305326-clear-linux-container-performance-continues-showing-sizable-gains)
|
||||||
- [Distrobox - A great item in the Linux toolbelt - phmurphy's blog](https://phmurphy.com/posts/distrobox-toolbelt/)
|
- [Distrobox - A great item in the Linux toolbelt - phmurphy's blog](https://phmurphy.com/posts/distrobox-toolbelt/)
|
||||||
- Running Other Linux Distros with Distrobox on Fedora Linux - bandithijo's blog: [ORIGINAL](https://bandithijo.github.io/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux) or [TRANSLATED](https://bandithijo-github-io.translate.goog/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux?_x_tr_sl=id&_x_tr_tl=en&_x_tr_hl=it&_x_tr_pto=wapp)
|
- Running Other Linux Distros with Distrobox on Fedora Linux - bandithijo's blog:
|
||||||
|
[ORIGINAL](https://bandithijo.github.io/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux)
|
||||||
|
or [TRANSLATED](https://bandithijo-github-io.translate.goog/blog/menjalankan-distro-linux-lain-dengan-distrobox-di-fedora-linux?_x_tr_sl=id&_x_tr_tl=en&_x_tr_hl=it&_x_tr_pto=wapp)
|
||||||
- [Day-to-day differences between Fedora Silverblue and Ubuntu - castrojo's blog](https://www.ypsidanger.com/day-to-day-advantages-of-fedora-silverblue/)
|
- [Day-to-day differences between Fedora Silverblue and Ubuntu - castrojo's blog](https://www.ypsidanger.com/day-to-day-advantages-of-fedora-silverblue/)
|
||||||
|
|
||||||
## Podcasts
|
## Podcasts
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
- [Distrobox](../README.md)
|
- [Distrobox](../README.md)
|
||||||
* [Execute a command on the Host](execute_commands_on_host.md)
|
- [Execute a command on the Host](execute_commands_on_host.md)
|
||||||
* [The easy one](#the-easy-one)
|
- [The easy one](#the-easy-one)
|
||||||
* [The not so easy one](#the-not-so-easy-one)
|
- [The not so easy one](#the-not-so-easy-one)
|
||||||
* [Integrate host with container seamlessly](#integrate-host-with-container-seamlessly)
|
- [Integrate host with container seamlessly](#integrate-host-with-container-seamlessly)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
- [Distrobox](../README.md)
|
- [Distrobox](../README.md)
|
||||||
* [Integrate VSCode and Distrobox](integrate_vscode_distrobox.md)
|
- [Integrate VSCode and Distrobox](integrate_vscode_distrobox.md)
|
||||||
* [The easy one](#the-easy-one)
|
- [The easy one](#the-easy-one)
|
||||||
* [The not so easy one](#the-not-so-easy-one)
|
- [The not so easy one](#the-not-so-easy-one)
|
||||||
- [First step, install it](#first-step--install-it)
|
- [First step, install it](#first-step--install-it)
|
||||||
- [Second step, extensions](#second-step--extensions)
|
- [Second step, extensions](#second-step--extensions)
|
||||||
- [Third step, podman wrapper](#third-step--podman-wrapper)
|
- [Third step, podman wrapper](#third-step--podman-wrapper)
|
||||||
- [Fourth step, configure the container](#fourth-step--configure-the-container)
|
- [Fourth step, configure the container](#fourth-step--configure-the-container)
|
||||||
* [Final Result](#final-result)
|
- [Final Result](#final-result)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -32,7 +32,8 @@ For example using an Arch Linux container:
|
|||||||
user@arch-distrobox:~$
|
user@arch-distrobox:~$
|
||||||
```
|
```
|
||||||
|
|
||||||
Download the deb file [HERE](https://github.com/VSCodium/vscodium/releases), or in Arch case just install
|
Download the deb file
|
||||||
|
[HERE](https://github.com/VSCodium/vscodium/releases), or in Arch case just install
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
user@arch-distrobox:~$ sudo pacman -S code
|
user@arch-distrobox:~$ sudo pacman -S code
|
||||||
@@ -73,8 +74,8 @@ Now we want to install VSCode [Remote Container extension](https://marketplace.v
|
|||||||
|
|
||||||
### Third step, podman wrapper
|
### Third step, podman wrapper
|
||||||
|
|
||||||
Being in a Flatpak, we will need access to host's `podman` (or `docker`) to be able to use the containers.
|
Being in a Flatpak, we will need access to host's `podman` (or `docker`) to be
|
||||||
Place this in your `~/.local/bin/podman-host`
|
able to use the containers. Place this in your `~/.local/bin/podman-host`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
@@ -84,7 +85,9 @@ if [ "$1" == "exec" ]; then
|
|||||||
shift
|
shift
|
||||||
script='
|
script='
|
||||||
result_command="podman exec"
|
result_command="podman exec"
|
||||||
for i in $(printenv | grep "=" | grep -Ev " |\"" | grep -Ev "^(HOST|HOSTNAME|HOME|PATH|SHELL|USER|_)"); do
|
for i in $(printenv | grep "=" | grep -Ev " |\"" |
|
||||||
|
grep -Ev "^(HOST|HOSTNAME|HOME|PATH|SHELL|USER|_)"); do
|
||||||
|
|
||||||
result_command=$result_command --env="$i"
|
result_command=$result_command --env="$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -101,7 +104,8 @@ set it to the path of `podman-exec`, like in the example
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
This will give a way to execute host's container manager from within the flatpak app.
|
This will give a way to execute host's container manager from within the
|
||||||
|
flatpak app.
|
||||||
|
|
||||||
### Fourth step, configure the container
|
### Fourth step, configure the container
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
- [Distrobox](../README.md)
|
- [Distrobox](../README.md)
|
||||||
* [Run latest GNOME and KDE using distrobox](run_latest_gnome_kde_on_distrobox.md)
|
- [Run latest GNOME and KDE using distrobox](run_latest_gnome_kde_on_distrobox.md)
|
||||||
- [Using a stable-release distribution](#using-a-stable-release-distribution)
|
- [Using a stable-release distribution](#using-a-stable-release-distribution)
|
||||||
* [Initializing the distrobox](#initializing-the-distrobox)
|
- [Initializing the distrobox](#initializing-the-distrobox)
|
||||||
* [Running Latest GNOME](#running-latest-gnome)
|
- [Running Latest GNOME](#running-latest-gnome)
|
||||||
- [Generate session file](#generate-session-file)
|
- [Generate session file - GNOME](#generate-session-file-gnome)
|
||||||
* [Running Latest KDE](#running-latest-kde)
|
- [Running Latest KDE](#running-latest-kde)
|
||||||
- [Generate session file](#generate-session-file-1)
|
- [Generate session file - KDE](#generate-session-file-kde)
|
||||||
- [Add a couple of fixes](#add-a-couple-of-fixes)
|
- [Add a couple of fixes](#add-a-couple-of-fixes)
|
||||||
- [Using apps from host](#using-apps-from-host)
|
- [Using apps from host](#using-apps-from-host)
|
||||||
|
|
||||||
@@ -13,15 +13,17 @@
|
|||||||
|
|
||||||
# Using a stable-release distribution
|
# Using a stable-release distribution
|
||||||
|
|
||||||
Lots of people prefer to run a distribution following a stable-LTS release cycle like Debian, UbuntuLTS or
|
Lots of people prefer to run a distribution following a stable-LTS release cycle
|
||||||
CentOS family (Almalinux, Rocky Linux). This ensures great stability on one hand, but package staling on the other.
|
like Debian, UbuntuLTS or CentOS family (Almalinux, Rocky Linux).
|
||||||
|
This ensures great stability on one hand, but package staling on the other.
|
||||||
|
|
||||||
One way to counter this effect is to use a pet-container managed by Distrobox to run packages from much newer distributions
|
One way to counter this effect is to use a pet-container managed by Distrobox
|
||||||
without giving up on core base os stability.
|
to run packages from much newer distributions without giving up on core base os stability.
|
||||||
|
|
||||||
## Initializing the distrobox
|
## Initializing the distrobox
|
||||||
|
|
||||||
For this experiment we'll use Fedora Rawhide as our distrobox, and Centos 8 Stream as our host, so:
|
For this experiment we'll use Fedora Rawhide as our distrobox, and Centos 8 Stream
|
||||||
|
as our host, so:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
distrobox create --name fedora-rawhide --image registry.fedoraproject.org/fedora:rawhide
|
distrobox create --name fedora-rawhide --image registry.fedoraproject.org/fedora:rawhide
|
||||||
@@ -35,8 +37,8 @@ distrobox enter fedora-rawhide
|
|||||||
|
|
||||||
## Running Latest GNOME
|
## Running Latest GNOME
|
||||||
|
|
||||||
First we need to change a couple of bits in the distrobox container to make host's systemd session
|
First we need to change a couple of bits in the distrobox container to make host's
|
||||||
accessible from within the host:
|
systemd session accessible from within the host:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
~$ distrobox enter fedora-rawhide
|
~$ distrobox enter fedora-rawhide
|
||||||
@@ -52,14 +54,15 @@ user@fedora-rawhide:~$ sudo dnf groupinstall GNOME
|
|||||||
|
|
||||||
And let's grab a coffee while it finishes :-)
|
And let's grab a coffee while it finishes :-)
|
||||||
|
|
||||||
After the `dnf` process finishes, we have GNOME installed in our container, now how do we
|
After the `dnf` process finishes, we have GNOME installed in our container,
|
||||||
use it?
|
now how do we use it?
|
||||||
|
|
||||||
### Generate session file
|
### Generate session file - GNOME
|
||||||
|
|
||||||
First in the host we need a reliable way to fix the permissions problem of the `/tmp/.X11-unix` directory.
|
First in the host we need a reliable way to fix the permissions problem of the
|
||||||
This directory should either belong to `root` or `$USER`. But in a rootless container, host's `root` is not
|
`/tmp/.X11-unix` directory. This directory should either belong to `root` or
|
||||||
mapped inside the container so we need to change the ownership from `root` to `$USER` each time.
|
`$USER`. But in a rootless container, host's `root` is not mapped inside the
|
||||||
|
container so we need to change the ownership from `root` to `$USER` each time.
|
||||||
|
|
||||||
Let's add:
|
Let's add:
|
||||||
|
|
||||||
@@ -69,11 +72,11 @@ chown -R $USER:$USER /tmp/.X11-unix
|
|||||||
|
|
||||||
to `/etc/profile.d/fix_tmp.sh` file.
|
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
|
This is needed for the XWayland session to work properly which right now is
|
||||||
even on wayland.
|
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, so that it appears
|
Then we need to add a desktop file for the session on the host's file system,
|
||||||
on your login manager (Be it SSDM or GDM)
|
so that it appears on your login manager (Be it SSDM or GDM)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
@@ -98,7 +101,8 @@ Centos.
|
|||||||
|
|
||||||
## Running Latest KDE
|
## Running Latest KDE
|
||||||
|
|
||||||
We can do the same with KDE also, let's first set up the host's systemd session sharing with the container:
|
We can do the same with KDE also, let's first set up the host's systemd session
|
||||||
|
sharing with the container:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
~$ distrobox enter fedora-rawhide
|
~$ distrobox enter fedora-rawhide
|
||||||
@@ -112,10 +116,10 @@ Then we can proceed to install KDE in the container:
|
|||||||
user@fedora-rawhide:~$ sudo dnf groupinstall KDE
|
user@fedora-rawhide:~$ sudo dnf groupinstall KDE
|
||||||
```
|
```
|
||||||
|
|
||||||
### Generate session file
|
### Generate session file - KDE
|
||||||
|
|
||||||
We need to add a desktop file for the session on the host's file system, so that it appears
|
We need to add a desktop file for the session on the host's file system,
|
||||||
on your login manager (Be it SSDM or GDM)
|
so that it appears on your login manager (Be it SSDM or GDM)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
@@ -131,9 +135,10 @@ This file should be placed under `/usr/share/wayland-sessions/distrobox-plasma.d
|
|||||||
|
|
||||||
To make KDE work we need a couple more fixes to run both on the host and in the container.
|
To make KDE work we need a couple more fixes to run both on the host and in the container.
|
||||||
|
|
||||||
First in the host we need a reliable way to fix the permissions problem of the `/tmp/.X11-unix` directory.
|
First in the host we need a reliable way to fix the permissions problem of the
|
||||||
This directory should either belong to `root` or `$USER`. But in a rootless container, host's `root` is not
|
`/tmp/.X11-unix` directory. This directory should either belong to `root` or
|
||||||
mapped inside the container so we need to change the ownership from `root` to `$USER` each time.
|
`$USER`. But in a rootless container, host's `root` is not mapped inside the
|
||||||
|
container so we need to change the ownership from `root` to `$USER` each time.
|
||||||
|
|
||||||
Let's add:
|
Let's add:
|
||||||
|
|
||||||
@@ -143,8 +148,9 @@ chown -R $USER:$USER /tmp/.X11-unix
|
|||||||
|
|
||||||
to `/etc/profile.d/fix_tmp.sh` file.
|
to `/etc/profile.d/fix_tmp.sh` file.
|
||||||
|
|
||||||
We also need to add a process in autostart on which Plasma shell relies on a process called `kactivitymanagerd`.
|
We also need to add a process in autostart on which Plasma shell relies on a
|
||||||
Not having host's systemd at disposal we can start it simply adding it to the ~/.profile file, add:
|
process called `kactivitymanagerd`. Not having host's systemd at disposal we
|
||||||
|
can start it simply adding it to the ~/.profile file, add:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
if [ -f /usr/libexec/kactivitymanagerd ]; then
|
if [ -f /usr/libexec/kactivitymanagerd ]; then
|
||||||
@@ -164,6 +170,6 @@ Centos.
|
|||||||
|
|
||||||
# Using apps from host
|
# Using apps from host
|
||||||
|
|
||||||
Now that we're in a container session, we may want to still use some of the host's apps.
|
Now that we're in a container session, we may want to still use some of the host's
|
||||||
Refer to [THIS](execute_commands_on_host.md) to create handlers and wrappers to use
|
apps. Refer to [THIS](execute_commands_on_host.md) to create handlers and wrappers
|
||||||
the complete selection of host's apps and binaries inside the container.
|
to use the complete selection of host's apps and binaries inside the container.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Create the distrobox
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Create the distrobox
|
||||||
|
|
||||||
distrobox-create takes care of creating the container with input name and image.
|
distrobox-create takes care of creating the container with input name and image.
|
||||||
The created container will be tightly integrated with the host, allowing sharing of
|
The created container will be tightly integrated with the host, allowing sharing of
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Enter the distrobox
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Enter the distrobox
|
||||||
|
|
||||||
distrobox-enter takes care of entering the container with the name specified.
|
distrobox-enter takes care of entering the container with the name specified.
|
||||||
Default command executed is your SHELL, but you can specify different shells or
|
Default command executed is your SHELL, but you can specify different shells or
|
||||||
@@ -31,7 +32,6 @@ Options:
|
|||||||
|
|
||||||
This is used to enter the distrobox itself. Personally, I just create multiple profiles in my `gnome-terminal` to have multiple distros accessible.
|
This is used to enter the distrobox itself. Personally, I just create multiple profiles in my `gnome-terminal` to have multiple distros accessible.
|
||||||
|
|
||||||
|
|
||||||
The `--additional-flags` or `-a` is useful to modify default command when executing in the container.
|
The `--additional-flags` or `-a` is useful to modify default command when executing in the container.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Application and service exporting
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Application and service exporting
|
||||||
|
|
||||||
distrobox-export takes care of exporting an app a binary or a service from the container
|
distrobox-export takes care of exporting an app a binary or a service from the container
|
||||||
to the host.
|
to the host.
|
||||||
@@ -46,7 +47,6 @@ Usage:
|
|||||||
distrobox-export --service syncthing [--extra-flags "flags"] [--delete] [--sudo]
|
distrobox-export --service syncthing [--extra-flags "flags"] [--delete] [--sudo]
|
||||||
distrobox-export --bin /path/to/bin --export-path ~/.local/bin [--extra-flags "flags"] [--delete] [--sudo]
|
distrobox-export --bin /path/to/bin --export-path ~/.local/bin [--extra-flags "flags"] [--delete] [--sudo]
|
||||||
|
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
--app/-a: name of the application to export
|
--app/-a: name of the application to export
|
||||||
@@ -70,7 +70,7 @@ App export example:
|
|||||||
distrobox-export --app abiword
|
distrobox-export --app abiword
|
||||||
|
|
||||||
This tool will simply copy the original `.desktop` files along with needed icons,
|
This tool will simply copy the original `.desktop` files along with needed icons,
|
||||||
add the prefix `/usr/local/bin/distrobox-enter -n distrobox_name -e ... ` to the commands to run, and
|
add the prefix `/usr/local/bin/distrobox-enter -n distrobox_name -e ...` to the commands to run, and
|
||||||
save them in your home to be used directly from the host as a normal app.
|
save them in your home to be used directly from the host as a normal app.
|
||||||
|
|
||||||
Service export example:
|
Service export example:
|
||||||
@@ -83,7 +83,6 @@ prefixing the various `ExecStart ExecStartPre ExecStartPost ExecReload ExecStop
|
|||||||
|
|
||||||
Binary export example:
|
Binary export example:
|
||||||
|
|
||||||
|
|
||||||
distrobox-export --bin /usr/bin/code --extra-flags "--foreground" --export-path $HOME/.local/bin
|
distrobox-export --bin /usr/bin/code --extra-flags "--foreground" --export-path $HOME/.local/bin
|
||||||
|
|
||||||
In the case of exporting binaries, you will have to specify **where** to export it (`--export-path`) and the tool will create
|
In the case of exporting binaries, you will have to specify **where** to export it (`--export-path`) and the tool will create
|
||||||
@@ -95,7 +94,6 @@ your `env` or project.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
NOTE: some electron apps such as vscode and atom need additional flags to work from inside the
|
NOTE: some electron apps such as vscode and atom need additional flags to work from inside the
|
||||||
container, use the `--extra-flags` option to provide a series of flags, for example:
|
container, use the `--extra-flags` option to provide a series of flags, for example:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Init the distrobox (not to be launched manually)
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Init the distrobox (not to be launched manually)
|
||||||
|
|
||||||
distrobox-init is the entrypoint of a created distrobox.
|
distrobox-init is the entrypoint of a created distrobox.
|
||||||
Note that this HAS to run from inside a distrobox, will not work if you run it
|
Note that this HAS to run from inside a distrobox, will not work if you run it
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### List containers
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# List containers
|
||||||
|
|
||||||
distrobox-list lists available distroboxes. It detects them and lists them separately
|
distrobox-list lists available distroboxes. It detects them and lists them separately
|
||||||
from the rest of normal podman or docker containers.
|
from the rest of normal podman or docker containers.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Remove containers
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Remove containers
|
||||||
|
|
||||||
distrobox-rm delete one of the available distroboxes.
|
distrobox-rm delete one of the available distroboxes.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
### Stop containers
|
<!-- markdownlint-disable MD010 -->
|
||||||
|
# Stop containers
|
||||||
|
|
||||||
distrobox-rm delete one of the available distroboxes.
|
distrobox-rm delete one of the available distroboxes.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
- [Distrobox](../README.md)
|
- [Distrobox](../README.md)
|
||||||
* [Outside the distrobox](#outside-the-distrobox)
|
- [Outside the distrobox](#outside-the-distrobox)
|
||||||
- [distrobox-create](distrobox-create.md)
|
- [distrobox-create](distrobox-create.md)
|
||||||
- [distrobox-enter](distrobox-enter.md)
|
- [distrobox-enter](distrobox-enter.md)
|
||||||
- [distrobox-list](distrobox-list.md)
|
- [distrobox-list](distrobox-list.md)
|
||||||
- [distrobox-rm](distrobox-rm.md)
|
- [distrobox-rm](distrobox-rm.md)
|
||||||
- [distrobox-stop](distrobox-stop.md)
|
- [distrobox-stop](distrobox-stop.md)
|
||||||
* [Inside the distrobox](#inside-the-distrobox)
|
- [Inside the distrobox](#inside-the-distrobox)
|
||||||
- [distrobox-export](distrobox-export.md)
|
- [distrobox-export](distrobox-export.md)
|
||||||
- [distrobox-init](distrobox-init.md)
|
- [distrobox-init](distrobox-init.md)
|
||||||
|
|||||||
+57
-41
@@ -25,20 +25,22 @@
|
|||||||
|
|
||||||
## Execute complex commands directly from distrobox-enter
|
## Execute complex commands directly from distrobox-enter
|
||||||
|
|
||||||
Sometimes it is necessary to execure complex commands from a distrobox enter, like multiple concatenated commands using variables
|
Sometimes it is necessary to execure complex commands from a distrobox enter,
|
||||||
declared **inside** the container.
|
like multiple concatenated commands using variables declared **inside** the container.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
`distrobox enter test -- bash -l -c '"echo \$HOME && whoami"'`
|
`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.
|
Note the use of **single quotes around double quotes**, this is necessary so that
|
||||||
Also note the **dollar escaping** needed so that $HOME is not evaluated at the time of the command launch, but directly
|
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.
|
inside the container.
|
||||||
|
|
||||||
## Create a distrobox with a custom HOME directory
|
## Create a distrobox with a custom HOME directory
|
||||||
|
|
||||||
`distrobox-create` supports the use of the `--home` flag, as specified in the usage [HERE](./usage/distrobox-create.md)
|
`distrobox-create` supports the use of the `--home` flag, as specified in the
|
||||||
|
usage [HERE](./usage/distrobox-create.md)
|
||||||
|
|
||||||
Simply use:
|
Simply use:
|
||||||
|
|
||||||
@@ -46,7 +48,8 @@ Simply use:
|
|||||||
|
|
||||||
## Mount additional volumes in a distrobox
|
## Mount additional volumes in a distrobox
|
||||||
|
|
||||||
`distrobox-create` supports the use of the `--volume` flag, as specified in the usage [HERE](./usage/distrobox-create.md)
|
`distrobox-create` supports the use of the `--volume` flag, as specified in the
|
||||||
|
usage [HERE](./usage/distrobox-create.md)
|
||||||
|
|
||||||
Simply use:
|
Simply use:
|
||||||
|
|
||||||
@@ -62,7 +65,8 @@ If you want a different one you can use:
|
|||||||
|
|
||||||
## Duplicate an existing distrobox
|
## Duplicate an existing distrobox
|
||||||
|
|
||||||
It can be useful to just duplicate an already set up environment, to do this, `distrobox-create` supports the use of the
|
It can be useful to just duplicate an already set up environment, to do this,
|
||||||
|
`distrobox-create` supports the use of the
|
||||||
`--clone` flag, as specified in the usage [HERE](./usage/distrobox-create.md)
|
`--clone` flag, as specified in the usage [HERE](./usage/distrobox-create.md)
|
||||||
|
|
||||||
Simply use:
|
Simply use:
|
||||||
@@ -71,8 +75,8 @@ Simply use:
|
|||||||
|
|
||||||
## Export to the host
|
## Export to the host
|
||||||
|
|
||||||
Distrobox supports exporting to the host either binaries, applications or systemd services.
|
Distrobox supports exporting to the host either binaries, applications or systemd
|
||||||
[Head over the usage page to have an explanation and examples.](usage/distrobox-export.md)
|
services. [Head over the usage page to have an explanation and examples.](usage/distrobox-export.md)
|
||||||
|
|
||||||
## Execute commands on the host
|
## Execute commands on the host
|
||||||
|
|
||||||
@@ -80,11 +84,15 @@ You can check this little post about [executing commands on the host.](posts/exe
|
|||||||
|
|
||||||
## Enable SSH X-Forwarding when SSH-ing in a distrobox
|
## Enable SSH X-Forwarding when SSH-ing in a distrobox
|
||||||
|
|
||||||
SSH X-forwarding by default will not work because the container hostname is different from the host's one.
|
SSH X-forwarding by default will not work because the container hostname is
|
||||||
You can create a distrobox with will have the same hostname as the host by creating it with the following
|
different from the host's one.
|
||||||
init-hook:
|
You can create a distrobox with will have the same hostname as the host by
|
||||||
|
creating it with the following init-hook:
|
||||||
|
|
||||||
`distrobox-create --name test --image your-choosen-image:tag --init-hooks '"$(uname -n)" > /etc/hostname'`
|
```sh
|
||||||
|
distrobox-create --name test --image your-choosen-image:tag \
|
||||||
|
--init-hooks '"$(uname -n)" > /etc/hostname'`
|
||||||
|
```
|
||||||
|
|
||||||
This will ensure SSH X-Forwarding will work when SSH-ing inside the distrobox:
|
This will ensure SSH X-Forwarding will work when SSH-ing inside the distrobox:
|
||||||
|
|
||||||
@@ -92,21 +100,24 @@ This will ensure SSH X-Forwarding will work when SSH-ing inside the distrobox:
|
|||||||
|
|
||||||
## Use distrobox to install different flatpaks from the host
|
## Use distrobox to install different flatpaks from the host
|
||||||
|
|
||||||
By default distrobox will integrate with host's flatpak directory if present: `/var/lib/flatpak` and obviously
|
By default distrobox will integrate with host's flatpak directory if present:
|
||||||
with the $HOME one.
|
`/var/lib/flatpak` and obviously with the $HOME one.
|
||||||
|
|
||||||
If you want to have a separate system remote between host and container, you can create your distrobox with
|
If you want to have a separate system remote between host and container,
|
||||||
the followint init-hook:
|
you can create your distrobox with the followint init-hook:
|
||||||
|
|
||||||
`distrobox-create --name test --image your-choosen-image:tag --init-hooks 'umount /var/lib/flatpak'`
|
```sh
|
||||||
|
distrobox-create --name test --image your-choosen-image:tag \
|
||||||
|
--init-hooks 'umount /var/lib/flatpak'`
|
||||||
|
```
|
||||||
|
|
||||||
After that you'll be able to have separate flatpaks between host and distrobox.
|
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+)
|
You can procede to export them using `distrobox-export` (for distrobox 1.2.14+)
|
||||||
|
|
||||||
## Using podman inside a distrobox
|
## Using podman inside a distrobox
|
||||||
|
|
||||||
If `distrobox` is using `podman` as the container engine, you can use `podman socket` to
|
If `distrobox` is using `podman` as the container engine, you can use
|
||||||
control host's podman from inside a `distrobox`, just use:
|
`podman socket` to control host's podman from inside a `distrobox`, just use:
|
||||||
|
|
||||||
`podman --remote`
|
`podman --remote`
|
||||||
|
|
||||||
@@ -127,7 +138,8 @@ you should be good to go.
|
|||||||
|
|
||||||
## Using init system inside a distrobox
|
## Using init system inside a distrobox
|
||||||
|
|
||||||
You can use an init system inside the container on supported images. Example of such images are:
|
You can use an init system inside the container on supported images.
|
||||||
|
Example of such images are:
|
||||||
|
|
||||||
- docker.io/almalinux/8-init
|
- docker.io/almalinux/8-init
|
||||||
- registry.access.redhat.com/ubi7/ubi-init
|
- registry.access.redhat.com/ubi7/ubi-init
|
||||||
@@ -137,7 +149,8 @@ You can use such feature using:
|
|||||||
|
|
||||||
`distrobox create -i docker.io/almalinux/8-init --init --name test`
|
`distrobox create -i docker.io/almalinux/8-init --init --name test`
|
||||||
|
|
||||||
Note however that in this mode, you'll not be able to access host's processes from within the container.
|
Note however that in this mode, you'll not be able to access host's processes
|
||||||
|
from within the container.
|
||||||
|
|
||||||
Example use:
|
Example use:
|
||||||
|
|
||||||
@@ -148,25 +161,25 @@ user@test:~$ sudo systemctl enable --now sshd
|
|||||||
|
|
||||||
user@test:~$ sudo systemctl status sshd
|
user@test:~$ sudo systemctl status sshd
|
||||||
● sshd.service - OpenSSH server daemon
|
● sshd.service - OpenSSH server daemon
|
||||||
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
|
Loaded: loaded (sshd.service; enabled; vendor preset: enabled)
|
||||||
Active: active (running) since Fri 2022-01-28 22:54:50 CET; 17s ago
|
Active: active (running) since Fri 2022-01-28 22:54:50 CET; 17s ago
|
||||||
Docs: man:sshd(8)
|
Docs: man:sshd(8)
|
||||||
man:sshd_config(5)
|
man:sshd_config(5)
|
||||||
Main PID: 291 (sshd)
|
Main PID: 291 (sshd)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using distrobox as main cli
|
## Using distrobox as main cli
|
||||||
|
|
||||||
In case you want (like me) to use your container as the main CLI environment, it comes
|
In case you want (like me) to use your container as the main CLI environment,
|
||||||
handy to use `gnome-terminal` profiles to create a dedicated setup for it:
|
it comes handy to use `gnome-terminal` profiles to create a dedicated setup for it:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Personally, I just bind `Ctrl-Alt-T` to the Distrobox profile and `Super+Enter` to the Host profile.
|
Personally, I just bind `Ctrl-Alt-T` to the Distrobox profile and `Super+Enter`
|
||||||
|
to the Host profile.
|
||||||
|
|
||||||
For other terminals, there are similar features (profiles) or you can set up a dedicated shortcut to
|
For other terminals, there are similar features (profiles) or you can set up a
|
||||||
launch a terminal directly in the distrobox
|
dedicated shortcut to launch a terminal directly in the distrobox
|
||||||
|
|
||||||
## Improve distrobox-enter performance
|
## Improve distrobox-enter performance
|
||||||
|
|
||||||
@@ -179,10 +192,11 @@ this will improve a lot `podman`'s command performances.
|
|||||||
|
|
||||||
## Slow creation on podman and image size getting bigger with distrobox-create
|
## Slow creation on podman and image size getting bigger with distrobox-create
|
||||||
|
|
||||||
For rootless podman 3.4.0 and upward, adding this to your `~/.config/containers/storage.conf` file
|
For rootless podman 3.4.0 and upward, adding this to your `~/.config/containers/storage.conf`
|
||||||
will improve container creation speed and fix issues with images getting bigger when using rootless containers.
|
file will improve container creation speed and fix issues with images getting
|
||||||
|
bigger when using rootless containers.
|
||||||
|
|
||||||
```
|
```conf
|
||||||
[storage]
|
[storage]
|
||||||
driver = "overlay"
|
driver = "overlay"
|
||||||
|
|
||||||
@@ -190,13 +204,15 @@ driver = "overlay"
|
|||||||
mount_program = "/usr/bin/fuse-overlayfs"
|
mount_program = "/usr/bin/fuse-overlayfs"
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that this is necessary only on Kernel version older than `5.11` . From version `5.11` onwards
|
Note that this is necessary only on Kernel version older than `5.11` .
|
||||||
native `overlayfs` is supported and reports noticeable gains in performance as explained [HERE](https://www.redhat.com/sysadmin/podman-rootless-overlay)
|
From version `5.11` onwards native `overlayfs` is supported and reports noticeable
|
||||||
|
gains in performance as explained [HERE](https://www.redhat.com/sysadmin/podman-rootless-overlay)
|
||||||
|
|
||||||
## Container save and restore
|
## Container save and restore
|
||||||
|
|
||||||
To save, export and reuse an already configured container, you can leverage `podman save` or `docker save` and `podman import` or `docker import`
|
To save, export and reuse an already configured container, you can leverage
|
||||||
to create snapshots of your environment.
|
`podman save` or `docker save` and `podman import` or `docker import` to
|
||||||
|
create snapshots of your environment.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -204,14 +220,14 @@ To save a container to an image:
|
|||||||
|
|
||||||
with podman:
|
with podman:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
podman container commit -p distrobox_name image_name_you_choose
|
podman container commit -p distrobox_name image_name_you_choose
|
||||||
podman save image_name_you_choose:latest | gzip > image_name_you_choose.tar.gz
|
podman save image_name_you_choose:latest | gzip > image_name_you_choose.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
with docker:
|
with docker:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
docker container commit -p distrobox_name image_name_you_choose
|
docker container commit -p distrobox_name image_name_you_choose
|
||||||
docker save image_name_you_choose:latest | gzip > image_name_you_choose.tar.gz
|
docker save image_name_you_choose:latest | gzip > image_name_you_choose.tar.gz
|
||||||
```
|
```
|
||||||
@@ -223,19 +239,19 @@ This will create a tar.gz of the container of your choice at that exact moment.
|
|||||||
Now you can backup that archive or transfer it to another host, and to restore it
|
Now you can backup that archive or transfer it to another host, and to restore it
|
||||||
just run
|
just run
|
||||||
|
|
||||||
```
|
```sh
|
||||||
podman load < image_name_you_choose.tar.gz
|
podman load < image_name_you_choose.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
```
|
```sh
|
||||||
docker load < image_name_you_choose.tar.gz
|
docker load < image_name_you_choose.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
And create a new container based on that image:
|
And create a new container based on that image:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
distrobox-create --image image_name_you_choose:latest --name distrobox_name
|
distrobox-create --image image_name_you_choose:latest --name distrobox_name
|
||||||
distrobox-enter --name distrobox_name
|
distrobox-enter --name distrobox_name
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user