Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to configure a machine image with all the bells and whistles and then be able to launch multiple instances of it in VirtualBox. However, it allows me to launch only a single instance of each VM. I tried cloning VMs (and selecting reinitialize MAC address) and launching the clones, however, the clone doesn't get an IP address. So the original has the following network configuration:

eth0      Link encap:Ethernet  HWaddr 08:00:27:92:0a:ec  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::a00:27ff:fe92:aec/64 Scope:Link
          RX packets:5317 errors:0 dropped:0 overruns:0 frame:0
          TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:516671 (516.6 KB)  TX bytes:10492 (10.4 KB)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:337 (337.0 B)  TX bytes:337 (337.0 B)

whereas the clone has no eth0, only lo and I cannot ssh into it.

share|improve this question
This limitation isn't unique to VirtualBox. The best way to do this would be to configure it once, clone the hdd and change the UID, then duplicate configuration for each additional instance you created. You won't be able to run multiple virtual machines without changing the UID and creating multiple virtual hdd files. – Ramhound Oct 9 '13 at 15:18
@Ramhound, you are correct, however cloning a VM in Virtualbox does just that, it changes the UID and creates a new virtual hdd file. – tbenz9 Oct 9 '13 at 18:28
@amphibient, please include the network configuration and Linux flavor. For example if this is Ubuntu, please say so and include the contents of /etc/interfaces/network. – tbenz9 Oct 9 '13 at 18:29
@tbenz9 - I should explain I almost always just copy and paste the actual file by hand then use the command line tool to change the UID on new file itself – Ramhound Oct 9 '13 at 18:30
@Ramhound thats great and I know that works. I have personally found the GUI clone tool to be much easier to use and just as effective. I try not to mess with the UID unless I have no other choice. I think this question is more of a networking issue rather than a how-to cloning issue. Even if amphibient cloned using your method they would still have the same networking issues. Thanks for the comment though! – tbenz9 Oct 9 '13 at 18:38


I was able to re-create your issue exactly. The easiest solution I found was to simply remove the contents of /etc/udev/rules.d/70-persistent-net.rules and reboot. This file is automatically generated when you reboot and it will reset eth0 to the MAC currently assigned.

Original Answer

When you clone a VM and reinitialize the mac the OS thinks the new mac is a new network device. It usually assigns the new mac address to eth1. If eth1 has not been configured properly you won't have any networking and wont be able to ssh in.

You can clear the udev networking rules to force the OS to forget about the previous MAC and assign the new MAC to eth0, or you can configure eth1 to be the primary networking interface.

Here is a pretty good explaination of why udev rules are important and applicable to your situation: "For example, on a computer having two network cards made by Intel and Realtek, the network card manufactured by Intel may become eth0 and the Realtek card becomes eth1. In some cases, after a reboot the cards get renumbered the other way around. To avoid this, create Udev rules that assign stable names to network cards based on their MAC addresses or bus positions."

Another possible problem would be if the IP address was statically set in the network configuration. If you have a DHCP server that is supposed to be handing out IP addresses then make sure the network configuration is set to DHCP.

quote source and udev rules documentation

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .