No networking on copied/imported guests?

Discussions related to using VirtualBox on Linux hosts.
Gav
Posts: 1
Joined: 10. Jan 2013, 13:57

Re: No networking on copied/imported guests?

Post by Gav »

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.
LukeChavers
Posts: 1
Joined: 11. Sep 2014, 08:12

Re: No networking on copied/imported guests?

Post by LukeChavers »

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.
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.

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:
import_opts (string) - Additional options to pass to the VBoxManage import. This can be useful for passing "keepallmacs" or "keepnatmacs" options for existing ovf images.
from <packer.io>/docs/builders/virtualbox-ovf.html

.. which might help anyone wanting to try your solution within a similar use case.

Thanks again,
Luke
e3mark
Posts: 1
Joined: 18. May 2016, 17:41

Re: No networking on copied/imported guests?

Post by e3mark »

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!
Post Reply