Page 1 of 2

internet connection issue

Posted: 16. Jan 2013, 05:04
by automatix1311
Hello!

In my VirtualBox "live" three VMs:
192.168.56.101 Dev VM Debian 6 + Gnome Adapter 1 Nat Adapter 2 Host-only
192.168.56.102 Sandbox VM Debian 6 Adapter 1 Nat Adapter 2 Host-only
192.168.56.103 Example VM Debian 6 + Gnome Adapter 1 Nat Adapter 2 Host-only
Sandbox ist my oldest VM. Today I've noticed, that I cannot connect to the internet on it anymore. And on the Example VM as well. The only VM, that is able to connect outwards is the Dev VM.

Does somebody have an idea, what the problem can be?

Thx

EDIT:

System information:
  • VirtualBox Version: 4.2.6
  • Host: Windows 7 64 bit
  • Guests (alls the three): Debian 6.0.6 64 bit
  • Log files: attached

Re: internet connection issue

Posted: 16. Jan 2013, 10:00
by noteirak

Re: internet connection issue

Posted: 16. Jan 2013, 14:23
by automatix1311
Oh, OK, thank you for the hint! I'e updated my post.

Re: internet connection issue

Posted: 16. Jan 2013, 16:07
by Perryg
Assuming these are clones I would check the Mac address of each and make sure they are unique.

Re: internet connection issue

Posted: 16. Jan 2013, 16:12
by automatix1311
Perryg wrote:Assuming these are clones I would check the Mac address of each and make sure they are unique.
Thank you for reply! Already checked -- the MACs are unique.

Re: internet connection issue

Posted: 16. Jan 2013, 16:31
by Perryg
All three are using the same 10.0.2.15 address, which I would thing would be 10.0.2.* 10.0.3.* & 10.0.4.*
try running dhclient in the guests and see if it will renew the addresses correctly.

Re: internet connection issue

Posted: 16. Jan 2013, 21:14
by automatix1311
Update:

I've killed the third VM (Example VM) and created it again. Now Dev VM and Example VM are working fine. Both -- internet with NAT and communication with the Host -- is working fine. Only the Sandbox VM isn't working. I've checked the routing table of my VMs and noticed, that on the Sandbox VM the routing table is empty:
root@devmv:/var/log/nginx# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.56.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
root@devmv:/var/log/nginx#
root@examplevm:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.56.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
root@examplevm:~#
root@sandboxvm:~# route -n
root@sandboxvm:~#
So, the problem still has not been resolved. But currently I cannot reproduce it the issue.

Re: internet connection issue

Posted: 16. Jan 2013, 22:55
by automatix1311
I think I've found the cause, why my VM(-s) could go outside. It seems to be due a wrong configuration of the /etc/network/interfaces.

As I've already said, lastly only the Sandbox VM didn't an internet access. Then I've just disabled the eth1 part in the /etc/network/interfaces:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#NetworkManager
iface eth0 inet dhcp

## The secondary network interface
#auto eth1
#iface eth1 inet static
#	address 192.168.56.102
#	netmask 255.255.255.0
#	gateway 192.168.56.1
And now I can access the internet from the Sandbox VM. When I enable the eth1 again, I cann access the VM over the static IP 192.168.56.102, but cannot go online.

What is wrong in my configuration? How can I NAT and Host-only?

Re: internet connection issue

Posted: 16. Jan 2013, 23:40
by noteirak
First step : Use DHCP for NAT & Host-Only, do not use any static IP address

Re: internet connection issue

Posted: 16. Jan 2013, 23:46
by automatix1311
Thank you for your reply, but it doesn't give me an answer to my question. How should I define the interfaces?

And why should I not use static IPs?

Re: internet connection issue

Posted: 17. Jan 2013, 00:27
by noteirak
automatix1311 wrote:Thank you for your reply, but it doesn't give me an answer to my question. How should I define the interfaces?
It does - configure them as DHCP mode, not static.
automatix1311 wrote:And why should I not use static IPs?
Because NAT & Host-Only are made to work as DHCP server per default, and if you don't configure the Virtualbox side correctly, and just the Guest OS, you will most likely run into connection issues.

Also, to answer your other thread (here), make sure the interfaces are enabled into the VM config window AND in the guest - that would be why your routing table is empty.

Re: internet connection issue

Posted: 17. Jan 2013, 18:02
by automatix1311
noteirak wrote:
automatix1311 wrote:Thank you for your reply, but it doesn't give me an answer to my question. How should I define the interfaces?
It does - configure them as DHCP mode, not static.
Not, it doesn't, since the question was about the configuring of the /etc/network/interfaces in the given situation with static IPs -- and not, whether static IPs should be used or not.
noteirak wrote:
automatix1311 wrote:And why should I not use static IPs?
Because NAT & Host-Only are made to work as DHCP server per default, and if you don't configure the Virtualbox side correctly, and just the Guest OS, you will most likely run into connection issues.
That does not mean for me, that I should not use static IPs. That only means, that I have to configure the VB side correctly. OK, maybe you can and want to help me with it?

Here my configs:

1. Adapter 1: NAT with the default settings

2. Adapter 2: Host-Only with the default settings and referred to the "VirtualBox Host-Only Ethernet Adapter"

