I was having the same trouble however it only happened when importing a VM using VBoxManage, not when importing it through the userinterface of the manager. I tracked it down to the following option which needs to be set on VBoxManage import for to keep the same mac address, this is set by default when performing the import through the manager UI.
--options keepallmacs
Hope this helps anyone else who found this thread through google.
No networking on copied/imported guests?
-
- Posts: 1
- Joined: 11. Sep 2014, 08:12
Re: No networking on copied/imported guests?
At first I thought that would do it, but after investigating (but not trying it) I found that it might not be the best solution for my use case, which involves building images using Packer.io's Virtualbox-OVF builder.Gav wrote:I was having the same trouble however it only happened when importing a VM using VBoxManage, not when importing it through the userinterface of the manager. I tracked it down to the following option which needs to be set on VBoxManage import for to keep the same mac address, this is set by default when performing the import through the manager UI.
--options keepallmacs
Hope this helps anyone else who found this thread through google.
So, I found this: <github>/mitchellh/packer/issues/866 .. and I am in the process of testing it now.
Although, your tip did lead me to this:
from <packer.io>/docs/builders/virtualbox-ovf.htmlimport_opts (string) - Additional options to pass to the VBoxManage import. This can be useful for passing "keepallmacs" or "keepnatmacs" options for existing ovf images.
.. which might help anyone wanting to try your solution within a similar use case.
Thanks again,
Luke
Re: No networking on copied/imported guests?
This exactly happend to me when I cloned CentOS6.7 with guest os enabled and percona server preinstalled.
HERE IS HOW I FIXED IT:
There are 2 offending files:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/udev/rules.d/70-persistent-net.rules
Step 1:
$ nano /etc/sysconfig/network-scripts/ifcfg-eth0
then remove HWADDR=XX:XX:XX:XX:XX:XX line
Step 2:
$ rm -f /etc/udev/rules.d/70-persistent-net.rules
this deletes the file but will be recreated upon reboot
$ reboot
Step 3:
then login again
$ ifconfig
to show eth0
I hope this helps!
HERE IS HOW I FIXED IT:
There are 2 offending files:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/udev/rules.d/70-persistent-net.rules
Step 1:
$ nano /etc/sysconfig/network-scripts/ifcfg-eth0
then remove HWADDR=XX:XX:XX:XX:XX:XX line
Step 2:
$ rm -f /etc/udev/rules.d/70-persistent-net.rules
this deletes the file but will be recreated upon reboot
$ reboot
Step 3:
then login again
$ ifconfig
to show eth0
I hope this helps!