No networking on copied/imported guests?
Posted: 9. Nov 2009, 05:46
Host: debian "lenny", VirtualBox 3.0.10
Guest: debian "lenny", bridged networking
Networking on my guest OS only seems to work if it was created directly within VirtualBox, not when imported or copied.
I've spent all day trying to narrow this down to a simple, reproducible case, and I think I have it -- so hopefully someone can help me figure out why this isn't working, or if it's a bug. I looked in the ticket database and scoured this forum and the web, and am amazed nobody else is having this problem so it must be something I'm doing wrong. Any help would be greatly appreciated.
Here are my steps to reproduce the problem, all on the same host OS (see versions/distributions above):
1. Create a new virtual machine, the normal way, with bridged networking. (Including installing fresh Debian linux distribution.)
2. Boot the new virtual machine, and notice that you have a network. (ifconfig shows eth0 is set up, and active, and has an IP address; all is good.) [Before someone misunderstands and starts explaining how to set up bridged networking, please understand -- it works as expected here! I'd been using VirtualBox on a single host for a long time, and have tracked improvements in how virtual bridging works and I'm doing it the right way in 3.0 and have been. This problem only began when I got a second machine so I could do fail-over and was shocked that eth0 was gone on my cloned version.]
3. Shut down the new virtual machine cleanly.
4. Clone the virtual machine on the same host, using either of these two methods: either (a) export .ovf from VirtualBox GUI on host, or (b) make a copy of the .vdi file (via cp or tar to preserve dates/times).
5. On the same host, using the VirtualBox GUI, either (a) import the .ovf you exported above, or (b) create a new guest, pointing to the copied .vdi file.
6. Before booting, go to the settings for the new guest OS created in 5, and make sure the networking is set to "bridged" mode.
7. Boot the new copy of the guest OS (no other guests are running).
8. Notice that you have NO NETWORKING on the new guest. After successful boot, do "ifconfig" and see you only have the "lo" device, not "eth0". If you do "ifup eth0" you get the following errors:
In fact, the original test was between two host OS's (same configurations, both running the latest VirtualBox 3.0.10 installation). But when that didn't work, after trying many different ways of troublshooting, I switched to just trying to make it work on a single OS, and still to no avail.
I am just incredulous that I'm the only person having this problem, so can someone tell me, is this just a simple problem and I'm blind to the way to resolve it? It's okay if you call me dumb. I just really am exhausted iterating on possible solutions all weekend.
Oh, and to be clear, I have tested many, many things in my troubleshooting. Here are a few:
* I tried switching the networking on the copy to "NAT" and still no network on the copied system.
* I tried unplugging/re-plugging in the ethernet cable (virtually speaking) from the console UI ("Devices > Network Adaptors > [ ] Adaptor 1"), but no effect.
* I can't find any log files with errors from VirtualBox. Where would those be? I looked everywhere. There doesn't seem to be a way for me to tell it I wanted debug logging, but again maybe I'm just blind.
* I tried same host and different hosts, same result.
* I tried changing the macaddr of the virtual ethernet just to see if that could be causing it, and no effect.
* I tried adding a second interface (eth0 is bridged, eth1 is nat) and still nothing! ifconfig says only lo is active. Though in this case, I *can* start eth1 using "ifup eth1" (after adding it to /etc/network/interfaces) and it comes up in NAT mode. But that's not what I need! In every experiment I've done, eth0 gives the errors above if I try to bring it up, regardless of which mode it's in.
My guess is that this isn't specific to bridged networking, since it happened with NAT as well above. But I really need bridged networking or this won't work for my needs. So please, please, please, someone help me.
Could it be something specific to Debian, where it's caching something about the eth0 device that makes it not recognize it at boot? There are no errors in the logs, though. I just can't understand why this would be happening, so any help would be sincerely appreciated.
Thanks.
Steve
Guest: debian "lenny", bridged networking
Networking on my guest OS only seems to work if it was created directly within VirtualBox, not when imported or copied.
I've spent all day trying to narrow this down to a simple, reproducible case, and I think I have it -- so hopefully someone can help me figure out why this isn't working, or if it's a bug. I looked in the ticket database and scoured this forum and the web, and am amazed nobody else is having this problem so it must be something I'm doing wrong. Any help would be greatly appreciated.
Here are my steps to reproduce the problem, all on the same host OS (see versions/distributions above):
1. Create a new virtual machine, the normal way, with bridged networking. (Including installing fresh Debian linux distribution.)
2. Boot the new virtual machine, and notice that you have a network. (ifconfig shows eth0 is set up, and active, and has an IP address; all is good.) [Before someone misunderstands and starts explaining how to set up bridged networking, please understand -- it works as expected here! I'd been using VirtualBox on a single host for a long time, and have tracked improvements in how virtual bridging works and I'm doing it the right way in 3.0 and have been. This problem only began when I got a second machine so I could do fail-over and was shocked that eth0 was gone on my cloned version.]
3. Shut down the new virtual machine cleanly.
4. Clone the virtual machine on the same host, using either of these two methods: either (a) export .ovf from VirtualBox GUI on host, or (b) make a copy of the .vdi file (via cp or tar to preserve dates/times).
5. On the same host, using the VirtualBox GUI, either (a) import the .ovf you exported above, or (b) create a new guest, pointing to the copied .vdi file.
6. Before booting, go to the settings for the new guest OS created in 5, and make sure the networking is set to "bridged" mode.
7. Boot the new copy of the guest OS (no other guests are running).
8. Notice that you have NO NETWORKING on the new guest. After successful boot, do "ifconfig" and see you only have the "lo" device, not "eth0". If you do "ifup eth0" you get the following errors:
I'm very frustrated by this. Before I can dive into using VirtualBox and setting up my real production application server, I want to be 100% sure I can easily copy it to another machine and run it if the primary fails. But I'm entirely dead in the water until I can get this working -- otherwise it's a waste of my time in case it turns out some fundamental issue is keeping me from doing this.SIOCSIFADDR: No such device
eth0: ERROR while getting interface flag: No such device
eth0: ERROR while getting interface flag: No such device
Bind socket to interface: No such device
Failed to bring up eth0.
In fact, the original test was between two host OS's (same configurations, both running the latest VirtualBox 3.0.10 installation). But when that didn't work, after trying many different ways of troublshooting, I switched to just trying to make it work on a single OS, and still to no avail.
I am just incredulous that I'm the only person having this problem, so can someone tell me, is this just a simple problem and I'm blind to the way to resolve it? It's okay if you call me dumb. I just really am exhausted iterating on possible solutions all weekend.
Oh, and to be clear, I have tested many, many things in my troubleshooting. Here are a few:
* I tried switching the networking on the copy to "NAT" and still no network on the copied system.
* I tried unplugging/re-plugging in the ethernet cable (virtually speaking) from the console UI ("Devices > Network Adaptors > [ ] Adaptor 1"), but no effect.
* I can't find any log files with errors from VirtualBox. Where would those be? I looked everywhere. There doesn't seem to be a way for me to tell it I wanted debug logging, but again maybe I'm just blind.
* I tried same host and different hosts, same result.
* I tried changing the macaddr of the virtual ethernet just to see if that could be causing it, and no effect.
* I tried adding a second interface (eth0 is bridged, eth1 is nat) and still nothing! ifconfig says only lo is active. Though in this case, I *can* start eth1 using "ifup eth1" (after adding it to /etc/network/interfaces) and it comes up in NAT mode. But that's not what I need! In every experiment I've done, eth0 gives the errors above if I try to bring it up, regardless of which mode it's in.
My guess is that this isn't specific to bridged networking, since it happened with NAT as well above. But I really need bridged networking or this won't work for my needs. So please, please, please, someone help me.
Could it be something specific to Debian, where it's caching something about the eth0 device that makes it not recognize it at boot? There are no errors in the logs, though. I just can't understand why this would be happening, so any help would be sincerely appreciated.
Thanks.
Steve