Instead of changing the build script I can tell users to create the network xml file in a single command and import that with net-define.
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | xmllint --format - >> example.xml
I’ll add: libxml2-utils to the packages they need to install. (On Debian its installed by default)
Running this command:
echo "<network><name>external</name><forward mode='nat'/><bridge name='virbr1' stp='on' delay='0'/><ip address='10.0.2.2' netmask='255.255.255.0' /></network>" | xmllint --format - >> external_network.xml
Gives external_network.xml containing:
<network> <name>external</name> <forward mode='nat'/> <bridge name='virbr1' stp='on' delay='0'/> <ip address='10.0.2.2' netmask='255.255.255.0'/> </network>
All you need to do is accept all pull requests except the external_network one. Unless you have the internal network names hardcoded it should solve this. Tell me if you need to revert to the “Whonix” network.
Another non-related problem: Users upgrading that don’t delete their old ‘Whonix’ network will run into a conflict because of the same virtual bridge number already exists. Something I can do is choose completely different virbr numbers for external/internal network files to avoid this. What do you think?