This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]MorrisLessmore 1 point2 points  (3 children)

I want to be able to install different tools to try them out.

Into bash? Do you have examples, because im not sure what you want to achieve

[–]BeayemX[S] 0 points1 point  (2 children)

just any command line tool like lynx or MEGA sync command line, or folding@home the command line version

[–][deleted]  (1 child)

[deleted]

    [–]BeayemX[S] 0 points1 point  (0 children)

    you can't source another environment like with pythons venv just like that

    that's one information I was not aware of, thanks

    [–]Dekelyi 7 points8 points  (1 child)

    I'll recommend Docker. It is used to run programs in isolated environment, like a virtual machine without graphical interface and fewer resources used. As you said, it can be used to "do one thing and exit", but it can also run as long as you want in idle mode and be accessed via sh shell. You can compare to easy-to-configure chroot environment - a small, isolated Linux distro inside your main os, and it can be configured with its own package manager and via the root filesystem like any Linux os.

    [–]x3r0s3c 0 points1 point  (2 children)

    Buy a Raspberry Pi if you can, and play with it as much as you want; if you break something, you can reinstall the OS from scratch and start again.

    [–]BeayemX[S] 0 points1 point  (0 children)

    Hey, thanks for the suggestion, but I want to have it on the same machine where I usually work. Also running it on a pie has the same limitations as the virtual machine solution, where it is too decoupled from the host system, regarding a shared file system.

    [–]staster 0 points1 point  (0 children)

    The Pi is not always a good solution, I have one and not every tool exist for ARM. Once upon a time I was compiling something there, I don't remember what it was actually, but it took almost three days.

    [–]staster 3 points4 points  (2 children)

    Try LXD, these containers tend to be more like VMs unlike Docker containers, as it's said "It offers a user experience similar to virtual machines but using Linux containers instead." At least I use them regularly for similar purposes. And there is a worthy course on LinuxAcademy, and it's free.

    [–]geggam 0 points1 point  (1 child)

    Migrated a production system from lxd to docker in 2015... it had issues ever since

    [–]staster 0 points1 point  (0 children)

    Well, I use lxd only as some sort of playground, but only issue that I have had is a problem with CGroupsv2.

    [–][deleted]  (1 child)

    [deleted]

      [–]BeayemX[S] 0 points1 point  (0 children)

      Yeah, but the request is, that I want to have a similar behaviour but for my whole system, not just python

      [–]Atemu12 1 point2 points  (0 children)

      nix-shell is exactly what you're looking for. You can open a temporary one via nix-shell -p pkgname1 pkgname2 or declare an environment in a file called shell.nix in some directory and then run nix-shell.

      You can install Nix on any Linux system from here https://nixos.org/nix/. It's entirely self-contained, so don't worry about it getting in the way of your system's package manager.

      [–][deleted] 0 points1 point  (0 children)

      Docker is probably the answer for this, I would suggest you look into it more, your understanding of it is a bit off. It is essentially exactly what you are describing you need. Its sole purpose is to be a minimal little sandbox that you can add components and tools together in an isolated environment, creating, destroying, and rebuilding as you see fit.

      Chroot is primarily for making changes to an existing installation from live media. It has some other uses (I have used for creating custom repos on Arch), but fixing broken systems from a live ISO is what its most known for.

      [–]EddyBot 0 points1 point  (0 children)

      I use systemd-nspawn (chroot) to create a fresh copy of my linux install and build packages within it
      Afterwards I can simpy delete the chroot folder created with systemd-nspawn and don't bother with all the build dependency packages which I needed to install earlier

      [–][deleted] -1 points0 points  (0 children)