Writing Virtualmin Plugins

Writing Virtualmin Plugins

Introduction to Plugins

Before starting on a plugin, we suggest that you first read the Webmin module developers guide at https://doxfer.webmin.com/Webmin/ModuleDevelopment .

A Virtualmin plugin is simply a Webmin module that can provide additional features to Virtualmin virtual servers or users. To do this, it must contain a Perl script called virtual_feature.pl which defines certain functions. The plugin module can then be registered by Virtualmin, and the feature it offers will then be available when creating new virtual domains.

A plugin typically adds a new possible to virtual servers, in addition to the standard features built into Virtualmin (website, DNS domain and so on). For example, it may enable reporting using some new statistics generator, or activate some game server in the virtual domain. Virtualmin will add options to the Create Server and Edit Server pages for enabling the plugin's feature, and call functions in its virtual_feature.pl when the feature is activated, de-activated or changed.

Starting a Plugin

The steps to start writing your own plugin are similar to those for creating a new Webmin module :

  1. Find the Webmin root directory, which will be /usr/libexec/webmin on Redhat-derived systems, /usr/share/webmin on Debian and Ubuntu, or /opt/webmin on Solaris.
  2. Pick a directory name for your plugin that is not currently in use by any other Webmin module. Plugin directories typically start with virtualmin- - so for the purposes of this documentation, we will assume that yours is going to be called virtualmin-yourname .

  3. Create that directory under the Webmin root. Then within it, create help and lang sub-directories.

  4. Create a file in the directory called module.info. This should contain lines like :