Automating the post-install wizard

OS type and version AlmaLinux 9
Webmin version 2.001
Virtualmin version 7.3

I am wanting to complete the post-install wizard programmatically, the most recent in a line of people over the years who have wanted to do this too. See also:

It looks like there still isn’t an officially supported method for this. I was hoping for something to appear in virtualmin --help, but no dice. Is there some simple way of doing this that I’ve missed, or should I go ahead and look into automating each individual task the wizard does and setting its completion flag like those who have come before me?

At this point, there doesn’t need to be a lot of changes for most users…the wizard does less now than when those were posted, asks fewer questions, and more is set to reasonable defaults during virtualmin-config stage of install.

And, I still think the best bet is to do this from the second conversation you linked:

“it may be easiest to do a fresh install, make a backup of /etc/webmin and then run the wizard manually, and diff the original /etc/webmin vs the new one post-wizard. That’ll give you the dozen or so options you need to change, and you can decide whether to script it with the webmin CLI or just copy in a “golden” version of the Webmin directory…depends on whether you have host-specific stuff that needs to be respected.”

At this point, assuming you mostly use defaults, there will probably only be two or three changes you need to script.

One thing I see we have not fixed, as far as I can tell, is that there is no way to trigger a proper configuration check, which continues to be a real problem for automation. I’ll ask @Jamie if he has any ideas on how to make the config check happen in the same way it would in the GUI.

1 Like

Er, actually the docs now say the CLI command for config-check does update stuff. So, I think that bug-like has been fixed.

So, it should be quite easy now to replicate the wizard. Just change the handful of items you want to change (if any), set a MySQL root password, and run the config check. That’s it.

You can also force Virtualmin to not show the wizard on first login by adding the line wizard_run=1 to /etc/webmin/virtual-server/config

This is what I ended up doing, along with @Jamie’s hint about wizard_run. Thanks for everyone’s help!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.