qubes.vm.adminvm – Dom0

This module contains the AdminVM implementation

class qubes.vm.adminvm.AdminVM(*args, **kwargs)[source]

Bases: LocalVM

Dom0

static get_mem()[source]

Get current memory usage of Dom0.

Unit is KiB.

static get_power_state()[source]

Always 'Running'.

static is_halted()[source]

Always False.

static is_running()[source]

Always True.

get_cputime()[source]

Get total CPU time burned by Dom0 since start.

get_mem_static_max()[source]

Get maximum memory available to Dom0.

kill()[source]

Does nothing.

on_feature_delete_preload_dispvm_max(event, feature)[source]

On deletion of the preload-dispvm-max feature, fire domain-preload-dispvm-start event on the system’s default_dispvm.

Parameters:
  • event (str) – Event which was fired.

  • feature (str) – Feature name.

on_feature_pre_set_preload_dispvm_delay(event, feature, value, oldvalue=None)[source]

Before accepting the preload-dispvm-delay feature, validate it.

Parameters:
  • event (str) – Event which was fired.

  • feature (str) – Feature name.

  • value (int) – New value of the feature.

  • oldvalue (int) – Old value of the feature.

on_feature_pre_set_preload_dispvm_max(event, feature, value, oldvalue=None)[source]

Before accepting the preload-dispvm-max feature, validate it.

Parameters:
  • event (str) – Event which was fired.

  • feature (str) – Feature name.

  • value (int) – New value of the feature.

  • oldvalue (int) – Old value of the feature.

on_feature_pre_set_preload_dispvm_threshold(event, feature, value, oldvalue=None)[source]

Before accepting the preload-dispvm-threshold feature, validate it.

Parameters:
  • event (str) – Event which was fired.

  • feature (str) – Feature name.

  • value (int) – New value of the feature.

  • oldvalue (int) – Old value of the feature.

on_feature_set_preload_dispvm_max(event, feature, value, oldvalue=None)[source]

After setting the preload-dispvm-max feature, fire domain-preload-dispvm-start event on the system’s default_dispvm.

Parameters:
  • event (str) – Event which was fired.

  • feature (str) – Feature name.

  • value (int) – New value of the feature.

  • oldvalue (int) – Old value of the feature.

async run_service(service, source=None, user=None, filter_esc=False, autostart=False, gui=False, **kwargs)[source]

Run service on this VM

Parameters:
  • service (str) – service name

  • source (qubes.vm.qubesvm.QubesVM) – source domain as presented to this VM

  • user (str) – username to run service as

  • filter_esc (bool) – filter escape sequences to protect terminal emulator

  • autostart (bool) – if True, machine will be started if it is not running

  • gui (bool) – when autostarting, also start gui daemon

Return type:

asyncio.subprocess.Process

Note

User root is redefined to SYSTEM in the Windows agent code

async run_service_for_stdio(*args, input=None, **kwargs)[source]

Run a service, pass an optional input and return (stdout, stderr).

Raises an exception if return code != 0.

args and kwargs are passed verbatim to run_service().

Warning

There are some combinations if stdio-related kwargs, which are not filtered for problems originating between the keyboard and the chair.

shutdown()[source]

Does nothing.

start(start_guid=True, notify_function=None, mem_required=None)[source]

Always raises an exception.

suspend()[source]

Does nothing.

verify_files()[source]

Always True

default_dispvm

Default disposable template to be used for spawning disposable qubes for service calls.

devices_denied

List of device interface codes that are denied for this VM.

icon

freedesktop icon name, suitable for use in PyQt4.QtGui.QIcon.fromTheme()

include_in_backups

If this domain is to be included in default backup.

keyboard_layout

Keyboard layout for this VM

property libvirt_domain

Libvirt object for dom0.

name
qid
property untrusted_qdb

QubesDB handle for this domain.

updateable

True if this machine may be updated on its own.

uuid
property xid: int

Always 0.

Returns:

0

Return type:

int