help needed w/ vb network setup

This is for discussing general topics about how to use VirtualBox.
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

help needed w/ vb network setup

Post by edstevens »

I am looking for some additional explanation/help with setting up the networking for VB.

Previously, I have built a virtual computer lab on my Win7 laptop, using VMworkstation. Virtual machines were Oracle Linux and Win Server 2003. I set them all up with fixed IP addresses and using NAT to communicate with the outside world. My need for communication outside of the virtual net is for the virtual servers to be able to pull updates (mostly yum) from vendor sites, and also for client processes running on the host OS to communicate with server processes on the virtual machines.

Doing this with VMworkstation was quite easy. VMware created a net adapter on the host os, at 192.168.160.1. I gave the virtual servers addresses at 192.168.160.101 to 199, specified NAT, and everything seemed to 'just work'.

When I installed VB (on a different laptop, one that hasn't yet seen VMware), it created a net adapter of 192.254.57.101. I changed the '101' to simply, 1. Then I created a virtual machine using Oracle Linux. Again, I specified NAT and a fixed IP address of 192.254.57.101. (remember, the adapter on the host OS is now at 192.254.57.1). At this point, my very first test of a new machine has been to use Firefox to connect to the web, eventually going to Oracle's public yum server, but in this case I get 'server not found ... cannot find the server at google.com, etc etc.

ifconfig on the guest confirms the IP address I thought I had assigned it ... 192.254.57.101. A ping of the adapter address 192.254.57.1 returns 'host unreachable.

On the host os, a ping of the adapter address (192.254.57.1) returns 'request timed out'.

Some of the reading I've done so far seems to suggest that VB's definition/implementation of the various network configs (NAT, bridged, host-only, etc) has some fundamental differences from the same on VMware. So I am at a loss as to how to proceed at this point, other than shelling out $200 for VMworkstation.

Related quesiton ... I hadn't done an ipconfig on the host os prior to installing VB, but when I did as a part of working the above issue, I see that after the listing for the VB adapter (Ethernet adapter VirtualBox Host-Only Network:), there are four additional adapters, as follows:

Code: Select all

Tunnel adapter isatap.{D3A1FFA7-BF1E-4938-B01A-B8DFE49B3F7F}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.hsd1.tn.comcast.net.:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : hsd1.tn.comcast.net.

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{A62D8874-4A7C-4DDC-B640-2FF68B3255B9}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Users\ed>ping 162.254.57.1

Pinging 162.254.57.1 with 32 bytes of data:
Request timed out.
Any explanation of what those are?
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: help needed w/ vb network setup

Post by vbox4me2 »

Vbox NAT uses its own subnet thing which is the same per machine but separates them from each other, you need Bridge networking for this.
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

Thanks for the response.

My first thought about bridged is that it would expose my vm's directly to the internet, instead of hiding behind the host's ip address. Nevertheless, I tried it just to move forward. I made that change to my vm's config, and also noticed that in the definition of the virtual net adapter (Ethernet adapter VirtualBox Host-Only Network) that the subnet mask was set for 255.255.0.0. I corrected that to 255.255.255.0 and restarted my vm. When it came up, there was no change on it's end.

- a ping of the adapter address (169.254.57.1) from the vm returns 'destination host unreachable'
- a ping of the adapter address from the host gets a good reply
- a ping of the vm from the host gets 'destination host unreachable'.

Is there any significance to the fact that ipconfig on the host lists the adapter as "host-only"? I guess part of what I'm having trouble getting my head around is that it appears that VB installs only one adapter on the host, whereas VMware installs one for each type of networking (ie: an adapter for NAT, one for bridged, one for host-only)>
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: help needed w/ vb network setup

Post by BillG »

169.254.x.y/16 are APIPA addresses. A Windows machine will get an APIPA address if it is configured to get its IP address automatically but no DHCP server can be found. Are you sure that this happened on Host Only? That would be odd.

On the other hand, this would be likely to happen if you were using bridged mode and there was no DHCP server on the network. You canot use bridged mode successfully unless your host is running on a LAN with a DHCP server.
Bill
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: help needed w/ vb network setup

Post by vbox4me2 »

BillG wrote:You canot use bridged mode successfully unless your host is running on a LAN with a DHCP server.
Or assign the local addresses manually.
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

It's obvious there's something I "just don't get", but this was just so easy with VMware. First, let me reiterate what I see as being my end result:

Host OS is Win7 Home Premium 64-bit
Host has DHCP address (assigned by ISP ?)

Multiple guest OS's with a mix of Oracle Linux and Windows server 200x.
All guests can talk to each other.
All guests can reach public web sites, for download of patches, etc.
All guests have a fixed IP address
Host can talk to all guests - ssh, https, oracle sqlnet (tcp on ports 1521)

I re-installed VB and let it take all defaults. ipconfig on the host shows:

Code: Select all

C:\Users\ed>ipconfig

Windows IP Configuration


Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . : hsd1.tn.comcast.net.
   Link-local IPv6 Address . . . . . : fe80::288b:b879:5fc8:e17c%12
   IPv4 Address. . . . . . . . . . . : 192.168.1.106
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::f5ca:43d0:f524:9244%16
   IPv4 Address. . . . . . . . . . . : 192.168.139.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::94fa:296f:da15:4684%18
   IPv4 Address. . . . . . . . . . . : 192.168.198.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::88ba:31c5:5743:88a7%41
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
Since the VB adapter indicated an address of 192.168.56.1, I created a linux guest and specified its IP address as 192.168.56.101 with a default gateway of 192.168.56.1 and primary dns also at 192.168.56.1. I tried setting the net properties of the guest (on the Virtual Box Manager) variously at NAT (the default), bridged, and host-only, with these results:

NAT - a guest ping of the gateway returns 'host unreachable'.; host ping of guest returns 'Reply from 192.168.56.1: Destination host unreachable.'
bridged - guest ping of the gateway returns 'host unreachable'; host ping of guest returns 'Reply from 192.168.56.1: Destination host unreachable.'
host-only - guest ping of the gateway (adapter) just hangs, doesn't even return 'host unreachable'. Host can ping adapter AND the guest.

From the host OS, I'm always able to ping the VB adapter.
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: help needed w/ vb network setup

Post by BillG »

Perhaps you better stay with VMWare!

If you want to use VirtualBox you need to see how it works and set up your network accordingly. Trying to make it work like VMWare does will cause you a lot od frustration.
Bill
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: help needed w/ vb network setup

Post by Technologov »

His question is correct...

What is "isatap" ?
Really - I get this after I install vbox, but I have no idea what is it... it seems to be related to "host-only" network.

edstevens: What are you trying to achieve?

I tell you few things: In VBox, if you use 'NAT' -- it 'just works' -- in client use automatic IP via DHCP -- you will always get 10.0.2.15 IP address, and this always works.
If u want static IPs (192.x.x.x) -- use VBox 'bridge' mode.
Yes, VBox prolly has different network model than VMware -- in fact we even support 'UDP Tunnel' (aka VPN) at the hypervisor level. VMware do not.

In VBox:
Host<->Guest (NAT mode: guest always gets IP 10.0.2.15 via DHCP, static is impossible)
external Router<->Host<->Guest (Bridge mode: guest always gets IP from external router via DHCP, and using static IP is possible)

Now I *strongly* recommend you to start from vbox 'NAT' mode, as it is easiest *by far*. Just enable DHCP in guest OS. It just works.
NAT works only for desktops. They can reach internet. No one can reach them. Impossible to ping to guest in NAT mode.
Then, after u exp. with NAT, move to 'bridge' mode.
Bridge mode will let everyone ping everyone. ext.host to guest, host to guest, guest to guest. Think of a VM in 'bridge mode' is like attaching physical PCs to switch.

Does it help?
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

Perhaps you better stay with VMWare!

If you want to use VirtualBox you need to see how it works and set up your network accordingly. Trying to make it work like VMWare does will cause you a lot od frustration.
I'm not trying to make it work "like" vmware, but I am struggling with the differences and would like to overcome them. I bring vmware into the discussion just so people will know what my current frame of reference is. Hardly a day goes by that I don't see someone come to the Oracle DB forums, expecting Oracle to work like SQL Server, and accusing oracle of being "wrong". I'm consciously trying NOT to make that mistake. I have no doubt that VB is quite capable but I'm still on the low side of a learning curve. I'm sure it doesn't help that my network knowledge is only tangential to my database work.
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

Technologov
I tell you few things: In VBox, if you use 'NAT' -- it 'just works' -- in client use automatic IP via DHCP -- you will always get 10.0.2.15 IP address, and this always works.
That would be a problem. My intent is to have multiple virtual *servers* talking to each other. If I can't assign them a fixed IP, it's a non-starter.
If u want static IPs (192.x.x.x) -- use VBox 'bridge' mode.
But even that isn't working for me, somehow. I'd rather not have the guests expose their own IP beyond the host, but would be willing to give it a try if I could get it to work at all. See my post of yesterday when I experimented with NAT, bridged, and host-only.
Yes, VBox prolly has different network model than VMware -- in fact we even support 'UDP Tunnel' (aka VPN) at the hypervisor level. VMware do not.

In VBox:
Host<->Guest (NAT mode: guest always gets IP 10.0.2.15 via DHCP, static is impossible)
external Router<->Host<->Guest (Bridge mode: guest always gets IP from external router via DHCP, and using static IP is possible)

Now I *strongly* recommend you to start from vbox 'NAT' mode, as it is easiest *by far*. Just enable DHCP in guest OS. It just works.
NAT works only for desktops. They can reach internet. No one can reach them. Impossible to ping to guest in NAT mode.
Then, after u exp. with NAT, move to 'bridge' mode.
Bridge mode will let everyone ping everyone. ext.host to guest, host to guest, guest to guest. Think of a VM in 'bridge mode' is like attaching physical PCs to switch.

Does it help?
It sounds like, unless I am missing something (which I readily admit is quite possible) this may just not meet my requirements -- multiple guest servers must have unique, known fixed IP addresses. If this requires bridged instead of NAT in the VB world, then we need to focus on that and figure out why that doesn't work for me.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: help needed w/ vb network setup

Post by Technologov »

Try to understand what's wrong with bridged mode then.
All VMs are recommended to be bridged to same physical NIC.
Then config static IPs, and this should work. Check guests's firewalls, and optionally disable them.
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

OK, I set for bridged, set the guest ip at 192.168.56.101
adapter on host is at 192.168.56.1
What should my gateway address be? (Again, using vmware, if my adapter is at xxx.xxx.xxx.1, my gateway and dns on the guest need to be set to xxx.xxx.xxx.2, which seems a bit non-intuitive, but is what works).
Do I need to set a DNS address at all?

With the above, I dropped the firewall on the host, but guest still can't ping xxx.xxx.xxx.1 from the guest

Not sure how to check how the firewall on the guest might be impacting this.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: help needed w/ vb network setup

Post by Perryg »

@edstevens,
The addresses you show are VirtualBox host-only adapter addresses. If you set them manually as I suspect you did they will not work for you.

Just set the guest to use DHCP and your router will provide the necessary addresses for you.
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: help needed w/ vb network setup

Post by BillG »

You still have not grasped the essentials. 192.168.56 is the subnet used for the host only network. The IP address of the host only adapter (not a NIC) on the host is 192.168.56.1 . For a vm to contact the host using this adapter it needs a 192.168.56.x address, which is supplied by the built-in DHCP system. Do you have a particular reason for always wanting to use static IPs?

Bridged networking allows the guest to use the physical network to which the host machine is attached. The vm uses the physical NIC in the host machine. The bridging software allows this NIC to carry traffic for both host and guest. If you are using bridged mode the NIC in the vm will have an IP in the same network as your LAN machines (including the host). The gateway address would be the gateway router for the physical network (such as an ADSL firewall/router). If this device has a DHCP server, your vm can get its config automatically.

If your host machine is not connected to a physical network, bridged networking is not going to help you. If your host is a standalone machine which gets a public IP from an ISP, bridged networking is not for you. In this case your best option is NAT.

ISATAP and Toredo have nothing to do with VirtualBox. They are Windows IPv6 interfaces.
Bill
edstevens
Posts: 85
Joined: 10. Nov 2011, 00:36
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Oracle Linux; MS Server

Re: help needed w/ vb network setup

Post by edstevens »

BillG wrote:You still have not grasped the essentials. 192.168.56 is the subnet used for the host only network.
I understand that
The IP address of the host only adapter (not a NIC) on the host is 192.168.56.1 .
I understand that.
For a vm to contact the host using this adapter it needs a 192.168.56.x address,
I manually assigned 192.168.56.101, so should have been good, as far as that goes
which is supplied by the built-in DHCP system. Do you have a particular reason for always wanting to use static IPs?
Yes, I'm building multiple guests as database servers. Client processes running on each and on the host all need to be able to talk to any/all of the virtual machines. Can't do that if they never know what the IP address is going to be. Oracle databases don't like running on DHCP machines.
Bridged networking allows the guest to use the physical network to which the host machine is attached. The vm uses the physical NIC in the host machine. The bridging software allows this NIC to carry traffic for both host and guest. If you are using bridged mode the NIC in the vm will have an IP in the same network as your LAN machines (including the host). The gateway address would be the gateway router for the physical network (such as an ADSL firewall/router). If this device has a DHCP server, your vm can get its config automatically.

If your host machine is not connected to a physical network, bridged networking is not going to help you. If your host is a standalone machine which gets a public IP from an ISP, bridged networking is not for you. In this case your best option is NAT.
So it sounds like for my somewhat unique requirements, VB just isn't going to be the product I need. Please don't take this as a slam against VB (I know how defensive people can get about a product they've invested a lot of time in. I feel the same about Oracle when SQL Server people start getting dismissive of Oracle).

One last question, just to satisfy my curiosity ... throughout this thread, the advice has seemed to always get back to "use dhcp" - regardless of bridged or NAT. Under what circumstances or config, *would* one be able to use fixed IP's on their guest OS?
ISATAP and Toredo have nothing to do with VirtualBox. They are Windows IPv6 interfaces.
Post Reply