I wonder if there is a kind of a sandboxing solution for linux: when I want to try a software without installing it I get all the .deb files and extract then somewhere, then I do two things:
export PATH="$PATH:/home/user/testing_app/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/user/testing_app/lib"
Most of the times it works well, but sometimes the applications require
/etc configurations, or other resources (like images on share folder) that I was not able to solve.
I know the
mount -o bind would provide me a separated environment, but I still need to bind
/etc directories to use others dependencies.
Well, I was wondering if you know any solution, such a way to bind two directories mixing their content and recording the new/edited content only in one of them.
From Wikipedia: "In computer security, a sandbox is a security mechanism for separating running programs. It is often used to execute untested code, or untrusted programs from unverified third-parties, suppliers, untrusted users and untrusted websites."
Sometimes there is more than one app that is candidate to solve my problems, in that case I want to get the one which better fit my needs, so I install all of them, but I just want to try them, I want to "restore" my machine state as it was before the installations, of all changes the software did. Just removing them is not enough, it is because them generate dot files in my home, or generate logs files, or change other software's settings, I want to have register of all the changes the app do when it runs, and undo them.
Yes, a VM would solve my problem but besides taking a large space to hold two or more linux installations, it also lose performance.
A separated linux installation in my disk doing chroot would please me better than a VM in performance, but it still takes some unwanted spaces because of repeated files, almost all of them are the same of my original distro.
This is what prompted me to open this topic, if somehow I could return to a previous state of my entire disk, like a version control system, or like the qemu-img's backing file "If a base image is specified with -o backing_file=filename, the image will only record differences between itself and the base image". Of course this still isn't the best solution, because I wish undo only a specific app changes.
The ideal solution would be something like that:
$ mkdir dir1 dir2 $ echo "Lipsum" > dir1/file1 $ echo "Original" > dir1/file2 $ sudo mount -o bind -some-magic-flag dir1 dir2 $ echo "Changed" > dir2/file2 $ touch dir2/file3 $ ls -1 dir2 file1 file2 file3 # it's ok $ ls -1 dir1 file1 file2 # file3 sould not be here! $ sudo umount dir2 $ ls -1 dir2 file2 file3 # file1 was not changed, but file2 was $ cat dir1/file2 Original $ cat dir2/file2 Changed
This is what I need!