Page 1 of 1

[ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 07:45
by LeonLanford
Hi I just installed virtualbox to try ubuntu 10.4 server. My host is windows xp sp 3.
I tried to make web server within the virtualbox using internet connection sharing from windowx.
It's already successful connecting from outside(the internet) by using software called port forwarding for windows.
I don't use iptables in the ubuntu, I just change the /etc/network/interfaces file to make it connect to the network.

The problem is the ethernet card in my ubuntu keeps changing after I restart ubuntu.
The first is named eth0, yesterday it's eth6, day before yesterday it's eth3, and now it's eth8.

Image

I need to rewrite the /etc/network/interfaces file everytime and restart the network to make it works again.

I'm using host only adapter for the ubuntu guest and I make two VirtualBox Host-Only Network, the first one is created by default by the virtualbox(using dhcp), then I make the new one to test the internet connection sharing. I disabled and do not use the first one.

Image

Image

here's the /etc/network/interfaces setting
Image

I already searched the google for two days but still haven't found solution so I decided to ask here, I'm really hoping someone can help me :(

I use the same setting for my windows xp guest but the ethernet card is not changing.
The ubuntu guest also has problem duplicate ping.

If possible I don't want to reinstall the ubuntu because I've downloaded and updated many packages, I don't want to lose my settings also.

Re: [ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 12:23
by baf
Warning guesswork:
Go into /etc/udev/rules.d/ and edit 70-persistent-net.rules (of course after making a backup) (might be name somewhat differently)
you should find lines like:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:6f:bf:49", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Change the NAME on all cards that should be the same to eth0. Save it.
Cross your fingers, hold your thumbs, pray..... and reboot

Re: [ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 15:45
by Sasquatch
I think that on each VM start, the MAC address of the adapter that you are using is changed. That is the only reason why Ubuntu would create a new interface name.

Also, if you create a second Host-only interface, just to ignore the first one, why make a second one in the first place? It doesn't make sense.

Re: [ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 17:10
by LeonLanford
baf wrote:Warning guesswork:
Go into /etc/udev/rules.d/ and edit 70-persistent-net.rules (of course after making a backup) (might be name somewhat differently)
you should find lines like:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:07:e9:6f:bf:49", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Change the NAME on all cards that should be the same to eth0. Save it.
Cross your fingers, hold your thumbs, pray..... and reboot
Wowww!! It's working! Thanks a lot :D
There's really lot of entry there.. I'm really surprised..
Sasquatch wrote:I think that on each VM start, the MAC address of the adapter that you are using is changed. That is the only reason why Ubuntu would create a new interface name.

Also, if you create a second Host-only interface, just to ignore the first one, why make a second one in the first place? It doesn't make sense.
I already disabled the first one, I made the new one because I want to do some tests and windows' ICS said that it needs to change the adapter to 192.168.0.1 so I made the new one and leave the default one.

Re: [ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 18:06
by Sasquatch
Ignore that ICS message, just set the adapter to that address (192.168.0.1) in the VB settings, enable ICS for it and that's it. Don't enable the DHCP server of VB, as Windows' ICS will take care of that. Also, ICS is just the same as using NAT, only difference is that you have a more direct connection between Host and Guest, which you can still do when you have two adapters, one with NAT (for internet and external access) and one with Host-Only. You can also use Bridged, if possible in the network. That way, the VM shows itself as a separate machine.

Re: [ubuntu 10.4 server] ethernet card keeps changing

Posted: 16. May 2010, 18:27
by LeonLanford
Sasquatch wrote:Ignore that ICS message, just set the adapter to that address (192.168.0.1) in the VB settings, enable ICS for it and that's it. Don't enable the DHCP server of VB, as Windows' ICS will take care of that. Also, ICS is just the same as using NAT, only difference is that you have a more direct connection between Host and Guest, which you can still do when you have two adapters, one with NAT (for internet and external access) and one with Host-Only. You can also use Bridged, if possible in the network. That way, the VM shows itself as a separate machine.
I tried before using 2 adapters, #1 is NAT and #2 is host-only but it's not working. In my windows guest, there's error saying about name conflict so I disabled the the NAT and did manual setting.