[SOLVED]Missing eth0 in Ubuntu guest

Discussions about using Linux guests in VirtualBox.
Post Reply
tubularbox
Posts: 11
Joined: 13. Jul 2011, 17:54
Primary OS: Linux other
VBox Version: OSE Fedora
Guest OSses: Ubuntu 11.04 Server

[SOLVED]Missing eth0 in Ubuntu guest

Post 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

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? :?: :?:
Last edited by tubularbox on 14. Jul 2011, 17:31, edited 1 time in total.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Missing eth0 in Ubuntu guest

Post 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
tubularbox
Posts: 11
Joined: 13. Jul 2011, 17:54
Primary OS: Linux other
VBox Version: OSE Fedora
Guest OSses: Ubuntu 11.04 Server

Re: Missing eth0 in Ubuntu guest

Post 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!
Panduka1970
Posts: 1
Joined: 19. May 2013, 02:50

Re: Missing eth0 in Ubuntu guest

Post 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
sxg
Posts: 3
Joined: 20. Nov 2013, 20:42
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux RHEL

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post by sxg »

Thanks a lot
I was really in the dark
And after applying this, it solved my problem
gmadeira
Posts: 1
Joined: 1. Apr 2014, 01:24

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post 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 ?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post 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?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post 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.
Deval Bhamare
Posts: 2
Joined: 29. Jul 2014, 12:08

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post 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...
gioperez
Posts: 5
Joined: 8. Oct 2014, 06:58

Re: [SOLVED]Missing eth0 in Ubuntu guest

Post 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? :)
lferro
Posts: 1
Joined: 28. Sep 2015, 17:19

Re: Missing eth0 in Ubuntu guest

Post 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!
stuman
Posts: 6
Joined: 14. Jun 2010, 18:37
Primary OS: Ubuntu 8.04
VBox Version: PUEL
Guest OSses: XP

Re: [SOLVED]Missing eth0 in Ubuntu guest

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