An automated way to qvm-open-in-vm a directory

qvm-open-in-vm does not work with directories. Thus, I need to find a way to do what qvm-open-in-vm would do with a directory, in the least manual steps possible.

So far, this is what I do: Manually start the VM, then manually run qvm-copy to copy the directory to that VM, then manually run qvm-console-dvm to control the started VM (because that VM, in my case, doesn’t have a terminal emulator (intended for minimization)), then manually start the application that would deal with that directory.

Moreover, there’s an issue with this way: It can’t provide a read-only way as with qvm-open-in-vm --view-only. Thus, one has to manually set the right permissions for that directory for view-only, if view-only is needed, before starting the application, and it still won’t be as good as qvm-open-in-vm --view-only.

Please see my post to see if it is possible to make qvm-open-in-vm work with directories. (qvm-open-in-vm is intended to work only with files and URL, as can be seen in its man page… I’m requesting adding the ability of opening directories, as with files, to qvm-open-in-vm.)

qvm-open-in-vm is designed for working with one file at a time. Expanding this functionality to include directories would likely expose unnecessary attack surface, even if only via users’ proclivity for self-inflicted wounds.

Given the nature of how directories would need to be treated differently, if you do want this feature, may I suggest implementing or proposing a different qrexec service explicitly for directories?

Why not create a wrapper script around qvm-open-in-dvm that would create a tar archive of the directory, like this?

#!/bin/bash
tar_path=/tmp/dir.tar
tar -c -f "$tar_path" "$1"
qvm-open-in-dvm "$tar_path"

That’s quick and dirty but it should work?

1 Like