Page 1 of 1

[SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 14. Jul 2011, 16:05
by tubularbox
Hello guys. I'm not sure if this is a VirtualBox issue or it's just that i'm doing something wrong when configuring the guest, but well,... here i go:

I have a CentOS 5.6 host running VirtualBox 4.0.10 in a box with two network cards (each one connected to a separate router). I have two guests (Ubuntu 10.04 Server -text mode only-) and what i want to do is just to bridge each network card to a guest:

Router0 -> host eth0 -> Ubuntu Guest 1 eth0
Router1 -> host eth1 -> Ubuntu Guest 2 eth0

So, In VirtualBox GUI, i select a VM, went on "configuration" -> "network" and set it in bridged mode (i need it to be bridged, not NAT). I check in "advanced" that the network card selected is the right one, and then start the Ubuntu guest, log in, and launch 'ifconfig', and all i can get is the loopback interface. There's no eth0. So... ¿What happens here?

Also, If i edit /etc/network/interfaces and include eth0 (static ip) and try to put it up ($sudo ifup eth0) all i get is the following:

Code: Select all   Expand viewCollapse view
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device


I've googled it and found that it can be due to some issue with MAC addresses, but if i can not see the interface in the guest, then i can not change it's MAC...

Conectivity is ok in the host machine: i managed to ping both gateways and got internet access, can browse, etc... ¿any clue? :?: :?:

Re: Missing eth0 in Ubuntu guest

PostPosted: 14. Jul 2011, 16:26
by fixedwheel
each time you give a new MAC address (in VBox guest settings) Debian and Ubuntu guests udev assigns a new eth number
edit /etc/udev/rules.d/70-persistent-net.rules or delete the file: it will be recreated @ next boot

Re: Missing eth0 in Ubuntu guest

PostPosted: 14. Jul 2011, 17:22
by tubularbox
fixedwheel wrote:each time you give a new MAC address (in VBox guest settings) Debian and Ubuntu guests udev assigns a new eth number
edit /etc/udev/rules.d/70-persistent-net.rules or delete the file: it will be recreated @ next boot


I did that, and solved the problem. Thank you very much!

Re: Missing eth0 in Ubuntu guest

PostPosted: 19. May 2013, 02:55
by Panduka1970
tubularbox wrote:
fixedwheel wrote:each time you give a new MAC address (in VBox guest settings) Debian and Ubuntu guests udev assigns a new eth number
edit /etc/udev/rules.d/70-persistent-net.rules or delete the file: it will be recreated @ next boot


I did that, and solved the problem. Thank you very much!



Thanks for your post forum.

I also able to solve the problem in that way,
additionally after you restart, you should should make sure to active the eth0, eth1, or eth2 ........ by looking at newly created 70-persistent-net.rules
thanks again and cheers

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 20. Nov 2013, 20:45
by sxg
Thanks a lot
I was really in the dark
And after applying this, it solved my problem

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 1. Apr 2014, 01:28
by gmadeira
Hey guys please help me. For me it didnt work. I've tried everything changing the network settings on virtual box. It was ok when I was using it wirelessly but now I have to set it up with cable connection. In fact I would like to work with both wireless and cable but NEVER could make it work. Now none of them is working. I use bridge because I need internet at guest and host and need them to comunicate. My ubuntu has static ip now. It was working with no problem but not anymore. Any good soul could help me ?

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 1. Apr 2014, 08:04
by socratis
A bridged connection will require either a fixed IP, or a DHCP server (like a home router or a modem) at the end of the cable, where both host and guest will get their IPs from. Do you have that?

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 1. Apr 2014, 14:55
by mpack
Moving this discussion to "Linux Guests".

@gmadeira: Conspicuous by its absence is any mention that eth0 is missing from your Linux guest. If it is missing then see the thread above which will certainly fix it, otherwise please start another discussion. This is not a general internet problems thread.

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 29. Jul 2014, 12:16
by Deval Bhamare
gmadeira wrote:Hey guys please help me. For me it didnt work. I've tried everything changing the network settings on virtual box. It was ok when I was using it wirelessly but now I have to set it up with cable connection. In fact I would like to work with both wireless and cable but NEVER could make it work. Now none of them is working. I use bridge because I need internet at guest and host and need them to comunicate. My ubuntu has static ip now. It was working with no problem but not anymore. Any good soul could help me ?



Add a Bridged Connection to your N/W interface by using Network Options. If you have changed your MAC, then just deleting /etc/udev/rules.d/70-persistent-net.rules is not enough. Ubuntu keeps previous MAC entries as well in this file. While OS load, it cannot find previous MACs (since you have changed it to new) and hence fails at that point, failing to add new MACs and new interfaces. You need to edit the file. Follow the steps:

1. Go to directory /etc/udev/rules.d/
2. Do "Sudo vi 70-persistent-net.rules
3. Comment the OLD MAC entries (e.g. # SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:XX:XX:XX", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1")
4. Sometimes you need to make sure, for the new MACs, the interface names are in correct sequence, i.e. NAME="eth0", "eth1" and so on..

Hope this helps...

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 9. Oct 2014, 06:30
by gioperez
Hi i have tried doing what was instructed of removing the rules file. But when restarted the VM the file was not created there. You guys suggest anything I can do to fix this problem? :)

Re: Missing eth0 in Ubuntu guest

PostPosted: 28. Sep 2015, 17:21
by lferro
fixedwheel wrote:each time you give a new MAC address (in VBox guest settings) Debian and Ubuntu guests udev assigns a new eth number
edit /etc/udev/rules.d/70-persistent-net.rules or delete the file: it will be recreated @ next boot


Second that. It solved my problem also. Thanks!

Re: [SOLVED]Missing eth0 in Ubuntu guest

PostPosted: 9. Jun 2016, 19:56
by stuman
To resolve my issue, I had to uninstall network-manager on the guest (xubuntu 12.04...runs a Drupal instance as a guest of cli based ubuntu 14.04 server)
and old school code eth0 into /etc/network/interfaces after removing the /etc/udev/rules.d/70*net.rules file. I really don't care for network manager in a "server" instance.