sandboxie-plus / Sandboxie

Sandboxie Plus & Classic
https://Sandboxie-Plus.com
GNU General Public License v3.0
13.48k stars 1.5k forks source link

add snapshot feature to restore sandbox to specific state #1096

Closed diieg707 closed 3 years ago

diieg707 commented 3 years ago

snapshot feature idea:

  1. add option to save snapshot of a sandbox

create a "snapshots" folder in sandbox folder (c:/sandbox/snapshots), all saved snapshots gonna be saved to this location. and when we click restore snapshot list would appear showing available snapshots

and add an option to lock sandbox to specific snapshot, when we click delete contents it would restore a sandbox to specific snapshot.

just another good idea to implement, hope you like it

DavidXanatos commented 3 years ago

well we already have a snapshot option, it works a bit different as it makes snapshots per box and not globally also there is no auto restor, but take a look on it and suggest an improvement to the existin gfeature

diieg707 commented 3 years ago

well we already have a snapshot option, it works a bit different as it makes snapshots per box and not globally also there is no auto restor, but take a look on it and suggest an improvement to the existin gfeature

Sorry to bother but could you make a little effort and implement #988?, sbie plus is quite unusable for those who work with winrar, 7zip and need constantly recover lots of files. Does this snapshot feature is available only on sbie plus?

DavidXanatos commented 3 years ago

Does this snapshot feature is available only on sbie plus?

only sbie plus has a UI for it, on classic you could get tehs same effect by copying files around and editing the snapshots.ini

diieg707 commented 3 years ago

Does this snapshot feature is available only on sbie plus?

only sbie plus has a UI for it, on classic you could get tehs same effect by copying files around and editing the snapshots.ini

i can't use sbie plus due to bug #1033 and immediate recovery window layout, they make it a bad experience

DavidXanatos commented 3 years ago

@diieg707 i have put the bug and the recovery layout on my todo next list so those things should be improved for the next build

diieg707 commented 3 years ago

well we already have a snapshot option, it works a bit different as it makes snapshots per box and not globally also there is no auto restor, but take a look on it and suggest an improvement to the existin gfeature

hello, i just saw the snapshot feature on plus, and this is my suggestion:

Gravityzwell commented 3 years ago

Save/Restore process states 😉 I'm not expecting this, but it would be huge. One example is games that don't have quicksaves, some only have checkpoint saves. Or an arcade game without any form of saves. Lots of other cases.

Maybe Sandboxie could have an easier chance at this than a VM, because it should only have to deal with processes running in the sandbox.

Here is a list of some open source games that could be tested: https://bartvandewoestyne.github.io/osswin/games.html

Some decent and relatively small: https://chromium-bsu.sourceforge.io http://spaceinvadersgl.sourceforge.net

diieg707 commented 3 years ago

Save/Restore process states 😉 I'm not expecting this, but it would be huge. One example is games that don't have quicksaves, some only have checkpoint saves. Or an arcade game without any form of saves. Lots of other cases.

Maybe Sandboxie could have an easier chance at this than a VM, because it should only have to deal with processes running in the sandbox.

Here is a list of some open source games that could be tested: https://bartvandewoestyne.github.io/osswin/games.html

Some decent and relatively small: https://chromium-bsu.sourceforge.io http://spaceinvadersgl.sourceforge.net

Man sandboxie snapshots don't work for games, for that you should use virtual machine, that save state of processes running

Gravityzwell commented 3 years ago

I know it doesn't now, but then no snapshots at all existed until David added them. Of course I can use a VM. But that is a weak option for games, unless there is a way to passthrough the OS and GPU that I don't know (on Windows). Virtual Box can't come close as far as I know. QEMU I don't see a way (on Windows). Maybe VMWare Workstation but I haven't tried it lately.

DavidXanatos commented 3 years ago

Save/Restore process states 😉 I'm not expecting this, but it would be huge. One example is games that don't have quicksaves, some only have checkpoint saves. Or an arcade game without any form of saves. Lots of other cases.

Maybe Sandboxie could have an easier chance at this than a VM, because it should only have to deal with processes running in the sandbox.

Here is a list of some open source games that could be tested: https://bartvandewoestyne.github.io/osswin/games.html

Some decent and relatively small: https://chromium-bsu.sourceforge.io http://spaceinvadersgl.sourceforge.net

This is absolutely not possible, we don't have the ability to mess to that extent with the windows kernel.

Being able to suspend to disk individual processes would be huge, but there you have to re open all the handles, with the same values, sockets, and other kernel objects. As far as I can tell not even MSFT could add such a feature without re engineering large parts of the kernel.

Ultimately it breaks down to various kernel objects being referenced by a value which the application stores some ware somehow in its memory i.e. its up to the programmer, and those values being globally unique for all applications. At this point those values being given out somewhat randomly will make you end up in a scenario where you want to resume a process, but one of the handle values it used is now used for a different handle by a different process.

Windows kernel would have to be re enginiered to make all handle values unique per process so to abstract from the kernel objects with an additional translation layer.

And that's just one of the problems, we would need to be able to restore threads and all their states, etc.. etc... etc...

Gravityzwell commented 3 years ago

Mission impossible. Got it. Never said it would be easy 😉, but maybe there's a different approach?

The top emulators have saves, e.g., Dolphin: https://github.com/dolphin-emu/dolphin via the Emulation->Save State and Emulation->Load State menus.

rpcs3 is a newer Playstation 3 emulator. There is a Save States pull that's been in progress for about a year. Some intersting comments in that thread. https://github.com/RPCS3/rpcs3/pull/10478

xenia is a Xbox 360 emulator. Supposedly has save states but I could never get them working: https://github.com/xenia-project/xenia

Some newer emulators don't have save states. It typically comes along later. e.g., cemu (not open source) https://emulation.gametechwiki.com/index.php/Cemu

DavidXanatos commented 3 years ago

They have save states because what they do is not so different from what VMWare does which has also save states, they run code internally which is oblivious the windows outside and does not communicate directly with it on any way, everything is done using a translation layer.

Sandboxie however allows the programs to talk to windows and do a lot of things directly, that's the difference, and the reason this will never work.

DavidXanatos commented 3 years ago

A quick option to restore to a given snapshot or to the last snapshot sounds useful may add that to one of the next builds

Gravityzwell commented 3 years ago

States: Granted every emulator has specific code for that system. Retroarch and Mame support many different systems, but each one gets individual attention. Mame has a flag for each whether it supports saves. I did say I'm not expecting this 😉