delaying total shutdown of disposable qube

41 views
Skip to first unread message

Ólafur Jens Sigurðsson

unread,
Apr 21, 2021, 10:07:24 AM4/21/21
to qubes...@googlegroups.com
Hi

When we open an attachment from emails, like .odf files and such, and
start writing in them, meaning to send the edited file back to the
sender. Then there is a slight chance of a person saving the file,
closing the editor and then loosing the file because the qube has shut
down.

We would like to add a new disposable template in which the disposable
vm's will be shut down with a delay of a few minutes, just enough for
the person to start replying to the email and finding that they need the
file and then open up the file manager from that disposable qube that
was almost shut down and thus saving the file.

How would we do this? Is there some option in Qubes-OS that supports this?

If no option exists then I would like to know what happens when you
close an app like librewriter that is opened in a dispvm. How does the
dispvm know that it is supposed to shut down when the app is closed?
Perhaps we can find a way through there to implement some kind of delay.

--
Med venlig hilsen
Ólafur Jens Sigurðsson
Systemadministrator

Kontor: 70 40 40 70
Direkte: 70 40 40 67
Email: o...@nemtilmeld.dk

NemTilmeld.dk
- Online tilmeldingssystem - Nemt for dig og dine deltagere!

Rusty Bird

unread,
Apr 21, 2021, 3:52:17 PM4/21/21
to Ólafur Jens Sigurðsson, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Ólafur Jens Sigurðsson:
> We would like to add a new disposable template in which the disposable vm's
> will be shut down with a delay of a few minutes, just enough for the person
> to start replying to the email and finding that they need the file and then
> open up the file manager from that disposable qube that was almost shut down
> and thus saving the file.
>
> How would we do this? Is there some option in Qubes-OS that supports this?

I'm not aware of a built-in option, but you could cobble two things
together:

1. To make the destination qubes.OpenInVM service wait indefinitely
after the launched program is done, create an executable file at
/usr/local/etc/qubes-rpc/qubes.OpenInVM in e.g. fedora-delayed-dvm
containing:

#!/bin/sh
/etc/qubes-rpc/"${0##*/}" "$@"
exec sleep inf

Maybe also link it at /usr/local/etc/qubes-rpc/qubes.OpenURL to
get the same behavior for URLs.

2. To automatically shut down DisposableVMs based on
fedora-delayed-dvm when they have been running with no windows for 15
minutes, install the qubes-app-shutdown-idle package in the TemplateVM
(e.g. fedora-33), and:

$ qvm-service --enable fedora-delayed-dvm shutdown-idle

Rusty
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEhLWbz8YrEp/hsG0ERp149HqvKt8FAmCAgmBfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDg0
QjU5QkNGQzYyQjEyOUZFMUIwNkQwNDQ2OUQ3OEY0N0FBRjJBREYACgkQRp149Hqv
Kt88MA/9HStm1HvlA5D2EoSCmTN2cARLtA8l34Rl5SCoFvxQ/hC0BCeZHAPjXKN0
ERm52C2hoI2tIWERzYB+LzUvZhs5WoRxCqWp06s8DX5KHqQeNX6MajzjGeyq+jf0
iW27jItdoyqbBX2KkNhv8dsbek8RwYG5Vz67scBjvvQDag+WAoYuqrKAYugEl5NY
uOjVK8X1e3YVtP7nOhtJYqApVOz6QXJ4glp5aovTRHkwQsDum6ijs1Djjln96bGm
y6w5Nl5hwC4P15pbh5zQJ7rwkCQ+sbIYjmul9lkbEnpg7oON3yanzRI8QSTnWElY
U/Xr5VzOHK11P/82DAUE+ud210IFQW6Qu8MkebaTt9cJLduxVH91o1LfT9WFKIiU
YeDmM9LFxP5f6LJjDx0+lX5IiuQGWw/534hJhMUXDGUfmo5bn0RBDTOKCUp2ymlB
ntNRYJ373fOsPM8RBd6J95lJ8OiNYLL4m1ad4U9sCUvmU0g7AMafYeZewtj/5tLZ
xqWQ/iOuT7beaIjgRmBTL5Lid0qzYAzecXyT+71VBzwpVFuL298wjO8PUXqDe3Y8
pCRfGkNy04Cw4ojQR/rygNKRxnqvYxV9pCjVuvo24O5aKNmBjE2Yhh98YlSwFAD+
ilQgKH26elRbpFiduzcY78EZHgDQSNVDE8PZhbrjwS2o/ikqBbs=
=08qo
-----END PGP SIGNATURE-----


Rusty Bird

unread,
Apr 21, 2021, 4:07:29 PM4/21/21
to Ólafur Jens Sigurðsson, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Rusty Bird:
> Ólafur Jens Sigurðsson:
> > We would like to add a new disposable template in which the disposable vm's
> > will be shut down with a delay of a few minutes, just enough for the person
> > to start replying to the email and finding that they need the file and then
> > open up the file manager from that disposable qube that was almost shut down
> > and thus saving the file.
> >
> > How would we do this? Is there some option in Qubes-OS that supports this?
>
> I'm not aware of a built-in option, but you could cobble two things
> together:

