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.
2 Answers
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.– roaimaApr 20, 2018 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 doescp -p
not copy the image file?– TimApr 20, 2018 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.– roaimaApr 20, 2018 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.– fpmurphyApr 21, 2018 at 7:37
-
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.
-
Thanks. What level of virtualation does Qubes OS belong to? For comparison, Docker belongs to en.wikipedia.org/wiki/Operating-system-level_virtualization– TimApr 20, 2018 at 13:20
-