qubesadmin package¶
Subpackages¶
- qubesadmin.backup package
- Submodules
- qubesadmin.backup.core2 module
- qubesadmin.backup.core3 module
- qubesadmin.backup.restore module
BackupCanceledError
BackupHeader
BackupRestore
BackupRestore.Dom0ToRestore
BackupRestore.VMToRestore
BackupRestore.app
BackupRestore.backup_app
BackupRestore.backup_location
BackupRestore.backup_vm
BackupRestore.canceled
BackupRestore.check_disk_space()
BackupRestore.force_compression_filter
BackupRestore.get_restore_info()
BackupRestore.get_restore_summary()
BackupRestore.header_data
BackupRestore.location_is_service
BackupRestore.new_name_for_conflicting_vm()
BackupRestore.options
BackupRestore.passphrase
BackupRestore.processes_to_kill_on_cancel
BackupRestore.restore_do()
BackupRestore.restore_info_verify()
BackupRestoreOptions
ExtractWorker3
ExtractWorker3.base_dir
ExtractWorker3.blocks_backedup
ExtractWorker3.check_processes()
ExtractWorker3.cleanup_tar2()
ExtractWorker3.collect_tar_output()
ExtractWorker3.compressed
ExtractWorker3.crypto_algorithm
ExtractWorker3.decompressor_process
ExtractWorker3.decryptor_process
ExtractWorker3.encrypted
ExtractWorker3.feed_tar2()
ExtractWorker3.handle_dir()
ExtractWorker3.import_process
ExtractWorker3.passphrase
ExtractWorker3.progress_callback
ExtractWorker3.queue
ExtractWorker3.run()
ExtractWorker3.tar2_current_file
ExtractWorker3.tar2_feeder
ExtractWorker3.tar2_process
ExtractWorker3.verify_only
get_supported_crypto_algo()
get_supported_hmac_algo()
init_supported_hmac_and_crypto()
launch_proc_with_pty()
launch_scrypt()
- Module contents
- qubesadmin.events package
- qubesadmin.tests package
- Subpackages
- qubesadmin.tests.backup package
- Submodules
- qubesadmin.tests.backup.backupcompatibility module
AppProxy
MockFirewall
MockVolume
TC_00_QubesXML
TC_10_BackupCompatibility
TC_10_BackupCompatibility.append_backup_stream()
TC_10_BackupCompatibility.assertDirectoryExists()
TC_10_BackupCompatibility.assertDom0Restored()
TC_10_BackupCompatibility.assertFileExists()
TC_10_BackupCompatibility.calculate_hmac()
TC_10_BackupCompatibility.cleanup_tmpdir()
TC_10_BackupCompatibility.create_appmenus()
TC_10_BackupCompatibility.create_dom0_files()
TC_10_BackupCompatibility.create_limited_tmpdir()
TC_10_BackupCompatibility.create_private_img()
TC_10_BackupCompatibility.create_v1_files()
TC_10_BackupCompatibility.create_v3_backup()
TC_10_BackupCompatibility.create_v4_backup()
TC_10_BackupCompatibility.create_v4_files()
TC_10_BackupCompatibility.create_volatile_img()
TC_10_BackupCompatibility.create_whitelisted_appmenus()
TC_10_BackupCompatibility.dom0_dirs
TC_10_BackupCompatibility.dom0_files
TC_10_BackupCompatibility.fullpath()
TC_10_BackupCompatibility.handle_v3_file()
TC_10_BackupCompatibility.handle_v4_file()
TC_10_BackupCompatibility.mock_appmenus()
TC_10_BackupCompatibility.scrypt_encrypt()
TC_10_BackupCompatibility.setup_expected_calls()
TC_10_BackupCompatibility.storage_pool
TC_10_BackupCompatibility.test_210_r2()
TC_10_BackupCompatibility.test_220_r2_encrypted()
TC_10_BackupCompatibility.test_230_r2_uncompressed()
TC_10_BackupCompatibility.test_230_r4()
TC_10_BackupCompatibility.test_230_r4_compressed()
TC_10_BackupCompatibility.test_230_r4_custom_cmpression()
TC_10_BackupCompatibility.test_230_r4_uncommon_cmpression_forced()
TC_10_BackupCompatibility.test_230_r4_uncommon_compression()
TC_10_BackupCompatibility.test_300_r4_no_space()
TC_11_BackupCompatibilityIntoLVM
- Module contents
BackupTestCase
BackupTestCase.BackupErrorHandler
BackupTestCase.assertCorrectlyRestored()
BackupTestCase.create_backup_vms()
BackupTestCase.create_full_image()
BackupTestCase.create_sparse()
BackupTestCase.fill_image()
BackupTestCase.make_vm_name()
BackupTestCase.restore_backup()
BackupTestCase.setUp()
BackupTestCase.tearDown()
BackupTestCase.vm_checksum()
- qubesadmin.tests.tools package
- Submodules
- qubesadmin.tests.tools.init module
TC_00_PropertyAction
TC_01_SinglePropertyAction
TC_01_SinglePropertyAction.test_000_help()
TC_01_SinglePropertyAction.test_001_help_const()
TC_01_SinglePropertyAction.test_100_default()
TC_01_SinglePropertyAction.test_101_set_prop()
TC_01_SinglePropertyAction.test_102_set_prop_dest()
TC_01_SinglePropertyAction.test_103_set_prop_const()
TC_01_SinglePropertyAction.test_104_set_prop_positional()
- qubesadmin.tests.tools.qubes_prefs module
- qubesadmin.tests.tools.qvm_backup module
- qubesadmin.tests.tools.qvm_backup_restore module
- qubesadmin.tests.tools.qvm_check module
- qubesadmin.tests.tools.qvm_clone module
- qubesadmin.tests.tools.qvm_create module
- qubesadmin.tests.tools.qvm_device module
TC_00_qvm_device
TC_00_qvm_device.expected_device_call()
TC_00_qvm_device.setUp()
TC_00_qvm_device.test_000_list_all()
TC_00_qvm_device.test_001_list_assigned_required()
TC_00_qvm_device.test_002_list_attach()
TC_00_qvm_device.test_003_list_device_classes()
TC_00_qvm_device.test_010_attach()
TC_00_qvm_device.test_011_attach_options()
TC_00_qvm_device.test_012_attach_invalid()
TC_00_qvm_device.test_013_attach_invalid_device()
TC_00_qvm_device.test_014_attach_invalid_backend()
TC_00_qvm_device.test_020_detach()
TC_00_qvm_device.test_021_detach_unknown()
TC_00_qvm_device.test_022_detach_all()
TC_00_qvm_device.test_030_assign()
TC_00_qvm_device.test_031_assign_required()
TC_00_qvm_device.test_032_assign_ask_and_options()
TC_00_qvm_device.test_033_assign_invalid()
TC_00_qvm_device.test_034_assign_invalid_device()
TC_00_qvm_device.test_035_assign_invalid_backend()
TC_00_qvm_device.test_036_assign_port()
TC_00_qvm_device.test_037_assign_port_asterisk()
TC_00_qvm_device.test_038_assign_device_from_port()
TC_00_qvm_device.test_039_assign_explicit_device()
TC_00_qvm_device.test_040_assign_explicit_device_device_id()
TC_00_qvm_device.test_041_assign_denied_device()
TC_00_qvm_device.test_050_unassign()
TC_00_qvm_device.test_051_unassign_unknown()
TC_00_qvm_device.test_052_unassign_port()
TC_00_qvm_device.test_053_unassign_device_from_port()
TC_00_qvm_device.test_054_unassign_explicit_device()
TC_00_qvm_device.test_055_unassign_explicit_device_port()
TC_00_qvm_device.test_056_unassign_explicit_device_id()
TC_00_qvm_device.test_057_unassign_all()
TC_00_qvm_device.test_060_device_info()
- qubesadmin.tests.tools.qvm_features module
- qubesadmin.tests.tools.qvm_firewall module
- qubesadmin.tests.tools.qvm_kill module
- qubesadmin.tests.tools.qvm_ls module
TC_00_Column
TC_100_Sort
TC_10_globals
TC_110_Filtering
TC_110_Filtering.test_111_filter_class()
TC_110_Filtering.test_112_filter_label()
TC_110_Filtering.test_113_filter_template_source()
TC_110_Filtering.test_114_filter_netvm_is()
TC_110_Filtering.test_115_internal_servicevm_pending_updates()
TC_110_Filtering.test_116_features()
TC_110_Filtering.test_117_preferences()
TC_50_List
TC_70_Tags
TC_80_Power_state_filters
TC_90_List_with_qubesd_calls
TestApp
- qubesadmin.tests.tools.qvm_pause module
- qubesadmin.tests.tools.qvm_pool module
TC_00_qvm_pool
TC_00_qvm_pool.test_000_list()
TC_00_qvm_pool.test_010_drivers()
TC_00_qvm_pool.test_020_add()
TC_00_qvm_pool.test_021_add_multiple()
TC_00_qvm_pool.test_030_remove()
TC_00_qvm_pool.test_031_remove_multiple()
TC_00_qvm_pool.test_040_info()
TC_00_qvm_pool.test_050_set()
TC_00_qvm_pool.test_051_set_invalid()
- qubesadmin.tests.tools.qvm_prefs module
TC_00_qvm_prefs
TC_00_qvm_prefs.test_000_list()
TC_00_qvm_prefs.test_001_no_vm()
TC_00_qvm_prefs.test_002_set_property()
TC_00_qvm_prefs.test_003_invalid_property()
TC_00_qvm_prefs.test_004_set_invalid_property()
TC_00_qvm_prefs.test_005_get_str()
TC_00_qvm_prefs.test_006_get_vm()
TC_00_qvm_prefs.test_007_get_vm_none()
TC_00_qvm_prefs.test_008_set_vm_prop_none()
TC_00_qvm_prefs.test_009_hide_default()
- qubesadmin.tests.tools.qvm_remove module
- qubesadmin.tests.tools.qvm_run module
- qubesadmin.tests.tools.qvm_service module
- qubesadmin.tests.tools.qvm_shutdown module
- qubesadmin.tests.tools.qvm_start module
- qubesadmin.tests.tools.qvm_start_daemon module
- qubesadmin.tests.tools.qvm_tags module
- qubesadmin.tests.tools.qvm_template_postprocess module
- qubesadmin.tests.tools.qvm_unpause module
- qubesadmin.tests.tools.qvm_volume module
TC_00_qvm_volume
TC_00_qvm_volume.setup_expected_calls_for_list()
TC_00_qvm_volume.test_000_list()
TC_00_qvm_volume.test_001_list_domain()
TC_00_qvm_volume.test_002_list_domain_pool()
TC_00_qvm_volume.test_003_list_pool()
TC_00_qvm_volume.test_004_list_multiple_domains()
TC_00_qvm_volume.test_005_list_default_action()
TC_00_qvm_volume.test_010_extend()
TC_00_qvm_volume.test_011_extend_error()
TC_00_qvm_volume.test_012_extend_deny_shrink()
TC_00_qvm_volume.test_013_resize_force_shrink()
TC_00_qvm_volume.test_020_revert()
TC_00_qvm_volume.test_021_revert_error()
TC_00_qvm_volume.test_022_revert_no_snapshots()
TC_00_qvm_volume.test_023_revert_specific()
TC_00_qvm_volume.test_030_set_revisions_to_keep()
TC_00_qvm_volume.test_031_set_rw()
TC_00_qvm_volume.test_032_set_invalid()
TC_00_qvm_volume.test_033_set_ephemeral()
TC_00_qvm_volume.test_040_info()
TC_00_qvm_volume.test_041_info_no_revisions()
TC_00_qvm_volume.test_042_info_single_prop()
TC_00_qvm_volume.test_043_info_revisions_only()
TC_00_qvm_volume.test_044_info_no_ephemeral()
TC_00_qvm_volume.test_050_import_file()
TC_00_qvm_volume.test_051_import_stdin()
TC_00_qvm_volume.test_052_import_file_size()
TC_00_qvm_volume.test_053_import_file_matching_size()
TC_00_qvm_volume.test_053_import_file_noresize()
- Module contents
- qubesadmin.tests.vm package
- Submodules
- qubesadmin.tests.vm.actions module
TC_00_Actions
TC_00_Actions.test_000_start()
TC_00_Actions.test_001_shutdown()
TC_00_Actions.test_002_kill()
TC_00_Actions.test_003_pause()
TC_00_Actions.test_004_unpause()
TC_00_Actions.test_005_suspend()
TC_00_Actions.test_006_resume()
TC_00_Actions.test_010_run_linux()
TC_00_Actions.test_011_run_windows()
TC_00_Actions.test_015_run_with_args_shell()
TC_00_Actions.test_016_run_with_args_exec()
- qubesadmin.tests.vm.dispvm module
- qubesadmin.tests.vm.properties module
TC_00_Properties
TC_00_Properties.test_000_list()
TC_00_Properties.test_001_get_str()
TC_00_Properties.test_002_get_int()
TC_00_Properties.test_003_get_bool()
TC_00_Properties.test_004_get_vm()
TC_00_Properties.test_005_get_none_vm()
TC_00_Properties.test_006_get_none_bool()
TC_00_Properties.test_007_get_none_int()
TC_00_Properties.test_008_get_none_str()
TC_00_Properties.test_010_get_default()
TC_00_Properties.test_011_get_default()
TC_00_Properties.test_012_get_invalid()
TC_00_Properties.test_020_set_str()
TC_00_Properties.test_021_set_int()
TC_00_Properties.test_022_set_bool()
TC_00_Properties.test_023_set_vm()
TC_00_Properties.test_024_set_none()
TC_00_Properties.test_030_reset()
TC_00_Properties.test_031_reset()
TC_00_Properties.test_040_get_default()
TC_00_Properties.test_041_get_default_int()
TC_00_Properties.test_042_get_default_none()
TC_00_Properties.test_050_get_all()
TC_00_Properties.test_051_get_all_fallback()
TC_01_SpecialCases
TC_01_SpecialCases.test_000_get_name()
TC_01_SpecialCases.test_001_set_name()
TC_01_SpecialCases.test_010_power_state_running()
TC_01_SpecialCases.test_011_power_state_paused()
TC_01_SpecialCases.test_012_power_state_halted()
TC_01_SpecialCases.test_012_power_state_transient()
TC_01_SpecialCases.test_015_mem()
- qubesadmin.tests.vm.storage module
- Module contents
- qubesadmin.tests.backup package
- Submodules
- qubesadmin.tests.app module
TC_00_VMCollection
TC_00_VMCollection.test_000_list()
TC_00_VMCollection.test_001_getitem()
TC_00_VMCollection.test_002_in()
TC_00_VMCollection.test_003_iter()
TC_00_VMCollection.test_004_delitem()
TC_00_VMCollection.test_005_keys()
TC_00_VMCollection.test_006_values()
TC_00_VMCollection.test_007_getitem_blind_mode()
TC_00_VMCollection.test_008_in_blind_mode()
TC_00_VMCollection.test_009_getitem_cache_class()
TC_00_VMCollection.test_010_getitem_cache_power_state()
TC_00_VMCollection.test_011_getitem_non_cache_power_state()
TC_00_VMCollection.test_012_getitem_cached_object()
TC_10_QubesBase
TC_10_QubesBase.clone_setup_common_calls()
TC_10_QubesBase.setUp()
TC_10_QubesBase.tearDown()
TC_10_QubesBase.test_010_new_simple()
TC_10_QubesBase.test_011_new_template()
TC_10_QubesBase.test_012_new_template_based()
TC_10_QubesBase.test_013_new_objects_params()
TC_10_QubesBase.test_014_new_pool()
TC_10_QubesBase.test_015_new_pools()
TC_10_QubesBase.test_016_new_template_based_default()
TC_10_QubesBase.test_020_get_label()
TC_10_QubesBase.test_021_get_nonexistant_label()
TC_10_QubesBase.test_030_clone()
TC_10_QubesBase.test_031_clone_object()
TC_10_QubesBase.test_032_clone_pool()
TC_10_QubesBase.test_033_clone_pools()
TC_10_QubesBase.test_034_clone_class_change()
TC_10_QubesBase.test_035_clone_fail()
TC_10_QubesBase.test_036_clone_ignore_errors_prop()
TC_10_QubesBase.test_037_clone_ignore_errors_feature()
TC_10_QubesBase.test_038_clone_ignore_errors_tag()
TC_10_QubesBase.test_039_clone_ignore_errors_firewall()
TC_10_QubesBase.test_040_clone_ignore_errors_storage()
TC_10_QubesBase.test_041_clone_fail_storage()
TC_10_QubesBase.test_042_clone_nondefault_pool()
TC_10_QubesBase.test_043_clone_devices()
TC_10_QubesBase.test_044_clone_devices_fail()
TC_10_QubesBase.test_050_automatic_reset_cache()
TC_10_QubesBase.test_051_space_in_vmname()
TC_20_QubesLocal
TC_20_QubesLocal.get_request()
TC_20_QubesLocal.listen_and_send()
TC_20_QubesLocal.setUp()
TC_20_QubesLocal.tearDown()
TC_20_QubesLocal.test_000_qubesd_call()
TC_20_QubesLocal.test_001_qubesd_call_none_arg()
TC_20_QubesLocal.test_002_qubesd_call_none_payload()
TC_20_QubesLocal.test_003_qubesd_call_payload_stream()
TC_20_QubesLocal.test_004_qubesd_call_payload_stream_proc()
TC_20_QubesLocal.test_005_qubesd_call_payload_stream_with_prefix()
TC_20_QubesLocal.test_010_run_service()
TC_20_QubesLocal.test_011_run_service_filter_esc()
TC_20_QubesLocal.test_012_run_service_user()
TC_20_QubesLocal.test_013_run_service_default_target()
TC_30_QubesRemote
TC_30_QubesRemote.setUp()
TC_30_QubesRemote.set_proc_stdout()
TC_30_QubesRemote.tearDown()
TC_30_QubesRemote.test_000_qubesd_call()
TC_30_QubesRemote.test_001_qubesd_call_none_arg()
TC_30_QubesRemote.test_002_qubesd_call_none_payload()
TC_30_QubesRemote.test_003_qubesd_call_payload_stream()
TC_30_QubesRemote.test_004_qubesd_call_payload_stream_with_prefix()
TC_30_QubesRemote.test_010_run_service()
TC_30_QubesRemote.test_011_run_service_filter_esc()
TC_30_QubesRemote.test_012_run_service_user()
TC_30_QubesRemote.test_013_run_service_default_target()
TC_30_QubesRemote.test_014_run_service_no_autostart1()
TC_30_QubesRemote.test_015_run_service_no_autostart2()
- qubesadmin.tests.devices module
TC_00_DeviceCollection
TC_00_DeviceCollection.setUp()
TC_00_DeviceCollection.test_000_available()
TC_00_DeviceCollection.test_001_available_desc()
TC_00_DeviceCollection.test_002_available_options()
TC_00_DeviceCollection.test_010_getitem()
TC_00_DeviceCollection.test_011_getitem_missing()
TC_00_DeviceCollection.test_020_attach()
TC_00_DeviceCollection.test_021_attach_options()
TC_00_DeviceCollection.test_022_attach_required()
TC_00_DeviceCollection.test_023_attach_required_options()
TC_00_DeviceCollection.test_030_detach()
TC_00_DeviceCollection.test_040_dedicated()
TC_00_DeviceCollection.test_041_assignments_options()
TC_00_DeviceCollection.test_050_required()
TC_00_DeviceCollection.test_060_attached()
TC_00_DeviceCollection.test_070_update_assignment_required()
TC_00_DeviceCollection.test_071_update_assignment_ask()
TC_00_DeviceCollection.test_072_update_assignment_auto()
TC_00_DeviceCollection.test_073_list()
- qubesadmin.tests.errors module
- qubesadmin.tests.events module
TC_00_Events
TC_00_Events.mock_coroutine()
TC_00_Events.mock_get_events_reader()
TC_00_Events.mock_open_unix_connection()
TC_00_Events.read_all()
TC_00_Events.send_events()
TC_00_Events.setUp()
TC_00_Events.test_000_handler_specific()
TC_00_Events.test_001_handler_glob()
TC_00_Events.test_002_handler_glob_partial()
TC_00_Events.test_003_handler_error()
TC_00_Events.test_010_listen_for_events()
TC_00_Events.test_020_get_events_reader_local()
TC_00_Events.test_021_get_events_reader_local_vm()
TC_00_Events.test_022_get_events_reader_remote()
TC_00_Events.test_023_get_events_reader_remote_vm()
TC_00_Events.test_030_events_device()
- qubesadmin.tests.features module
- qubesadmin.tests.firewall module
TC_00_RuleChoice
TC_01_Action
TC_02_DstHost
TC_02_DstHost.test_000_hostname()
TC_02_DstHost.test_001_ipv4()
TC_02_DstHost.test_002_ipv4_prefixlen()
TC_02_DstHost.test_003_ipv4_parse_prefixlen()
TC_02_DstHost.test_004_ipv4_invalid_prefix()
TC_02_DstHost.test_005_ipv4_reject_shortened()
TC_02_DstHost.test_006_ipv4_invalid_addr()
TC_02_DstHost.test_007_ipv4_invalid_network()
TC_02_DstHost.test_010_ipv6()
TC_02_DstHost.test_011_ipv6_prefixlen()
TC_02_DstHost.test_012_ipv6_parse_prefixlen()
TC_02_DstHost.test_013_ipv6_invalid_prefix()
TC_02_DstHost.test_014_ipv6_invalid_addr()
TC_02_DstHost.test_015_ipv6_invalid_network()
TC_02_DstHost.test_020_invalid_hostname()
TC_02_Proto
TC_03_DstPorts
TC_04_IcmpType
TC_05_SpecialTarget
TC_06_Expire
TC_07_Comment
TC_10_Rule
TC_11_Firewall
TestOption
- qubesadmin.tests.label module
- qubesadmin.tests.storage module
TestPool
TestPoolVolume
TestPoolVolume.expect_info()
TestPoolVolume.setUp()
TestPoolVolume.test_000_qubesd_call()
TestPoolVolume.test_001_fetch_info()
TestPoolVolume.test_010_pool()
TestPoolVolume.test_011_vid()
TestPoolVolume.test_021_revisions()
TestPoolVolume.test_022_revisions_empty()
TestPoolVolume.test_030_resize()
TestPoolVolume.test_031_revert()
TestPoolVolume.test_040_import_data()
TestPoolVolume.test_050_clone()
TestPoolVolume.test_050_clone_wrong_volume()
TestVMVolume
TestVMVolume.expect_info()
TestVMVolume.setUp()
TestVMVolume.test_000_qubesd_call()
TestVMVolume.test_001_fetch_info()
TestVMVolume.test_010_pool()
TestVMVolume.test_011_vid()
TestVMVolume.test_012_size()
TestVMVolume.test_013_usage()
TestVMVolume.test_014_rw()
TestVMVolume.test_015_snap_on_start()
TestVMVolume.test_016_save_on_stop()
TestVMVolume.test_017_source_none()
TestVMVolume.test_018_source()
TestVMVolume.test_020_revisions_to_keep()
TestVMVolume.test_021_revisions()
TestVMVolume.test_022_revisions_empty()
TestVMVolume.test_030_resize()
TestVMVolume.test_031_revert()
TestVMVolume.test_040_import_data()
TestVMVolume.test_050_clone()
- qubesadmin.tests.tags module
TC_00_Tags
TC_00_Tags.setUp()
TC_00_Tags.test_000_list()
TC_00_Tags.test_010_get()
TC_00_Tags.test_011_get_missing()
TC_00_Tags.test_020_set()
TC_00_Tags.test_030_update()
TC_00_Tags.test_031_update_from_other()
TC_00_Tags.test_040_remove()
TC_00_Tags.test_040_remove_missing()
TC_00_Tags.test_050_discard()
TC_00_Tags.test_051_discard_missing()
- Module contents
- Subpackages
- qubesadmin.tools package
- Submodules
- qubesadmin.tools.dochelpers module
- qubesadmin.tools.qubes_prefs module
- qubesadmin.tools.qvm_backup module
- qubesadmin.tools.qvm_backup_restore module
- qubesadmin.tools.qvm_check module
- qubesadmin.tools.qvm_clone module
- qubesadmin.tools.qvm_create module
- qubesadmin.tools.qvm_device module
- qubesadmin.tools.qvm_features module
- qubesadmin.tools.qvm_firewall module
- qubesadmin.tools.qvm_kill module
- qubesadmin.tools.qvm_ls module
- qubesadmin.tools.qvm_pause module
- qubesadmin.tools.qvm_pool module
- qubesadmin.tools.qvm_prefs module
- qubesadmin.tools.qvm_remove module
- qubesadmin.tools.qvm_run module
- qubesadmin.tools.qvm_service module
- qubesadmin.tools.qvm_shutdown module
- qubesadmin.tools.qvm_start module
- qubesadmin.tools.qvm_start_daemon module
- qubesadmin.tools.qvm_tags module
- qubesadmin.tools.qvm_template module
- qubesadmin.tools.qvm_template_postprocess module
- qubesadmin.tools.qvm_unpause module
- qubesadmin.tools.qvm_volume module
- Module contents
- qubesadmin.vm package
- Module contents
DispVM
DispVMWrapper
QubesVM
QubesVM.appvms
QubesVM.connected_vms
QubesVM.derived_vms
QubesVM.devices
QubesVM.features
QubesVM.firewall
QubesVM.force_shutdown()
QubesVM.get_disk_utilization()
QubesVM.get_mem()
QubesVM.get_power_state()
QubesVM.is_halted()
QubesVM.is_networked()
QubesVM.is_paused()
QubesVM.is_running()
QubesVM.kill()
QubesVM.klass
QubesVM.log
QubesVM.name
QubesVM.pause()
QubesVM.prepare_input_for_vmshell()
QubesVM.run()
QubesVM.run_service()
QubesVM.run_service_for_stdio()
QubesVM.run_with_args()
QubesVM.shutdown()
QubesVM.start()
QubesVM.tags
QubesVM.unpause()
QubesVM.volumes
- Module contents
Submodules¶
qubesadmin.app module¶
Main Qubes() class and related classes.
- class qubesadmin.app.QubesBase[source]¶
Bases:
PropertyHolder
Main Qubes application.
This is a base abstract class, don’t use it directly. Use specialized class in py:class:qubesadmin.Qubes instead, which points at
QubesLocal
orQubesRemote
.- add_new_vm(cls, name, label, template=None, pool=None, pools=None)[source]¶
Create new Virtual Machine
Example usage with custom storage pools:
>>> app = qubesadmin.Qubes() >>> pools = {'private': 'external'} >>> vm = app.add_new_vm('AppVM', 'my-new-vm', 'red', >>> 'my-template', pools=pools) >>> vm.netvm = app.domains['sys-whonix']
- Parameters:
cls (str) – name of VM class (AppVM, TemplateVM etc)
name (str) – name of VM
label (str) – label color for new VM
template (str) – template to use (if apply for given VM class), can be also VM object; use None for default value
pool (str) – storage pool to use instead of default one
pools (dict) – storage pool for specific volumes
:return new VM object
- add_pool(name, driver, **kwargs)[source]¶
Add a storage pool to config
- Parameters:
name – name of storage pool to create
driver – driver to use, see
pool_drivers()
for available driverskwargs – configuration parameters for storage pool, see
pool_driver_parameters()
for a list
- blind_mode = False¶
do not check for object (VM, label etc) existence before really needed
- cache_enabled = False¶
cache retrieved properties values
- clone_vm(src_vm, new_name, new_cls=None, *, pool=None, pools=None, ignore_errors=False, ignore_volumes=None, ignore_devices=False)[source]¶
Clone Virtual Machine
Example usage with custom storage pools:
>>> app = qubesadmin.Qubes() >>> pools = {'private': 'external'} >>> src_vm = app.domains['personal'] >>> vm = app.clone_vm(src_vm, 'my-new-vm', pools=pools) >>> vm.label = app.labels['green']
- Parameters:
src_vm (QubesVM or str) – source VM
new_name (str) – name of new VM
new_cls (str) – name of VM class (AppVM, TemplateVM etc) - use None to copy it from src_vm
pool (str) – storage pool to use instead of default one
pools (dict) – storage pool for specific volumes
ignore_errors (bool) – should errors on meta-data setting be only logged, or abort the whole operation?
ignore_volumes (list) – do not clone volumes on this list, like ‘private’ or ‘root’
ignore_devices (bool) – if True, do not copy device assignments
:return new VM object
- domains = None¶
domains (VMs) collection
- get_label(label)[source]¶
Get label as identified by index or name
- Throws QubesLabelNotFoundError:
when label is not found
- static get_vm_class(clsname)[source]¶
Find the class for a domain.
Compatibility function, client tools use str to identify domain classes.
- Parameters:
clsname (str) – name of the class
- Return str:
class
- labels = None¶
labels collection
- property local_name¶
Get localhost name
- log = None¶
logger
- property pool_drivers¶
Available storage pool drivers
- pools = None¶
storage pools
- qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]¶
Execute Admin API method.
If payload and payload_stream are both specified, they will be sent in that order.
- Parameters:
dest – Destination VM name
method – Full API method name (‘admin…’)
arg – Method argument (if any)
payload – Payload send to the method
payload_stream – file-like object to read payload from
- Returns:
Data returned by qubesd (string)
Warning
payload_stream will get closed by this function
- qubesd_connection_type = None¶
type of qubesd connection: either ‘socket’ or ‘qrexec’
- run_service(dest, service, user=None, *, filter_esc=False, localcmd=None, wait=True, autostart=True, **kwargs)[source]¶
Run qrexec service in a given destination
kwargs are passed verbatim to
subprocess.Popen()
.- Parameters:
dest (str) – Destination - may be a VM name or empty string for default (for a given service)
service (str) – service name
filter_esc (bool) – filter escape sequences to protect terminal emulator
user (str) – username to run service as
localcmd (str) – Command to connect stdin/stdout to
wait (bool) – Wait service run
autostart (bool) – Automatically start the target VM
- Return type:
subprocess.Popen
- class qubesadmin.app.QubesLocal[source]¶
Bases:
QubesBase
Application object communicating through local socket.
Used when running in dom0.
- qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]¶
Execute Admin API method.
If payload and payload_stream are both specified, they will be sent in that order.
- Parameters:
dest – Destination VM name
method – Full API method name (‘admin…’)
arg – Method argument (if any)
payload – Payload send to the method
payload_stream – file-like object to read payload from
- Returns:
Data returned by qubesd (string)
Warning
payload_stream will get closed by this function
- qubesd_connection_type = 'socket'¶
type of qubesd connection: either ‘socket’ or ‘qrexec’
- run_service(dest, service, user=None, *, filter_esc=False, localcmd=None, wait=True, autostart=True, **kwargs)[source]¶
Run qrexec service in a given destination
- Parameters:
dest (str) – Destination - may be a VM name or empty string for default (for a given service)
service (str) – service name
filter_esc (bool) – filter escape sequences to protect terminal emulator
user (str) – username to run service as
localcmd (str) – Command to connect stdin/stdout to
wait (bool) – wait for remote process to finish
- Return type:
subprocess.Popen
- class qubesadmin.app.QubesRemote[source]¶
Bases:
QubesBase
Application object communicating through qrexec services.
Used when running in VM.
- qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]¶
Execute Admin API method.
If payload and payload_stream are both specified, they will be sent in that order.
- Parameters:
dest – Destination VM name
method – Full API method name (‘admin…’)
arg – Method argument (if any)
payload – Payload send to the method
payload_stream – file-like object to read payload from
- Returns:
Data returned by qubesd (string)
Warning
payload_stream will get closed by this function
- qubesd_connection_type = 'qrexec'¶
type of qubesd connection: either ‘socket’ or ‘qrexec’
- run_service(dest, service, user=None, *, filter_esc=False, localcmd=None, wait=True, autostart=True, **kwargs)[source]¶
Run qrexec service in a given destination
- Parameters:
dest (str) – Destination - may be a VM name or empty string for default (for a given service)
service (str) – service name
filter_esc (bool) – filter escape sequences to protect terminal emulator
user (str) – username to run service as
localcmd (str) – Command to connect stdin/stdout to
wait (bool) – wait for process to finish
- Return type:
subprocess.Popen
qubesadmin.base module¶
Base classes for managed objects
- class qubesadmin.base.PropertyHolder(app, method_prefix, method_dest)[source]¶
Bases:
object
A base class for object having properties retrievable using mgmt API.
Warning: each (non-private) local attribute needs to be defined at class level, even if initialized in __init__; otherwise will be treated as property retrievable using mgmt call.
- app = None¶
- clone_properties(src, proplist=None)[source]¶
Clone properties from other object.
- Parameters:
src (PropertyHolder) – source object
proplist (list) – list of properties (
None
or omit for all properties)
- property_get_default(item)[source]¶
Get default property value, regardless of the current value
- Parameters:
item (str) – name of property
- Returns:
default value
- property_is_default(item)[source]¶
Check if given property have default value
- Parameters:
item (str) – name of property
- Returns:
bool
- qubesd_call(dest, method, arg=None, payload=None, payload_stream=None)[source]¶
Call into qubesd using appropriate mechanism. This method should be defined by a subclass.
Only one of payload and payload_stream can be specified.
- Parameters:
dest – Destination VM name
method – Full API method name (‘admin…’)
arg – Method argument (if any)
payload – Payload send to the method
payload_stream – file-like object to read payload from
- Returns:
Data returned by qubesd (string)
qubesadmin.config module¶
Configuration variables/constants
- qubesadmin.config.QUBESD_SOCKET = '/var/run/qubesd.sock'¶
path to qubesd socket
qubesadmin.devices module¶
API for various types of devices.
Main concept is that some domain main expose (potentially multiple) devices, which can be attached to other domains. Devices can be of different classes (like ‘pci’, ‘usb’, etc.). Each device class is implemented by an extension.
Devices are identified by pair of (backend domain, port_id), where port_id
is str
.
- class qubesadmin.devices.DeviceCollection(vm, class_)[source]¶
Bases:
object
Bag for devices.
Used as default value for
DeviceManager.__missing__()
factory.- Parameters:
vm – VM for which we manage devices
class – device class
- assign(assignment: DeviceAssignment) None [source]¶
Assign device to domain (add to
qubes.xml
).- Parameters:
assignment (DeviceAssignment) – device object
- attach(assignment: DeviceAssignment) None [source]¶
Attach (add) device to domain.
- Parameters:
assignment (DeviceAssignment) – device object
- detach(assignment: DeviceAssignment) None [source]¶
Detach (remove) device from domain.
- Parameters:
assignment (DeviceAssignment) – device to detach (obtained from
assignments()
)
- get_assigned_devices(required_only: bool = False) Iterable[DeviceAssignment] [source]¶
Devices assigned to this vm (included in
qubes.xml
).Safe to access before libvirt bootstrap.
- get_attached_devices() Iterable[DeviceAssignment] [source]¶
List devices which are attached to this vm.
- get_dedicated_devices() Iterable[DeviceAssignment] [source]¶
List devices which are attached or assigned to this vm.
- unassign(assignment: DeviceAssignment) None [source]¶
Unassign device from domain (remove from
qubes.xml
).- Parameters:
assignment (DeviceAssignment) – device to unassign (obtained from
assignments()
)
- update_assignment(device: Port, required: AssignmentMode)[source]¶
Update assignment of already attached device.
- Parameters:
device (VirtualDevice) – device for which change required flag
required (bool) – new assignment: None -> unassign device from qube False -> device will be auto-attached to qube True -> device is required to start qube
qubesadmin.exc module¶
Exception hierarchy.
- exception qubesadmin.exc.BackupAlreadyRunningError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
Thrown at user when they try to run the same backup twice at the same time
- exception qubesadmin.exc.BackupCancelledError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
Thrown at user when backup was manually cancelled
- exception qubesadmin.exc.BackupRestoreError(msg, backup_log=None)[source]¶
Bases:
QubesException
Restoring a backup failed
- exception qubesadmin.exc.DeviceAlreadyAttached(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,KeyError
Trying to attach already attached device
- exception qubesadmin.exc.QubesDaemonAccessError(message_format, *args, **kwargs)[source]¶
Bases:
QubesDaemonCommunicationError
Got empty response from qubesd. This can be lack of permission, or some server-side issue.
- exception qubesadmin.exc.QubesDaemonCommunicationError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
Error while communicating with qubesd, may mean insufficient permissions as well
- qubesadmin.exc.QubesDaemonNoResponseError¶
alias of
QubesDaemonAccessError
- exception qubesadmin.exc.QubesException(message_format, *args, **kwargs)[source]¶
Bases:
Exception
Base exception for all Qubes-related errors.
- exception qubesadmin.exc.QubesFeatureNotFoundError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,KeyError
Feature not set for a given domain
- exception qubesadmin.exc.QubesLabelNotFoundError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,KeyError
Label does not exists
- exception qubesadmin.exc.QubesMemoryError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,MemoryError
Cannot start domain, because not enough memory is available
- exception qubesadmin.exc.QubesNoSuchPropertyError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,AttributeError
Requested property does not exist
- exception qubesadmin.exc.QubesNoTemplateError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
Cannot start domain, because there is no template
- exception qubesadmin.exc.QubesNotImplementedError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,NotImplementedError
Thrown at user when some feature is not implemented
- exception qubesadmin.exc.QubesPropertyAccessError(prop)[source]¶
Bases:
QubesDaemonAccessError
,AttributeError
Failed to read/write property value, cause is unknown (insufficient permissions, no such property, invalid value, other)
- exception qubesadmin.exc.QubesPropertyValueError(message_format, *args, **kwargs)[source]¶
Bases:
QubesValueError
Cannot set value of qubes.property, because user-supplied value is wrong.
- exception qubesadmin.exc.QubesTagNotFoundError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,KeyError
Tag not set for a given domain
- exception qubesadmin.exc.QubesVMError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
Some problem with domain state.
- exception qubesadmin.exc.QubesVMInUseError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
VM is in use, cannot remove.
- exception qubesadmin.exc.QubesVMNotFoundError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,KeyError
Domain cannot be found in the system
- exception qubesadmin.exc.QubesVMNotHaltedError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
Domain is not halted.
This exception is thrown when machine should be halted, but is not (either running or paused).
- exception qubesadmin.exc.QubesVMNotPausedError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMNotStartedError
Domain is not paused.
This exception is thrown when machine should be paused, but is not.
- exception qubesadmin.exc.QubesVMNotRunningError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMNotStartedError
Domain is not running.
This exception is thrown when machine should be running but is either halted or paused.
- exception qubesadmin.exc.QubesVMNotStartedError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
Domain is not started.
This exception is thrown when machine is halted, but should be started (that is, either running or paused).
- exception qubesadmin.exc.QubesVMNotSuspendedError(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
Domain is not suspended.
This exception is thrown when machine should be suspended but is either halted or running.
- exception qubesadmin.exc.QubesVMShutdownTimeout(message_format, *args, **kwargs)[source]¶
Bases:
QubesVMError
Domain shutdown haven’t completed in expected timeframe
- exception qubesadmin.exc.QubesValueError(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
,ValueError
Cannot set some value, because it is invalid, out of bounds, etc.
- exception qubesadmin.exc.StoragePoolException(message_format, *args, **kwargs)[source]¶
Bases:
QubesException
A general storage exception
qubesadmin.features module¶
VM features interface
- class qubesadmin.features.Features(vm)[source]¶
Bases:
object
Manager of the features.
Features can have three distinct values: no value (not present in mapping, which is closest thing to
None
), empty string (which is interpreted asFalse
) and non-empty string, which isTrue
. Anything assigned to the mapping is coerced to strings, however if you assign instances ofbool
, they are converted as described above. Be aware that assigning the number 0 (which is considered false in Python) will result in string ‘0’, which is considered true.- NO_DEFAULT = <object object>¶
- check_with_template(feature, default=None)[source]¶
Check if the vm’s template has the specified feature.
- keys()¶
qubesadmin.firewall module¶
Firewall configuration interface
- class qubesadmin.firewall.Action(value)[source]¶
Bases:
RuleChoice
Rule action
- accept = 'accept'¶
- drop = 'drop'¶
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.Comment(value)[source]¶
Bases:
RuleOption
User comment
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.DstHost(value, prefixlen=None)[source]¶
Bases:
RuleOption
Represent host/network address: either IPv4, IPv6, or DNS name
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.DstPorts(value)[source]¶
Bases:
RuleOption
Destination port(s), for TCP/UDP only
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.Expire(value)[source]¶
Bases:
RuleOption
Rule expire time
- property expired¶
Has this rule expired already?
- property pretty_value¶
Human readable representation
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.Firewall(vm)[source]¶
Bases:
object
Firewal manager for a VM
- property policy¶
Default action to take if no rule matches
- reload()[source]¶
Force reload the same firewall rules.
Can be used for example to force again names resolution.
- property rules¶
Firewall rules
You can either copy them, edit and then assign new rules list to this property, or edit in-place and call
save_rules()
. Once rules are loaded, they are cached. To reload rules, callload_rules()
.
- class qubesadmin.firewall.IcmpType(value)[source]¶
Bases:
RuleOption
ICMP packet type
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.Proto(value)[source]¶
Bases:
RuleChoice
Protocol name
- icmp = 'icmp'¶
- property rule¶
API representation of this rule element
- tcp = 'tcp'¶
- udp = 'udp'¶
- class qubesadmin.firewall.Rule(rule, **kwargs)[source]¶
Bases:
object
A single firewall rule
- property action¶
rule action
- property comment¶
User comment
- property dsthost¶
destination host/network
- property dstports¶
‘Destination port(s) (for ‘tcp’ and ‘udp’ protocol only)
- property expire¶
Timestamp (UNIX epoch) on which this rule expire
- property icmptype¶
ICMP packet type (for ‘icmp’ protocol only)
- property proto¶
protocol to match
- property rule¶
API representation of this rule
- property specialtarget¶
Special target, for now only ‘dns’ supported
- class qubesadmin.firewall.RuleChoice(value)[source]¶
Bases:
RuleOption
Base class for multiple-choices rule elements
- class qubesadmin.firewall.RuleOption(value)[source]¶
Bases:
object
Base class for a single rule element
- property pretty_value¶
Human readable representation
- property rule¶
API representation of this rule element
- class qubesadmin.firewall.SpecialTarget(value)[source]¶
Bases:
RuleChoice
Special destination
- dns = 'dns'¶
- property rule¶
API representation of this rule element
qubesadmin.label module¶
VM Labels
- class qubesadmin.label.Label(app, name)[source]¶
Bases:
object
Label definition for virtual machines
Label specifies colour of the padlock displayed next to VM’s name.
- Parameters:
color (str) – colour specification as in HTML (
#abcdef
)name (str) – label’s name like “red” or “green”
- property color¶
color specification as in HTML (
#abcdef
)
- property icon¶
freedesktop icon name, suitable for use in
PyQt4.QtGui.QIcon.fromTheme()
- property index¶
label numeric identifier
- property name¶
label’s name like “red” or “green”
qubesadmin.log module¶
Qubes logging routines
See also: qubes.vm.qubesvm.QubesVM.log
qubesadmin.spinner module¶
Qubes CLI spinner
A novice asked the master: “In the east there is a great tree-structure that men call ‘Corporate Headquarters’. It is bloated out of shape with vice presidents and accountants. It issues a multitude of memos, each saying ‘Go, Hence!’ or ‘Go, Hither!’ and nobody knows what is meant. Every year new names are put onto the branches, but all to no avail. How can such an unnatural entity be?”
The master replied: “You perceive this immense structure and are disturbed that it has no rational purpose. Can you not take amusement from its endless gyrations? Do you not enjoy the untroubled ease of programming beneath its sheltering branches? Why are you bothered by its uselessness?”
(Geoffrey James, “The Tao of Programming”, 7.1)
- class qubesadmin.spinner.AbstractSpinner(stream, charset='-\\|/')[source]¶
Bases:
object
The base class for all Spinners
- Parameters:
stream – file-like object with
.write()
methodcharset (str) – the sequence of characters to display
- The spinner should be used as follows:
- class qubesadmin.spinner.DummySpinner(stream, charset='-\\|/')[source]¶
Bases:
AbstractSpinner
Dummy spinner, does not do anything
- class qubesadmin.spinner.QubesSpinner(*args, **kwargs)[source]¶
Bases:
AbstractSpinner
Basic spinner
This spinner uses standard ASCII control characters
- class qubesadmin.spinner.QubesSpinnerEnterpriseEdition(stream, charset=None)[source]¶
Bases:
QubesSpinner
Enterprise spinner
This is tty- and terminfo-aware spinner. Recommended.
qubesadmin.storage module¶
Storage subsystem.
- class qubesadmin.storage.Pool(app, name=None)[source]¶
Bases:
object
A Pool is used to manage different kind of volumes (File based/LVM/Btrfs/…).
- property config¶
Storage pool config
- property driver¶
Storage pool driver
- property ephemeral_volatile¶
Whether volatile volumes in this pool should be encrypted with an ephemeral key in dom0
- property revisions_to_keep¶
Number of revisions to keep around
- property size¶
Storage pool size, in bytes
- property usage¶
Space used in the pool, in bytes
- property usage_details¶
Storage pool usage details (current - not cached)
- property volumes¶
Volumes managed by this pool
- class qubesadmin.storage.Volume(app, pool=None, vid=None, vm=None, vm_name=None)[source]¶
Bases:
object
Storage volume.
- clone(source)[source]¶
Clone data from sane volume of another VM.
This function override existing volume content. This operation is implemented for VM volumes - those in vm.volumes collection (not pool.volumes).
- Parameters:
source – source volume object
- property ephemeral¶
True if volume is read-write.
- import_data(stream)[source]¶
Import volume data from a given file-like object.
This function overrides existing volume content.
- Parameters:
stream – file-like object, must support fileno()
- import_data_with_size(stream, size)[source]¶
Import volume data from a given file-like object, informing qubesd that data has a specific size.
This function overrides existing volume content.
- Parameters:
stream – file-like object, must support fileno()
size – size of data in bytes
- is_outdated()[source]¶
Returns True if this snapshot of a source volume (for `snap_on_start`=True) is outdated.
- property name¶
per-VM volume name, if available
- property pool¶
Storage volume pool name.
- resize(size)[source]¶
Resize volume.
Currently only extending is supported.
- Parameters:
size (int) – new size in bytes.
- revert(revision)[source]¶
Revert volume to previous revision
- Parameters:
revision (str) – Revision identifier to revert to
- property revisions¶
Returns iterable containing revision identifiers
- property revisions_to_keep¶
Number of revisions to keep around
- property rw¶
True if volume is read-write.
- property save_on_stop¶
Commit changes to original volume on VM stop.
- property size¶
Size of volume, in bytes.
- property snap_on_start¶
Create a snapshot from source on VM start.
- property source¶
Volume ID of source volume (for
snap_on_start
).If None, this volume itself will be used.
- property usage¶
Used volume space, in bytes.
- property vid¶
Storage volume id, unique within given pool.
qubesadmin.utils module¶
Various utility functions.
- class qubesadmin.utils.LockFile(path, nonblock=False)[source]¶
Bases:
object
Simple locking context manager. It opens a file with an advisory lock taken (fcntl.lockf)
- qubesadmin.utils.get_entry_point_one(group, name)[source]¶
Get a single entry point of given type, raise TypeError when there are multiple.
Module contents¶
Qubes OS management client.