sandboxie-plus / Sandboxie

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

Use of RAM disks with sandboxes #2868

Open ylluminate opened 1 year ago

ylluminate commented 1 year ago

Describe what you noticed and did

Hey David, I'm fighting a bit with a slow program and after some digging found that it's due to it using a slew of .dat files for its "database" whenever it loads lists, etc. This causes it to move rather slowly even on a fast SSD.

The particular program in question is one that I have two instances of in Sandiebox due to its inability to isolate "databases" properly. I'd like to utilize, I think, SoftPerfect's persistent "image files" feature: https://www.softperfect.com/products/ramdisk/manual/image_files.htm

The obvious reason for this is that it should keep files in sync between boots for the applications' Sandiebox folders.

Currently the Sandiebox sandboxes live in, we'll say, C:\Sandbox\USERNAME\APP1 and C:\Sandbox\USERNAME\APP2.

I don't see a clear method for defining or moving the sandboxes to an appropriate image or images. The datasets are not enormous, but one is roughly 1gb and I'd like to make a RAM disk that has a little room to grow so probably about 1.5 or 2gb (since the data in it presently is about 13 years old and it doesn't grow very fast).

Would you happen to have any thoughts on how to best accomplish this so that I don't shoot myself in the foot? This is a pretty important app to me and I can't afford a lot of fiddle time unfortunately.

How often did you encounter it so far?

No response

Affected program

N/A

Download link

N/A

Where is the program located?

The program is installed both inside and outside the sandbox.

Expected behavior

N/A

What is your Windows edition and version?

Windows 10

In which Windows account you have this problem?

A local or Microsoft account without special changes.

Please mention any installed security software

None

What version of Sandboxie are you running?

1.9.2 64-bit

Is it a new installation of Sandboxie?

I have been using the same version for some time.

Is it a regression?

No response

In which sandbox type you have this problem?

In a standard isolation sandbox (yellow sandbox icon).

Can you reproduce this problem on a new empty sandbox?

I can confirm it also on a new empty sandbox.

Did you previously enable some security policy settings outside Sandboxie?

No response

Crash dump

No response

Trace log

No response

Sandboxie.ini configuration

No response

ylluminate commented 1 year ago

I suppose I should qualify this further with my thoughts to see if I'm on the right track here:

My thought is that I would take the following steps:

  1. in SoftPerfect RAM Disk: ImageCreate Image... → create a 2gb img file at c:\ramdisks\sandiebox_ramdisk.img
  2. ImageMount Image... → drive P:\ (NOT "Hard Disk Emulation (slower)")
  3. in cmd.exe (administrator privileges): robocopy C:\Sandbox P:\Sandbox /E /Z /DCOPY:T /COPYALL /R:0 /W:0
  4. in Sandiebox Plus: OptionsGlobal SettingsAdvanced Config: Sandbox file system root: change from \??\%SystemDrive%\Sandbox\%USER%\%SANDBOX% to \??\P:\Sandbox\%USER%\%SANDBOX%

Does this make sense?

offhub commented 1 year ago

You can also define a custom FileRootPath for the box.

  1. Close sandboxed programs
  2. Right click on the box > Sandbox Options > Advanced Options > Miscellaneous > Add Option > Select FileRootPath > Enter your new path. \??\P:\Sandbox\%USER%\%SANDBOX%
  3. Copy your files to the new path.
ylluminate commented 1 year ago

Thanks @offhub, good to know.

DavidXanatos commented 1 year ago

Is there anything to do for me or can we close this issue? Also the current sandboxie insider build has built in ram disk support using the ImDisk driver.

ylluminate commented 1 year ago

Oh really? Is your ImDisk driver RAM disk solution persistent insomuch that it loads and then saves at each sandbox start and termination? Does it have the ability to autosave regularly so there's no data loss?

My particular scenario is that I'm dealing with an old invoicing system that I cannot change and it is super slow due to using many, many small flat files as its "database" and thus I have to try to speed some things up via a RAM disk that offers persistence and auto-backing up, etc.

DavidXanatos commented 1 year ago

the idea of the ramdisk was not to be persistent, but backing up and restoring could be added

bastik-1001 commented 1 year ago

Now there is a release that includes RAM disk support, which is ephemeral. Probably as expected by most people that wanted it for privacy reasons.

What's left, and why this issue is open, will be that some people want persistency for some RAM disks.