PDA

View Full Version : Prepare Kali for use as a template vm in ovirt hypervisor



jeremytourville
2018-01-13, 02:44
Hello,
This is my first post here. I am hoping someone can help clarify the procedure I need to follow to create a Kali template.

I am following the general guidance for creating templates specific to my hypervisor distribution (ovirt)
https://www.ovirt.org/documentation/vmm-guide/chap-Templates/

The template process defines several steps that need to be accomplished:

Flag the system for re-configuration
Remove ssh host keys:
Set HOSTNAME=localhost.localdomain
Remove /etc/udev/rules.d/70-*:
Remove the HWADDR line and UUID line from /etc/sysconfig/network-scripts/ifcfg-eth*.
Optionally, delete all the logs from /var/log and build logs from /root.


I know how to do each item in the above list except #5, remove the HWADDR and UUID.

I did review the forums here and found two posts related to changing the MAC address.
https://forums.kali.org/showthread.php?21985-How-to-make-mac-address-random-at-each-boot-up
https://forums.kali.org/showthread.php?36072-SOLVED-Could-not-change-MAC-amp-Setup-Macchanger-auto-spoofing-randomization-in-Kali

It is my understanding that the techniques in the two posts I listed don't meet the objective needed to create a template. The posts mention the use of the mac changer tool. I understand that the mac changer tool is used for spoofing while the objective I need to achieve is to actually remove a MAC address.

How do I actually remove a MAC address?

Lastly, I realize my understanding of several points above could be incorrect. I appreciate your clarification if I don't have the proper understanding of a subject area.

Thank you for your input and advice.

jeremytourville
2018-01-14, 14:05
So I did some extensive researching. I was able to answer my question. I found a good guide here
https://en.wikibooks.org/wiki/Changing_Your_MAC_Address/Linux
In short, if you only have a single NIC in your system you won't have the HWADDR parameter.

Sealing a Kali Linux 2017.3 Virtual Machine

1. Log in to the virtual machine.
2. Flag the system for re-configuration:
# touch /.unconfigured
3. Remove ssh host keys:
# rm -rf /etc/ssh/ssh_host_*
4. Set HOSTNAME=localhost.localdomain in /etc/sysconfig/network
5. Remove /etc/udev/rules.d/70-*:
# rm -rf /etc/udev/rules.d/70-*
6. Remove the HWADDR line and UUID line from /etc/NetworkManager/system-connections/
# nano /etc/NetworkManager/system-connections/name-of-connection
edit this section and comment out UUID
[connection]
id=Wired connection 1
uuid=xxx-xxxxxx-xxxxxx-xxxxxx-xxx
*Note* HWADDR parameter is only present if there are multiple NICs
7. Optionally, delete all the logs from /var/log and build logs from /root.
8. Flush all ARP cache
# ip -s -s neigh flush all
8. Shut down the virtual machine:
# poweroff

The virtual machine is sealed and can be made into a template. You can deploy Linux virtual machines from this template without experiencing configuration file conflicts.