Single File Storage for App VMs

This is doable. I do something like this but with an added layer of complexity: I pass around veracrypt containers. One qube actually “owns” the containers. It (and dom0) hand a container off to another qube, which decrypts it. Then the decryptor qube (and dom0) hand it off to the qube that actually wants to access the data.

You don’t need quite that much, obviously, but you could create unencrypted containers on one qube (or have them be on a NAS that qube has access to), and pass those around in a similar way (no decryptor in the middle).

Disadvantage: Only one qube at a time can access a particular container.

Since I didn’t do exactly what you’re looking for but I came close, I can try to point you in the right direction. The first step, of course is to create the container, so I’m going to give you a bit of homework. Create (or pick an existing qube to serve as) a storage qube, and create a blank file on it of some size. You should then be able to use losetup on that qube to create a device, then mount it as if it were a drive. (This is all standard linux–and I probably have some details wrong in this description.) You should be able to write a file to that “drive,” dismount it, remount it and still see the file. (For this purpose just “touching” it should be sufficient to create it.)

Once you have a block device that’s really a file on whatever qube you’re using for storage, you should be able to do a losetup on it, have dom0 see it, and then have dom0 attach it to some other qube. There, you can mount it and read from and write to it.

You’ll probably want to automate a lot of this with shell scripts, if you get it working.

1 Like