2

Sometimes I would like to experiment with some commands which I am unfamiliar with (e.g. xmodmap), and also have the ability to revert the changes very easily without knowing much about the commands yet. Do I need some kind of light-weight virtualization or container (e.g. Docker) or sandbox? I am running Ubuntu 16.04 with LXDE. Thanks.

closed as too broad by muru, maulinglawns, dr01, Jeff Schaller, G-Man Apr 21 '18 at 4:04

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 6
    If you're not making system-wide changes, you can always experiment as another user and delete the account afterward. – dsstorefile1 Apr 19 '18 at 22:51
  • This time why the downvotes, people? The question is a reasonable one even if it is somewhat broad. – roaima Apr 20 '18 at 8:49
  • @dsstorefile Thanks. Will it work to user a container like Docker for my purpose? Is it an overkill? – Tim Apr 20 '18 at 12:48
  • @Tim Docker sounds fine. – dsstorefile1 Apr 20 '18 at 12:51
  • 1
    @roaima I don't know, in my opinion this question requires an up and a reopen vote and so I did it. I suggest the same to you. – peterh Apr 21 '18 at 15:42
7

I suggest you set up a VM in either Virtual Box or VMware Workstation (VMware Player does not support snapshots), snapshot the VM, do your experiments, and then revert to the snapshot whenever you need a "known to be good" operating system environment.

  • VMware Player doesn't support snapshots, but I assume there would be nothing wrong with using cp -p on the shutdown guest image files. Other than a doubling of disk space usage, that is. – roaima Apr 20 '18 at 8:48
  • @roaima Thanks. Do you mean that " using cp -p on the shutdown guest image files" does not double the disk space usage? I maybe misunderstood, but does cp -p not copy the image file? – Tim Apr 20 '18 at 12:47
  • @Tim since Player won't let you snapshot a guest, you would have to copy the entire guest image to emulate a snapshot. If the image is 20GB then the copy would also be 20GB. Contrast with a true snapshot where the extra disk space required is only that required to store changes made since the snapshot has been taken. – roaima Apr 20 '18 at 13:15
  • @roaima. The "image" size largely depends on the disk provisioning method, the number of snapshots, and changes made since snapshotting. If a 20Gb disk is thin-provisioned, the underlying physical file or files will typically be significantly smaller on a new VM. – fpmurphy Apr 21 '18 at 7:37
  • Yes thank you. I'm aware of that. Possibly Tim isn't though. – roaima Apr 21 '18 at 7:39
2

You may be interrested in Qubes OS, which enables you to run many Linux (or any other OS) containers using one or more OS templates.

For example we can use Debian template, install required software packages on it and than run the containers (personal, work and experiments).

In this scenario, anything you will do in experiments container, does not affect the template itself, or any other container at all.

In Qubes OS VM Manager you can make snapshots too, just like in VirtualBox.

Not the answer you're looking for? Browse other questions tagged or ask your own question.