Shutting down a VM when applications close

30 views
Skip to first unread message

tetra...@danwin1210.me

unread,
Nov 27, 2019, 7:53:08 AM11/27/19
to qubes...@googlegroups.com
DispVMs shut down automatically when the launched application closes.

Is it possible to enable this for certain applications in certain AppVMs
as well?

For example I may not want my "resource-heavy-apps-vm" to keep running
after MemoryHungryApp closes, because that ties up half my system RAM.

How would I configure "resource-heavy-apps-vm" to shutdown automatically
when MemoryHungryApp closes?

Steve Coleman

unread,
Nov 27, 2019, 8:19:29 AM11/27/19
to qubes...@googlegroups.com
You can try this trick when starting your app/vm:

dom0> qvm-run -a AppVM "resource-heavy-app;shutdown -h now"

When the application closes the next command in line is the shutdown
command, and the VM will simply exit. As long as the app does not
background itself by forking a new process to demonize this will likely
work.

If in testing that command works for you, then you can create a
specialized AppVM.desktop file, and set the Exec= entry to
"resource-heavy-app;shutdown -h now". Once that is done then add that
custom desktop file to your template VM in /usr/share/applications and
you should then be able to add the application directly to your qubes
menu for that specific VM.





tetra...@danwin1210.me

unread,
Nov 28, 2019, 2:29:27 AM11/28/19
to Steve Coleman, qubes...@googlegroups.com
On Wed, Nov 27, 2019 at 08:16:28AM -0500, Steve Coleman wrote:
>You can try this trick when starting your app/vm:
>
>dom0> qvm-run -a AppVM "resource-heavy-app;shutdown -h now"
>
>When the application closes the next command in line is the shutdown
>command, and the VM will simply exit. As long as the app does not
>background itself by forking a new process to demonize this will
>likely work.
>
>If in testing that command works for you, then you can create a
>specialized AppVM.desktop file, and set the Exec= entry to
>"resource-heavy-app;shutdown -h now". Once that is done then add that
>custom desktop file to your template VM in /usr/share/applications and
>you should then be able to add the application directly to your qubes
>menu for that specific VM.

Thanks!

lik...@gmx.de

unread,
Nov 29, 2019, 6:03:53 AM11/29/19
to qubes...@googlegroups.com
You could also use a feature of qubes to shutdown a VM after a certain time. You can find steps to enable it to a particular vm in this thread:
https://groups.google.com/forum/#!topic/qubes-users/lyABSZGmKdM

Now it also works for debian templates.

tetra...@danwin1210.me

unread,
Nov 29, 2019, 8:59:45 PM11/29/19
to lik...@gmx.de, qubes...@googlegroups.com
Great!
Reply all
Reply to author
Forward
0 new messages