Creating network with Host-only Adapter.

Discussions related to using VirtualBox on Windows hosts.
Post Reply
zsycho
Posts: 5
Joined: 29. Dec 2012, 11:21

Creating network with Host-only Adapter.

Post by zsycho »

Hii everyone, this is my first post here and hoping to get the resolution to the issue I am facing.

I created 2 ubuntu VMs on Win 7 host.

Adapter 1 as NAT
Adapter 2 as Host-only

I am able to connect to the internet on both VMs and also able to ping 192.168.56.1 (Windows host)

but when I try to ping my other VM, I receive duplicate (DUP!) ping response.

Code: Select all

root@xhase-VirtualBox:~# ping 192.168.56.143
PING 192.168.56.143 (192.168.56.143) 56(84) bytes of data.
64 bytes from 192.168.56.143: icmp_req=1 ttl=64 time=1.66 ms
64 bytes from 192.168.56.143: icmp_req=1 ttl=63 time=2.21 ms (DUP!)
From 192.168.56.1: icmp_seq=2 Redirect Network(New nexthop: 192.168.56.143)
64 bytes from 192.168.56.143: icmp_req=2 ttl=64 time=0.688 ms
64 bytes from 192.168.56.143: icmp_req=2 ttl=63 time=0.701 ms (DUP!)
64 bytes from 192.168.56.143: icmp_req=2 ttl=64 time=0.717 ms (DUP!)
64 bytes from 192.168.56.143: icmp_req=2 ttl=63 time=0.731 ms (DUP!)
Both the VMs are assigned static IP (192.168.56.101 and 192.168.56.143)

I am able to ssh the VM. Also I need to host apache webserver on one of the guest and access it from host.

Can someone help me with setting up my network? or let me know the cause of issue I am facing with duplicate pings?

Thanks in advance.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Creating network with Host-only Adapter.

Post by noteirak »

Code: Select all

From 192.168.56.1: icmp_seq=2 Redirect Network(New nexthop: 192.168.56.143)
Your answer is here, the host is doing funny things and resending the packets.
You got something going on in your Windows 7.
What is your LAN address? Did you change anything into the windows 7 networking?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
zsycho
Posts: 5
Joined: 29. Dec 2012, 11:21

Re: Creating network with Host-only Adapter.

Post by zsycho »

I doubt if I did any networking changes on Win 7 other than enabling ping echo request which are disabled by default in windows vista / 7.

I tried disabling that , but no changes. still duplicates.

VirtualBox Host-Only Network IP address is: 192.168.56.1 with no default gw (as default)

LAN IP address is: 169.254.110.146

I connect to internet through PPPOE and get public address from there.


Is there something missing in the routing table of VMs?

Code: Select all

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     0      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
Thanks!!
H.Z.
Posts: 23
Joined: 28. Dec 2012, 16:41
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux
Location: Budapest

Re: Creating network with Host-only Adapter.

Post by H.Z. »

Stop the "Routing and Remote Access" service on your host if you don't need it!
(I've tried to start it, because I thought it will help to route packets from LAN to host only network, and I experienced same as you...)
zsycho
Posts: 5
Joined: 29. Dec 2012, 11:21

Re: Creating network with Host-only Adapter.

Post by zsycho »

Sorry to say but that service was already disabled :(.

Now what I am not able to understand is:

If both the systems are on same network (192.168.56.0), should the packet be sent to host(192.168.56.1) which then redirects to destination VM?

I think there is some problem with this route >>

Code: Select all

192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 eth1
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Creating network with Host-only Adapter.

Post by noteirak »

I see two issues :
the 169.254.x.X ip address is only assigned if an interface is expected a DHCP but received no offer and thus no address
The 192.168.56.x ip address shouldn't be via the default gateway, since it should be an interface of your VM

You will need to setup properly your network before going further. If you are not able to do this on your own, you should seek local support, as only Virtualbox support is given on this forum.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Creating network with Host-only Adapter.

Post by BillG »

I would not use Host Only for this. If you want the guests to communicate with each other I would put then in an internal network. They do not need to access the host through this interface.

The guests will use the NAT interface to access the physical network and the Internet but the internal network to communicate with each other. Just give them IP addresses in the same IP subnet on the internal interfaces.
Bill
zsycho
Posts: 5
Joined: 29. Dec 2012, 11:21

Re: Creating network with Host-only Adapter.

Post by zsycho »

BillG wrote:I would not use Host Only for this. If you want the guests to communicate with each other I would put then in an internal network. They do not need to access the host through this interface.

The guests will use the NAT interface to access the physical network and the Internet but the internal network to communicate with each other. Just give them IP addresses in the same IP subnet on the internal interfaces.
Thanks for your suggestion, but still got 1 question. Will the guest be able to communicate with the host? coz I need to host apache webserver on one of the guest and access it via host.

I used Host-only because I read it somewhere that to able to communicate between host and the guest, Host-only adapter should be used.

Thanks for your responses !!
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Creating network with Host-only Adapter.

Post by noteirak »

If you need the guest and host to communicate directly, then NAT cannot be used.

Either use Host-only or Bridged
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
zsycho
Posts: 5
Joined: 29. Dec 2012, 11:21

Re: Creating network with Host-only Adapter.

Post by zsycho »

noteirak wrote:If you need the guest and host to communicate directly, then NAT cannot be used.

Either use Host-only or Bridged
Shouldn't I need to use NAT as one of the guest interface to allow my guests to communicate with the external world (internet)?

Thanks!
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Creating network with Host-only Adapter.

Post by noteirak »

This can be done via Host-only (be requires routing on the host) or Bridged, so you're good.
For the exact details on how to setup your guests & hosts from the OS persepective, that is beyond the scope of this forum though.

Easiest mode for what you want : Bridged.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
jorgensen
Posts: 589
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Creating network with Host-only Adapter.

Post by jorgensen »

noteirak wrote:If you need the guest and host to communicate directly, then NAT cannot be used.
Either use Host-only or Bridged
Actually it is possible to reach the host from the guest with a standard NAT setting.
Post Reply