salt.modules.vbox_guest

VirtualBox Guest Additions installer

salt.modules.vbox_guest.additions_install(**kwargs)

Install VirtualBox Guest Additions. Uses the CD, connected by VirtualBox.

To connect VirtualBox Guest Additions via VirtualBox graphical interface press 'Host+D' ('Host' is usually 'Right Ctrl').

See https://www.virtualbox.org/manual/ch04.html#idp52733088 for more details.

CLI Example:

salt '*' vbox_guest.additions_install
salt '*' vbox_guest.additions_install reboot=True
salt '*' vbox_guest.additions_install upgrade_os=True
Parameters:
  • reboot (bool) -- reboot computer to complete installation

  • upgrade_os (bool) -- upgrade OS (to ensure the latests version of kernel and developer tools are installed)

Returns:

version of VirtualBox Guest Additions or string with error

salt.modules.vbox_guest.additions_mount()

Mount VirtualBox Guest Additions CD to the temp directory.

To connect VirtualBox Guest Additions via VirtualBox graphical interface press 'Host+D' ('Host' is usually 'Right Ctrl').

CLI Example:

salt '*' vbox_guest.additions_mount
Returns:

True or OSError exception

salt.modules.vbox_guest.additions_remove(**kwargs)

Remove VirtualBox Guest Additions.

Firstly it tries to uninstall itself by executing '/opt/VBoxGuestAdditions-VERSION/uninstall.run uninstall'. It uses the CD, connected by VirtualBox if it failes.

CLI Example:

salt '*' vbox_guest.additions_remove
salt '*' vbox_guest.additions_remove force=True
Parameters:

force (bool) -- force VirtualBox Guest Additions removing

Returns:

True if VirtualBox Guest Additions were removed successfully else False

salt.modules.vbox_guest.additions_umount(mount_point)

Unmount VirtualBox Guest Additions CD from the temp directory.

CLI Example:

salt '*' vbox_guest.additions_umount
Parameters:

mount_point -- directory VirtualBox Guest Additions is mounted to

Returns:

True or an string with error

salt.modules.vbox_guest.additions_version()

Check VirtualBox Guest Additions version.

CLI Example:

salt '*' vbox_guest.additions_version
Returns:

version of VirtualBox Guest Additions or False if they are not installed

salt.modules.vbox_guest.grant_access_to_shared_folders_to(name, users=None)

Grant access to auto-mounted shared folders to the users.

User is specified by its name. To grant access for several users use argument users. Access will be denied to the users not listed in users argument.

See https://www.virtualbox.org/manual/ch04.html#sf_mount_auto for more details.

CLI Example:

salt '*' vbox_guest.grant_access_to_shared_folders_to fred
salt '*' vbox_guest.grant_access_to_shared_folders_to users ['fred', 'roman']
Parameters:
  • name (str) -- name of the user to grant access to auto-mounted shared folders to

  • users (list of str) -- list of names of users to grant access to auto-mounted shared folders to (if specified, name will not be taken into account)

Returns:

list of users who have access to auto-mounted shared folders

salt.modules.vbox_guest.list_shared_folders_users()

List users who have access to auto-mounted shared folders.

See https://www.virtualbox.org/manual/ch04.html#sf_mount_auto for more details.

CLI Example:

salt '*' vbox_guest.list_shared_folders_users
Returns:

list of users who have access to auto-mounted shared folders