3. [VB menu] → File → Preferences… → Network → VirtualBox Host-Only Ethernet Adapter
VirtualBox-Settings-Network-HostOnlyNetwork-Adapter.png
VirtualBox-Settings-Network-HostOnlyNetwork-Adapter.png (34.57 KiB) Viewed 4525 times
VirtualBox-Settings-Network-HostOnlyNetwork-DHCPServer.png
VirtualBox-Settings-Network-HostOnlyNetwork-DHCPServer.png (35.06 KiB) Viewed 4525 times
Is something wrong?
noteirak wrote:Also, to answer your other thread (here), make sure the interfaces are enabled into the VM config window AND in the guest - that would be why your routing table is empty.
OK. Enabling in the in the VM config window means, what I'm writing above about (Adapters), right? What do you mean with enabling of the interfaces in the guest? How can I do it?

To my other topic: It's not "simply a copy paste" of this conversation. It's a thread only about an issue with adding a route. OK, you are right, when you say, it "should be redirected to appropriate support forums". But I was not sure, whether the it is a specific Linux/Debian question or not.

Re: internet connection issue

Posted: 17. Jan 2013, 18:17
by Perryg
You can use the host only without dhcp. Post the results of ifconfig -a from the non-working guest.

Re: internet connection issue

Posted: 17. Jan 2013, 18:33
by noteirak
automatix1311 wrote:Not, it doesn't, since the question was about the configuring of the /etc/network/interfaces in the given situation with static IPs -- and not, whether static IPs should be used or not.
Correct, you want to use static IP, and that's the final goal. Right now, there an issue somewhere. Step 1 is put a default config and see if it works. If it works, you can go to the next step - static IP. But you cannot troubleshoot more than one issue at the time, or you won't be able to know what actually stops it from working.
automatix1311 wrote:That does not mean for me, that I should not use static IPs. That only means, that I have to configure the VB side correctly. OK, maybe you can and want to help me with it?
Exactly what I am doing.
automatix1311 wrote:Is something wrong?
Nothing is wrong, something is just not working at some point.
automatix1311 wrote:OK. Enabling in the in the VM config window means, what I'm writing above about (Adapters), right? What do you mean with enabling of the interfaces in the guest? How can I do it?
This is out of scope of the forum - I would suggest you to look into li,nux dedicated support sites about the basic use first.
To my other topic: It's not "simply a copy paste" of this conversation. It's a thread only about an issue with adding a route. OK, you are right, when you say, it "should be redirected to appropriate support forums". But I was not sure, whether the it is a specific Linux/Debian question or not.
It is a network question (for the routing table inner working) and a Linux/debian question (for the precise commands).

To sum this up : I am happy to help you fix your issue, but you need to take this step by step.
1. Try with default settings
2. Then AND ONLY THEN try to change from a DHCP mode to a static IP mode.

Also, as much as I am happy to help you with virtualbox support, basic networking and basic linux/debian support is way out of scope of this forum.
I am also a strong believer that if you insist any non-default value, you better know how everything works behind the scenes. Virtualbox is a great tool with lots of power behind, but you do need to do your homework.

Re: internet connection issue

Posted: 18. Jan 2013, 16:58
by automatix1311
noteirak wrote:
automatix1311 wrote:Not, it doesn't, since the question was about the configuring of the /etc/network/interfaces in the given situation with static IPs -- and not, whether static IPs should be used or not.
Correct, you want to use static IP, and that's the final goal. Right now, there an issue somewhere. Step 1 is put a default config and see if it works. If it works, you can go to the next step - static IP. But you cannot troubleshoot more than one issue at the time, or you won't be able to know what actually stops it from working.
I think, we misunderstood each other, since I thought, you meaned that I should not use static IPs at all. It's great, that we have cleared this misunderstanding. :) Thank you for your help!

So, let's begin from the beginning...

Just to sum the current/broken state:
  • Three VMs (Dev, Sandbox, and Example) with static IPs (192.168.56.101, 192.168.56.102, and 192.168.56.103)
  • For each VM two network adapters are set: a NAT and a Host-Only adapter.
  • Staic IPs (the Host-Only adapter is using the default network "VirtualBox Host Ethernet Adapter" with disabled DHCP server settings)
  • Dev and Example have been set over GUI (Applications → System Tools → Network Tools etc.). Sandbox doesn't have a GUI and was set up in the /etc/network/interfaces
  • Dev and Example are working fine -- both have access to outside and can be reached via IP from the host. Sandbox isn't working: It has internet connection, only if the eth1 (for Host-Only) is deactivated in the /etc/network/interfaces.
  • You can see some system information of all the three VMs here:
    sysinfo 01.zip
    (5.8 KiB) Downloaded 8 times
    • /etc/network/interfaces
    • ifconfig
    • ifconfig -a (@Perryg here we come)
    • route -n
Now I've enabled DHCP in the network ("VirtualBox Host Ethernet Adapter") settings:
Server Address: 192.168.56.100
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.56.101
Upper Address Bound: 192.168.56.254

... and see, what happens...

First I've restarted all my VMs and even the computer (windows user... :)). No changes. Then I've restarted my cable modem and tested everything again. And now... it is working: both the internet access and the access from the host over IP -- for all the three VMs. :) Perhaps I should be just happy about it, but I don't understand, how it can work. Why the IPs are still the same, although I've changed the main setting for it on the VB side and started the VMs in several different orders.

I'm posting here the sysinfo after the cabel modem restart:
sysinfo 02.zip
(5.83 KiB) Downloaded 7 times
But I've just rompared the files with Beyond Compare and not found any significant changes.

Can you/somebody explain me, why/how it's working now?

Thanks

EDIT:

And now I've switched to the "static IP mode" (disabled DHCP in the "VirtualBox Host Ethernet Adapter" network settings) and the issue is back: Dev and Example are working fine and Sandbox cannot connect to the internet.