In VirtualBox I have two different OS’s: Ubuntu and openSUSE 12.2. I set both up the same way and Ubuntu can connect but openSUSE cannot. Both have the following settings:
VirtualBox settings:
network: Bridged adapter “eth0”, cable connected
OS settings:
static ip (Ubuntu 192.168.1.105, opensuse 192.168.1.106) - I checked, neither’s used by anything else
Both are connected to the router via a cable, NOT wireless
I set openSUSE’s static IP by:
YAST->Network Devices->Network Settings->Edit->Statically Assigned IP Address (192.168.1.106, subnet mask /24
What setting do I have wrong? Does Bridged Adapter work with Ubuntu in VirtualBox but not openSUSE?
When I run /sbin/ifconfig, it shows the proper ip address on eth0 in openSUSE.
NOTE: I am able to access the guest’s web server on my host machine’s web browser via the ip address 192.168.1.106, so that’s working, but why can’t the guest reach the internet?
** When I set the ip to dynamic (gets it from DHCP) it connects to the internet! It’s when it’s static that it doesn’t work! What could be wrong?
When dynamic, it connects to the internet
When static, I can still reach the router in the browser via 192.168.1.1 AND the router shows it as connected in the static ip 192.168.1.106, yet I cannot reach the internet
I tried setting default gateway to 192.168.1.1 but that doesn’t make a difference. Only dynamic ip works!
On 09/07/2012 02:46 PM, 6tr6tr wrote:
>
> ** When I set the ip to dynamic (gets it from DHCP) it connects to the
> internet! It’s when it’s static that it doesn’t work! What could be
> wrong?
>
> * When dynamic, it connects to the internet
> * When static, I can still reach the router in the browser via
> 192.168.1.1 AND the router shows it as connected in the static ip
> 192.168.1.106, yet I cannot reach the internet
>
> I tried setting default gateway to 192.168.1.1 but that doesn’t make a
> difference. Only dynamic ip works!
You likely did not set up routing correctly in YaST for the static case. Compare
‘/sbin/route -n’ for the static and dynamic cases.
On 09/10/2012 07:06 PM, 6tr6tr wrote:
>
> It worked! For anyone wondering what to do in the same situation:
>
> 1. Open YAST->Network Devices->Network Settings
> 2. Click the “Routing” tab
> 3. At the bottom of the tab window, click “add” under “Routing Table”
> 4. Enter the following settings:
>
>
> - Destination: 0.0.0.0
> - Gateway: 192.168.1.1 (NOTE: if your router is 192.168.2.1 or
> whatever, enter that)
> - Genmask: 0.0.0.0
> - (Leave “options” blank)
I trust you now know why you need that missing rule, but I will explain just in
case. Your routing table is as follows:
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
The first rule tells us how the local loopback is routed. We can ignore that.
The second rule tells how to route things to addresses 169.254.X.Y network, bur
you have nothing with an address like that, thus this rule is useless.
The 3rd rule tells how to reach addresses that are 192.168.1.X.
Now suppose you want to reach www.google.com. This resolves to a number of
addresses - one of them is 173.194.75.147. What rule above will tell eth0 how to
reach that address? The answer is “none”!
If we look at the missing rule, it is as follows:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
The “G” flag says that this rule is the one that is used whenever none of the
others apply. It says to use 192.168.1.1 as the gateway whenever no other rule
applies. In the router at 192.168.1.1, there is a similar table that uses your
ISP as the next stage, etc.
My internet connection stopped again in the VirtualBox install! I have no idea why. When I run “/sbin/route -n” I get the correct listing:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
And ifconfig shows the right ip address. Yet, after leaving the OS running for a few hours without touching it, it’s now not getting an internet connection! (NOTE: I can still reach the guest from the host in a web browser by using the ip address, it’s just inside the guest cannot get any internet)
And if I switch to using DHCP (inside the host) instead of static IP, it starts working again! And if I check on my router, it shows the guest if it’s connected via dynamic ip, but not if I use a static IP. Why is this? Could my router somehow be rejecting it? If so, why? It’s cable connected, not wifi.
I have an Ubuntu Guest in VirtualBox that works with a static IP. When I run the “route -n” command, I get almost the same thing but without the loopback 127 address:
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth2
Other than that, everything looks the same. How do I see why the Ubuntu works but openSUSE does not?
Not straight away. This all depends on how the networking in Vbox is set to be working, this per VM. In my VM’s I mostly use NAT and plain DHCP. If the configurations for both networking in VBox and networking in the VM’s are identical, I’d say it should work. Nothing *buntu or openSUSE specific in there, it’s plain linux.
They are different. I’ve bolded the differences (and I took out the loopback since they were both the same).
###### OPENSUSE GUEST ######
2: eth0: <**NO-CARRIER**,BROADCAST,MULTICAST,**UP**> mtu 1500 qdisc pfifo_fast state **DOWN** qlen 1000
link/ether 08:00:27:06:28:23 brd ff:ff:ff:ff:ff:ff
inet **192.168.1.135/24** brd **192.168.1.255** scope global eth0
valid_lft forever preferred_lft forever
**default via 192.168.1.1 dev eth0 **
127.0.0.0/8 dev lo scope link
169.254.0.0/16 dev eth0 scope link
**192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.135 **
###### UBUNTU GUEST ######
2: eth2: <BROADCAST,MULTICAST,UP,**LOWER_UP**> mtu 1500 qdisc pfifo_fast state **UP** qlen 1000
link/ether 08:00:27:e5:36:7d brd ff:ff:ff:ff:ff:ff
inet **10.0.2.15/24** brd **10.0.2.255** scope global eth2
valid_lft forever preferred_lft forever
**3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff**
**10.0.2.0/24 dev eth2 proto kernel scope link src 10.0.2.15 metric 1 **
169.254.0.0/16 dev eth2 scope link metric 1000
**default via 10.0.2.2 dev eth2 proto static **
You’ll notice that in addition to the differences between eth0 on opensuse and eth2 on Ubuntu (why is it called eth2?), there’s a vboxnet0 on Ubuntu that’s not on openSUSE
Hello every one,
If you are Unable to connect to internet in OpenSuse 12.2 then you are in the right place, and the solution was found!!!
I got the same problem, and I spend almost three days to know what is going on finally, the problem located in the DNS, and in a file name:
/etc/resolv.conf
/etc/resolv.conf.*// the * to state any file with this name
solution:
just delete the file through
rm /etc/resolv.conf.*// the * to state any file with this name
and rm/ /etc/resolv.conf
and then reboot the system and the internet connections will be automatically re-established with a new file name resolv.conf set to the default system configuration,
I hope that can help and tell me if you find that helpful lol!,
Regards,
Previously, the file had only the “192.168.1.1” and that should have worked but it didn’t. So I added in Google’s DNS’ (although you could use google’s (8.8.8.8 and 8.8.4.4), openDNS, or your ISP’s).
Now I’m able to access the gues OS from my host machine and also reach the internet from the guest OS!
Over the last several days I have been installing different distros in VirtualBox. My host is Kubuntu 12.04 with VirtualBox 4.1.12_Ubuntu r77245 linux.amd64 (Apr 2 2013 20:18:15). I have installed Debian, SolydK, Ubuntu, Linux Mint and several other distros. I’m using the same VirtualBox settings in all cases. Every one of these distros had an internet connection when it booted up (and for the ones that checked, the connection was even available during the installation).
However, openSuse (I installed 12.3) is the first to not have an Internet connection right out of the box. I read this entire thread and I hesitate to edit resolv.conf or do other things suggested here because I just want a working default network configuration using DHCP.
Can it be that all these other distros “just work” and openSuse does not? Truly, openSuse has the best installer I have seen, so I find it hard to believe that I must resort to editing text files to get the network connection working. I hope someone can explain what is happening here. Thanks.
P.S. Should I start a new thread? My experience was very similar to the OP, so I thought it might be best to continue this thread…