Keep config after a "hardware" change?

  • I am building a reusable lab in my virtual environment.

    I have a pfsense router setup as the gateway for my lan vlans. Along with an OpenVPN configuration, NAT rules, and Http_referrer disabled.

    When I clone that VM to a new VM, all of that customized configuration goes away.

    Is there a way to prevent that from happening? Ideally no matter what the "hardware" looks like i just want it to boot up and be the same machine it was before it shutdown.

    Alternatively, would there be a way to script a config restore on reboot?

  • I'm not a pfSense virtualization expert for sure, but I am surprised cloning wipes out the configuration. pfSense, as you may already know, stores all configuration information in an XML file called config.xml that is stored in the /conf sub-directory directly off the root.

    I would expect that file to get duplicated into the clone along with everything else from the parent VM. You do mean a literal "clone" and not simply creating from a template, right? Obviously the MAC addresses change with the clone, but the virtual hardware should remain the same.

  • @bmeeks sorry... yes creating from a template... so new MAC's, UUID's, etc

  • @recklessop said in Keep config after a "hardware" change?:

    @bmeeks sorry... yes creating from a template... so new MAC's, UUID's, etc

    A template and a clone are sort of two radically different things. A template usually starts with a "fresh" un-configured version of the VM's OS such as Windows, or in this case, pfSense. A clone is a simple copy of an existing VM byte-for-byte. Sounds like you need to re-create your template by configuring a firewall to be just like you want it, and then using that VM to create your template. What's happening is the config.xml file in your template is in an out-of-the-box state instead of having your custom configuration stored within it.

Log in to reply