VirtualBox Backup Network Problem


We're using a VirtualBox (version 3) for a virtual PC.
The problem is that somehow the .xml file is corrupt and the virtual PC cannot be started.
To fix this problem, we followed:
which fixed the problem and allowed me to start up the virtual PC.

The next problem is that the network is changing to eth1, eth2, eth3, and so on instead of the original eth0.
For this, we fixed it following:
which again, fixes the problem. I assigned the old MAC address via VBox GUI and restart the virtual PC. I correctly ended up with eth0 (well almost. at first the "network connection" shows "ifupdown eth0" instead, but after playing around with the settings, I ended up with just eth0).

The problem is that I cannot connect to the internet from the virtual PC.
I can ping the host PC interface:
and the gateway (on a router)
but not the dns server (eg:)
and not nor google .com

I've tried

From the Host PC:
I can ping the virtual PC:
and browse the internet.

I've tried adding the dns address to  /etc/resolv.conf but it doesnt work.

My setup is:
Ubuntu 8.04LTS
2 Lan interface: eth0=, eth1=
On VirtualBox panel, is bridged to the virtualPC

Virtual PC:
Ubuntu 9.10

Both and is connected to a switch which is connected to a router.

I've also tried:
>sudo default gw dev eth0

Please note that prior to the xml error, the guest was able to connect to the internet.

Please help.

Thank You so much.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

if you want to connect via VB to internet then change the network card to NAT...
SW111Author Commented:
Bawer, Thanks for the reply.
Before the problem I was using Bridge and also, the part I'm not sure about NAT is that I need to set the Virtual PC's IP address static so it can fit to our network.
Try changing the DNS entry to the IP of the router.
Put Your Flow Data to Work

SolarWinds® Flow Tool Bundle combines three easy-to-download, easy-to-use flow analysis tools that can help you quickly distribute, test, and configure your flow traffic.

SW111Author Commented:
Rindi, just tried that. It doesnt work. btw, please note that even pinging the dns server's ip address from the guest will not work. Ping from host will work. This brings me to the conclusion that its not a dns issue but more of a policy/routing issue. Except that the routing should work on the router/firewall side. So it has to be either the ubuntu guest or virtualbox internal setting. (more likely virtualbox though, because before the xml problem it used to work).
Have you tried using DHCP and not a static IP? Also post what ifconfig -a outputs on the host.
SW111Author Commented:
No, I havent tried DHCP because there's no dhcp server on that subnet.

eth0      Link encap:Ethernet  HWaddr 00:15:17:83:2f:14
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::215:17ff:fe83:2f14/64 Scope:Link
          RX packets:1044024 errors:0 dropped:0 overruns:0 frame:0
          TX packets:688013 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:306875515 (292.6 MB)  TX bytes:212318124 (202.4 MB)
          Base address:0x2020 Memory:b8820000-b8840000

eth1      Link encap:Ethernet  HWaddr 00:15:17:83:2f:15
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::215:17ff:fe83:2f15/64 Scope:Link
          RX packets:483263 errors:0 dropped:0 overruns:0 frame:0
          TX packets:170953 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:98796615 (94.2 MB)  TX bytes:81701312 (77.9 MB)
          Base address:0x2000 Memory:b8800000-b8820000

lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:571560 errors:0 dropped:0 overruns:0 frame:0
          TX packets:571560 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:122662596 (116.9 MB)  TX bytes:122662596 (116.9 MB)

vboxnet0  Link encap:Ethernet  HWaddr 0a:00:27:00:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Open in new window

You still have 2 nics active on the same subnet. Disable one of them and only concentrate on the other. Also disable ip6. Doesn't your router have it's DHCP server enabled? Are you using networkmanager to configure the interface? It's usually easier to disable that, particularly if you are using static IP's, and then edit the interfaces file in /etc/network.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SW111Author Commented:
Hi Rindi,

Sorry.... my bad. I have got no idea why this happened, but the firewall that I have (hardware firewall) is somehow allowing to pass to the internet and not and up. I didnt thought of this possibility before. Anyhow once the firewall is fixed by the network guy, only one remainig problem: still will not connect but and up will. I have got no idea why but my solution is to simply change the virtual PC address to something other than And it worked. Thank you for your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.