qubes.vm.dispvm – Disposable VM

A disposable vm implementation

class qubes.vm.dispvm.DispVM(app, xml, *args, **kwargs)[source]

Bases: QubesVM

Disposable VM

async cleanup()[source]

Clean up after the DispVM

This stops the disposable qube and removes it from the store. This method modifies qubes.xml file.


Create entries in Qubes DB.

async classmethod from_appvm(appvm, **kwargs)[source]

Create a new instance from given AppVM


appvm (qubes.vm.appvm.AppVM) – template from which the VM should be created


new disposable vm

kwargs are passed to the newly created VM

>>> import qubes.vm.dispvm.DispVM
>>> dispvm = qubes.vm.dispvm.DispVM.from_appvm(appvm).start()
>>> dispvm.run_service('qubes.VMShell', input='firefox')
>>> dispvm.cleanup()

This method modifies qubes.xml file. The qube returned is not started.


When domain is loaded assert that this vm has a template.

async on_domain_shutdown(_event, **_kwargs)[source]

Cleanup network interfaces of connected, running VMs.

This will allow re-reconnecting them cleanly later.

on_property_pre_reset_template(event, name, oldvalue=None)[source]

Forbid deleting template of VM

on_property_pre_set_template(event, name, newvalue, oldvalue=None)[source]

Forbid changing template of running VM

on_property_set_template(event, name, newvalue, oldvalue=None)[source]

Adjust root (and possibly other snap_on_start=True) volume on template change.

async start(**kwargs)[source]

Start domain


automatically remove this VM upon shutdown


Default VM to be used as Disposable VM for service calls.


Internal, persistent identifier of particular DispVM.


If this domain is to be included in default backup.


AppVM, on which this DispVM is based.