Umm, but also: If you open the file in a DisposableVM for editing,
don't you already get the modified file back if you just press save
and close the DisposableVM window?

> 1. To make the destination qubes.OpenInVM service wait indefinitely
> after the launched program is done, create an executable file at
> /usr/local/etc/qubes-rpc/qubes.OpenInVM in e.g. fedora-delayed-dvm
> containing:
>
> #!/bin/sh
> /etc/qubes-rpc/"${0##*/}" "$@"
> exec sleep inf
>
> Maybe also link it at /usr/local/etc/qubes-rpc/qubes.OpenURL to
> get the same behavior for URLs.
>
> 2. To automatically shut down DisposableVMs based on
> fedora-delayed-dvm when they have been running with no windows for 15
> minutes, install the qubes-app-shutdown-idle package in the TemplateVM
> (e.g. fedora-33), and:
>
> $ qvm-service --enable fedora-delayed-dvm shutdown-idle

Rusty
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEhLWbz8YrEp/hsG0ERp149HqvKt8FAmCAhfhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDg0
QjU5QkNGQzYyQjEyOUZFMUIwNkQwNDQ2OUQ3OEY0N0FBRjJBREYACgkQRp149Hqv
Kt/N/Q//dQzHhB2rbbhEywWELJ52mGLk3+8dJKcKTTgRAm9FAY7+dyjB6uw4ptfS
AZeGDpKGnVVzKbZdAvzCW7tPX4Hj5uKWQoX6e2PpgowBpgWAJbnMkLcYK53XjJab
ff7pMEhCSviZdsnqVp2klA2CtzPcKZeSYH6G4OYkkW0UcxxZZXMlV8jMESa75nm3
TETyb01xDPE13I5LWpZnThltPUK8L+xi6UhCmegL6rXQtP+FiHe2Yx0it6qyQdCa
JzwekV+AOq2OjjlFUxd6+kRASXNNnkDbYArQ4Z4eMbYr4Qx3RBi4uZ5orT+anZPd
QQqpgfXHs4qgTwxDzTcWynaXmSvsgM7UqTV1S1QdagM1xfjUDN5I7ptJObck60oW
bDrP2hX0efhj/q/D3+Y2+09+k/1CdduwbVVZY/msAhe/OgdMr0SoQ2W8foa46qAk
o7THJ/LYGoUuuGdrlHh+y3X0ph5kFfHtf1LTsXPai78CMbNw5mUtEVtWO0k0OiQ1
tUvp+HQUF3KvJyt0ZCO1hCnph0tkSqxmHULs860dUAdNsNia74lMXt69blVrL+fK
NHUnSmJk45H+F58OInmebVoeHXDbFhhK0Euum3cJw+Idfi0oyTNH0jer1Hm21Tmr
DrLEBsSKXqyUBO4sh8HrjTH2uqomMXCQoH4nJ4CVcVqdls0i3p8=
=vlKf
-----END PGP SIGNATURE-----


Sven Semmler

unread,
Apr 30, 2021, 6:38:34 PM4/30/21
to qubes...@googlegroups.com
On 4/21/21 9:07 AM, 'Ólafur Jens Sigurðsson' via qubes-users wrote:
> When we open an attachment from emails, like .odf files and such, and
> start writing in them, meaning to send the edited file back to the
> sender. Then there is a slight chance of a person saving the file,
> closing the editor and then loosing the file because the qube has
> shut down.

How do you do this?

a) Qubes Attachments (thunderbird-qubes)
b) qvm-open-in-dvm configured under Files & Attachments in Thunderbird
c) saving the file to a folder and invoking qvm-open-in-dvm or
equivalent context menu option

Your question makes sense with a) & b)

On 4/21/21 3:07 PM, Rusty Bird wrote:
> Umm, but also: If you open the file in a DisposableVM for editing,
> don't you already get the modified file back if you just press save
> and close the DisposableVM window?

This would be scenario c) ... in which case there is no issue as the
sending qube now has an updated (edited) version of the file as Rusty
Bird points out.

> We would like to add a new disposable template in which the
> disposable vm's will be shut down with a delay of a few minutes,

You could achieve this by combining a named disposable qube [1] with the
shutdown script [2] earlier linked by Rusty Bird.

[1] see
https://www.qubes-os.org/doc/disposablevm-customization/#create-custom-sys-net-sys-firewall-and-sys-usb-disposablevms
as an example. These qubes are disposable (no persistence) but will
remain running until you shut them down.

[2] https://github.com/QubesOS/qubes-app-shutdown-idle ... available as
a package from the standard Qubes OS repo.

/Sven

--
public key: https://www.svensemmler.org/0x8F541FB6.asc
fingerprint: D7CA F2DB 658D 89BC 08D6 A7AA DA6E 167B 8F54 1FB6



OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages