salt.modules.vboxmanage module

Support for VirtualBox using the VBoxManage command

2016.3.0 新版功能.

If the vboxdrv kernel module is not loaded, this module can automatically load it by configuring autoload_vboxdrv in /etc/salt/minion:

The default for this setting is False.

salt.modules.vboxmanage.clonemedium(medium, uuid_in=None, file_in=None, uuid_out=None, file_out=None, mformat=None, variant=None, existing=False, **kwargs)

Clone a new VM from an existing VM

CLI Example:

salt 'hypervisor' vboxmanage.clonemedium <name> <new_name>
salt.modules.vboxmanage.clonevm(name=None, uuid=None, new_name=None, snapshot_uuid=None, snapshot_name=None, mode='machine', options=None, basefolder=None, new_uuid=None, register=False, groups=None, **kwargs)

Clone a new VM from an existing VM

CLI Example:

salt 'hypervisor' vboxmanage.clonevm <name> <new_name>
salt.modules.vboxmanage.create(name, groups=None, ostype=None, register=True, basefolder=None, new_uuid=None, **kwargs)

Create a new VM

CLI Example:

salt 'hypervisor' vboxmanage.create <name>

Unregister and destroy a VM

salt.modules.vboxmanage.list_items(item, details=False, group_by='UUID')

Return a list of a specific type of item. The following items are available:

vms runningvms ostypes hostdvds hostfloppies intnets bridgedifs hostonlyifs natnets dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks groups webcams screenshotformats

CLI Example:

salt 'hypervisor' vboxmanage.items <item>
salt 'hypervisor' vboxmanage.items <item> details=True
salt 'hypervisor' vboxmanage.items <item> details=True group_by=Name

Some items do not display well, or at all, unless details is set to True. By default, items are grouped by the UUID field, but not all items contain that field. In those cases, another field must be specified.


Return a list of registered VMs


Return a list of registered VMs, with detailed information


Return a list of registered VMs, with minimal information


List the available OS Types


Register a VM


Start a VM


Stop a VM

salt.modules.vboxmanage.unregister(name, delete=False)

Unregister a VM


Return the location of the VBoxManage command