Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
8.8. Generating a New Unique MAC Address
In some cases you will need to generate a new and unique MAC address for a guest virtual machine. There is no command line tool available to generate a new MAC address at the time of writing. The script provided below can generate a new MAC address for your guest virtual machines. Save the script on your guest virtual machine as
macgen.py
. Now from that directory you can run the script using ./macgen.py
and it will generate a new MAC address. A sample output would look like the following:
./macgen.py
$ ./macgen.py
00:16:3e:20:b0:11
8.8.1. Another Method to Generate a New MAC for Your Guest Virtual Machine Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
You can also use the built-in modules of
python-virtinst
to generate a new MAC address and UUID
for use in a guest virtual machine configuration file:
echo 'import virtinst.util ; print\ virtinst.util.uuidToString(virtinst.util.randomUUID())' | python echo 'import virtinst.util ; print virtinst.util.randomMAC()' | python
# echo 'import virtinst.util ; print\
virtinst.util.uuidToString(virtinst.util.randomUUID())' | python
# echo 'import virtinst.util ; print virtinst.util.randomMAC()' | python
The script above can also be implemented as a script file as seen below.