-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Wed, May 02, 2018 at 05:22:55PM +0300, Ivan Mitev wrote:
> Hi,
>
> I'm trying to implement "semi-persistent" dispVMs (in 4.0) that could be
> used for more than one time, until the service call ends (eg. the
> browser is closed by the user). The idea is to save resources/time and
> allow several consecutive links to be opened in the *same* dispVM until
> the user decides to scrap the VM by closing its browser.
> It's of course less secure than using a dispVM for a single usage, but
> it's much better than always using the same browser in an AppVM like I
> do because a/ I usually don't have enough RAM to have several dispVMs
> opened, b/ I'm usually in a hurry and don't want to wait for a dispVM to
> pop up, c/ dispVMs don't have bookmark management.
>
> But for that to work I need to set the dispVM's name (eg.
> 'dispBrowsing') rather than the randomly generated "disp[0-9]+" string.
You can start a normal DispVM and copy&paste links there. This is what I
do - a habit from times where no other option was available.
> `qvm-run` doesn't provide that functionality but it seems achievable
> with qubes's python API. I had a look at some tests in
> python/site-packages/qubes/... where dispVM names were hardcoded (eg.
> 'disp42' or 'disp123') but before spending too much time trying to
> understand those, I thought I'd ask here (+, the question seemed to be
> too in-depth for the qubes-users ML)
>
> It's important to retain the "shutdown/destroy when service call ends"
> functionality;
This seems contradicting what you want to achieve. If the VM should be
destroyed after the call ends, it wont be there after opening one link.
I think you've meant "shutdown/destroy when _all_ service calls ends",
but there are a lot of corner cases in such feature.
> a comment in vm/__init__.py (line 342) says "when running
> in dom0, one need to manually kill the dispVM after service call ends"
> (line 342). Does that mean that AppVMs have to initiate the creation of
> a dispVM with `qvm-open-in-dvm`, or is it possible to create such
> dispVMs in dom0 ?
>
> Another solution would be use create/destroy standard AppVMs but have a
> dispVM behavior - ie. shutdowning when the service call ends. Is that
> possible ? I looked at RPC actions but didn't find anything relevant.
You can create a DispVM with a static name. Such VM will not have
persistent storage (so, all the browser history, cache etc will be gone
after you shutdown the VM), but you can launch multiple rpc calls,
without spawning new instance for each. When you decide to close it, you
can simply choose "shutdown" action in qubes widget, instead of closing
just the browser. Or combine it with automatic shutdown of inactive VMs:
https://github.com/QubesOS/qubes-issues/issues/832
(there are at least two scripts for this linked there)
To create a DispVM with a static name, use:
qvm-create -C DispVM -t fedora-26-dvm -l red my-static-dispvm
- --
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-----
iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlrp2V0ACgkQ24/THMrX
1yyGpAf9Gbl8EcYjYv93m1fZTDj89w8Sh31nfxDlMPR3FKFp10HAkrUXJTF6IEn+
Zo+k5mCmwD26CH46JmPMNehEj0gAvs6eKUYNYoIsAs+ujQsHe8AQseZiROJc/FyP
qP6/uEFg+suWCIW87jY5t4RvA8BJRUMugEcRprk0cglI5NQWOctNmo1B+x6dZX6z
K0Mqad2RUKOKI4tf3Ff83NuOzg+SVmY59v64tzznCoJAw0X3gL0W++sPYfWcUqNj
MJKZCgXHBagLmY0jGhtOO2TowGDrPZBb1qOH3FdTgX69dY/cnFISuh1H9+b1WYpy
M1GYtwlIPJAxHFzRfgUeIqpmiommyg==
=3wsg
-----END PGP SIGNATURE-----