[ubuntu 10.4 server] ethernet card keeps changing

Discussions about using Linux guests in VirtualBox.
Post Reply
LeonLanford
Posts: 3
Joined: 16. May 2010, 07:21
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Ubuntu 10.4 server, xp sp 3

[ubuntu 10.4 server] ethernet card keeps changing

Post 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.
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: [ubuntu 10.4 server] ethernet card keeps changing

Post 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
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: [ubuntu 10.4 server] ethernet card keeps changing

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
LeonLanford
Posts: 3
Joined: 16. May 2010, 07:21
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Ubuntu 10.4 server, xp sp 3

Re: [ubuntu 10.4 server] ethernet card keeps changing

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: [ubuntu 10.4 server] ethernet card keeps changing

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
LeonLanford
Posts: 3
Joined: 16. May 2010, 07:21
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Ubuntu 10.4 server, xp sp 3

Re: [ubuntu 10.4 server] ethernet card keeps changing

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