[Qubes Tools - help wanted] Qubes screenshot tool Idea and specification?

137 views
Skip to first unread message

Jeremias E.

unread,
Jul 7, 2015, 9:22:16 PM7/7/15
to qubes...@googlegroups.com
Hello Marek,

You assigned the "Qubes Screenshot Tool" with a "help wanted" tag:
https://github.com/QubesOS/qubes-issues/issues/953

the question is how should the screenshot tool work? It would be nice to
have a more detailed idea about the tool and a small specification.

You allready mentioned following:

"I think the proper solution would
be to write a tool, which will send an image to selected VM and open it
there. Then ensure that this tool is the only listed in ksnapshot menu
(instead of all those VM entries)."

https://groups.google.com/forum/#!topic/qubes-users/QvabfH2GjB4

What dom0 to domU transaction are possible?
Using the qrexec client/daemon?

What programming language/s?

Best regards
 J. Eppler



Marek Marczykowski-Górecki

unread,
Jul 7, 2015, 10:22:24 PM7/7/15
to Jeremias E., qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jul 07, 2015 at 06:22:16PM -0700, Jeremias E. wrote:
> Hello Marek,
>
> You assigned the "Qubes Screenshot Tool" with a "help wanted" tag:
> https://github.com/QubesOS/qubes-issues/issues/953
>
> the question is how should the screenshot tool work? It would be nice to
> have a more detailed idea about the tool and a small specification.
>
> You allready mentioned following:
>
> "I think the proper solution would
> be to write a tool, which will send an image to selected VM and open it
> there. Then ensure that this tool is the only listed in ksnapshot menu
> (instead of all those VM entries)."
>
> https://groups.google.com/forum/#!topic/qubes-users/QvabfH2GjB4

Generally I think the tool should:
1. Take an image from ksnapshot (or other screenshoting tool)
2. Ask an user to which VM he/she want to send it
3. Send the file there (predefined, dedicated directory? ask the user
for location?(*))
4. Remove the file from dom0
5. (optionally?) Open the file in destination VM

(*) If you need directory selection dialog, "zenity" tool is really
simple for that. If you need to call it in VM, but from dom0, there is
already qrexec service for that:
$ qvm-run -p testvm 'QUBESRPC qubes.SelectDirectory dom0'
/home/user/Documents

The right place for such tool is qubes-core-admin-linux repository.

> What dom0 to domU transaction are possible?

Something like this: https://www.qubes-os.org/doc/CopyToDomZero/

Take care of not overriding arbitrary files there - maybe some dedicated
directory, or sth like this.

> Using the qrexec client/daemon?

There is also qrexec (services) documentation here:
https://www.qubes-os.org/doc/Qrexec/

Especially if you want to reuse file copy protocol (qfile), instead of simple
"cat", read that documentation. Note that currently there is no qfile
sending agent available in dom0 (but it's rather simple to include it
there)...
I'm not saying that using qfile is a must, especially for a single file.

> What programming language/s?

Preferably python, but if that's really simple script, shell (bash?) is
also ok.
In case of python, take a look at /usr/bin/qvm-run source for example
usage of the API.
1. Loading VMs collection:
qvm_collection = QubesVmCollection()
qvm_collection.lock_db_for_reading()
qvm_collection.load()
qvm_collection.unlock_db()
vm = qvm_collection.get_vm_by_name(vmname)
2. Running the command:
vm.run("command", localcmd="local command")
or
p = vm.run("command", passio_popen=True)
The first case will run "local command" in dom0 and connect its
stdout to stdin of "command" in the VM (and vice versa).
The second case will return subprocess.Popen object, where you can
access stdin and stdout properties to send/receive the data.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVnIlZAAoJENuP0xzK19csvKwH/0NHwDnIb059Hh0sPVpoIo+m
/zEtRe0JzBAZMFssxOkN8+7QB82Tr3YNLJ590+Zyrf3VPDakCamgodWNV5HgbPDJ
pGkoCL/WDya+tFlKigvMW5IFMNmFAXJIZcs9WEFWgRInlPvYPGB6W/HpuLAMn4D5
DhAbWmWeRkF2wGxV5pReB12TnSVSS4JtCM72xi+GdiP0Xz+X5FphwkzBNCYF64Id
gT2+9sScvibJy2pHX3YkT/fQmS8Jpy6gw7CZzwq6O4EO2Y+IKABrZzm18y5FXclg
lIxWBL/Mrkh6VcuRDOncWgnlxxd/uU9REkcZuryVIniF42hcc/Axr7IUAAs2glA=
=I6ti
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages