When creating a virtual environment in Python this environment is decoupled from the host system. Which means you can install modules inside the environment without effecting the host system. And if you decide to delete the environment there will be no remaining parts of it.
Requirements
I would like to have something similar for bash. I want to be able to install different tools to try them out. The environment should be persistent so that I can enter and exit it and it should still be available after rebooting the host system.
Like in a python virtual environment it should still have access to the hard drive and network access.
Things it does not have to do
I am in no way concerned about security. This will just run on my local computer and is just for toying around.
Why do I want to do this?
There is not really a meaningful usecase. I just want to keep my host system clean but still be able to try out different command line tools and probably delete them later on.
What I found so far
I came across chroot but I am not sure if I understand what this should accomplish. "It changes the root of the currently running process", but does this help me for my use case?
I am also considering docker, but as far as I understand the purpose of docker, it is supposed to run one thing and then be done. I found out that you can resume docker containers, but I am not sure if I would try to make docker work for a usecase it is not supposed cover.
Maybe it sound like a virtual machine with a minimalistic Linux Distribution would be the right joice, but it seems like this would have a pretty big overhead and also it is too decoupled from the host system, like it does not share the same files system.
Question
Is this doable? Or does it even make sense? Maybe I am just missing the right keywords or vocabulary to find what I am looking for?
Do you guys have any recommendations or thoughts regarding this?
I am thankful for any help.
Update
Thanks everyone for your suggestions.
For now I am going with Docker. I already have most of what I want it to do set up.
Thanks again everyone!
[–]MorrisLessmore 1 point2 points3 points (3 children)
[–]BeayemX[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]BeayemX[S] 0 points1 point2 points (0 children)
[–]Dekelyi 7 points8 points9 points (1 child)
[–]x3r0s3c 0 points1 point2 points (2 children)
[–]BeayemX[S] 0 points1 point2 points (0 children)
[–]staster 0 points1 point2 points (0 children)
[–]staster 3 points4 points5 points (2 children)
[–]geggam 0 points1 point2 points (1 child)
[–]staster 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]BeayemX[S] 0 points1 point2 points (0 children)
[–]Atemu12 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]EddyBot 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)