In this article:
NAMEvmtools — a virtual machines manager based on Qemu
DESCRIPTIONvmtools is a virtual machines manager which strives to be easy, versatile and modular to empower the user as much as possible while adhering to the principle of least privileges.
Every bootable thing should be throwable as-is to the vmup(1) command to be immediately started in a hassle-free fashion, from local standalone disk images files to remote URLs passing through .ova archives to device files.
vmtools commands do as few assumptions as possible on the way the user will use them, while providing as many options as possible to customize the command behavior.
Not only vmtools is entirely developped in shell script language making it easy to inspect and modify it, but it is also explicitely modular.
- These modules are invoked during the virtual machine creation process. It contains two modules sub-categories: templates which allows to select the templates to apply to the virtual machine, settings which allows to define the virtual machine actual settings. The modules either interactively prompt the user for some input or automatically determine a value (for instance depending on some properties of the image file to boot).
- These modules rely the virtual machine settings to build the Qemu command-line which will be used to start the guest system.
- These modules control the cloning process which occurs when copying or forking a virtual machine.
- Principle of least privilege
As opposed to some other virtual machines management tools, vmtools does not require root privileges, it not require any privileged service to run and in fact do not require any background service at all.
INHERITANCEvmtools implements an inheritance system making a typical virtual settings file rather small as it should contain only the few variables customized for the current virtual machine.
Parent and child (forked) virtual machinesVirtual machines can be copied and forked using the vmcp(1) and vmfork(1) commands.
TemplatesTemplates implements settings inheritance for virtual machines which are not forked from each other.
A legacy PC will not use the same settings as a modern PC, and neither of them will use the same settings as a MacOS machine, however each of them shares common base settings with every other members of the same category.
As stated above, virtual machine parent inheritance allows may allow to change a setting for a whole tree by editing only one value in one file. Logical templates allows to link templates which would however not be related to they can share some settings.
CUSTOMIZATIONThe vmtools.conf file and the content of the modules directory can be overriden at the system and optionally at the user level.
Customizing default settingsTo override some default settings system-wide, set them in the /etc/vmtools/vmtools.conf file. Optionally, if cfg_include_userhome is set to “yes” (either in /etc/vmtools/vmtools.conf or by using a command-line argument such as -o), default settings can also be overriden at the user level in the ~/.config/vmtools/vmtools.conf (see FILES below for more information on how to select another location).
Customizing modulesTo override a module system-wide, create a modules directory with a similar tree than the default /usr/local/share/vmtools/modules and store the customized version of the module there. Optionally, if cfg_include_userhome is set to “yes” (either in /etc/vmtools/vmtools.conf or by using a command-line argument such as -o), default modules can also be overriden at the user level in the ~/.config/vmtools/modules (see FILES below for more information on how to select another location).
COMMANDSvmtools commands are as follows:
- Copy or fork virtual machines.
- Create a new virtual machine.
- Shutdown a virtual machine.
- Detect and fix virtual machines issues.
- Copy or fork virtual machines.
- Report information on a virtual machine.
- Merge two related virtual machines.
- Access the Qemu monitor shell of a virtual machine.
- Move or rename a virtual machine home directory.
- Report information on running virtual machines.
- Delete a virtual machine home directory.
- Generate a random MAC address.
- Start virtual machine or a bootable file or media.
- Default location to store temporary files, by default /tmp.
- Location of user’s configuration files, by default ~/.config.
- Executable files.
- Libraries shared by the vmtools project utilities.
- Project man pages.
- Default modules location.
- Virtual machine default settings, see vmtools.conf(5).
- User overrides (if cfg_include_userhome is set to “yes”).
- System-wide overrides.