Which networking mode should I use?

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
hrichards
Posts: 5
Joined: 30. Jun 2013, 19:21

Which networking mode should I use?

Post by hrichards »

Which would be the best networking mode for running MS SQL Server 2005 in Windows XPSP3 as guest in VirtualBox on Mac OS 10.8.4? The host system will connect to the SQL Server using an ODBC driver.

I am currently running a system that resembles this one except that the SQL Server database is running on a separate machine connected to the would-be host by Ethernet LAN.

Thanks,

--hr
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Which networking mode should I use?

Post by mpack »

If in doubt - and your hardware supports it - then use bridged. If the SQL server is going to be queried over a network interface then you must use bridged. If only the host needs access the host-only mode may be enough.
hrichards
Posts: 5
Joined: 30. Jun 2013, 19:21

Re: Which networking mode should I use?

Post by hrichards »

Thanks for the suggestion, and for its promptness (on a Sunday, even!).

Since my guest system needs to communicate only with the host system, I've set up a host-only adapter, but I haven't been able to establish a connection between the host and the guest.

The ODBC driver I'm using requires the target machine to have a known IP address. In the LAN-connected two-computer system I'm trying to mimic, I've configured the Windows machine to get its IP address by DHCP, and the LAN router is set to assign the reserved IP address 10.0.1.250 (which is outside the router's normal DHCP range) to the Windows machine on the basis of its MAC address. That setup works perfectly.

So far I haven't discovered any VirtualBox equivalent of the LAN router's IP-address-reservation feature. I've tried two alternatives:

1. Guest is assigned its IP address automatically.
  • Host-only adapter 'vboxnet0'
    IPv4 address: 10.0.1.248
    IPv4 Network Mask: 255.255.255.0
    DHCP Server Enabled
    Server address: 10.0.1.249
    Server Mask: 255.255.255.0
    Lower Address Bound: 10.0.1.250
    Upper Address Bound: 10.0.1.250
The result is that the guest OS complains about "limited or no connectivity," and has
  • IP Address: 169.254.247.75
    Subnet Mask: 255.255.0.0
2. Guest is assigned fixed IP address 10.0.1.250
  • Host-only adapter 'vboxnet0'
    IPv4 address: 10.0.1.248
    IPv4 Network Mask: 255.255.255.0
    DHCP Server Disabled
This time the guest OS says it's connected and has IP address 10.0.1.250, but pinging 10.0.1.250 from the host OS fails.

Thanks for any suggestions,

--hr
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Which networking mode should I use?

Post by Perryg »

The host-only ip address scheme is 192.168.56.1 = host and 192.168.56 101.. for the guest using dhcp. You should be able to use any address after the .1.
You must not set a gateway address as host-only is not meant to access the Internet so no gateway.
hrichards
Posts: 5
Joined: 30. Jun 2013, 19:21

Re: Which networking mode should I use?

Post by hrichards »

Sorry, I'm not sure I understand.

Does "192.168.56.1 = host" mean that the host-only adapter's address is 192.168.56.1? Or is that supposed to be the DHCP server's address?

Presumably the DHCP server's lower address bound would be 192.168.56.101, right? And since the host-only network has only one guest, I can count on the guest's IP address being 192.168.56.101.

By the way, where could I have found this information about the host-only IP address scheme? And does it really work only with 192.168... addresses, and not 10.0... addresses?

Thanks,

--hr
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Which networking mode should I use?

Post by Perryg »

The .1 is the hosts IP.
.100 is the DHCP server
.101... is the DHCP range.
Yes it can be modified to fit your needs, just don't use a range that is on your LAN.
You can see what the adapter settings are for host-only in the preference section. From the main manager click file -> preference -> network.
hrichards
Posts: 5
Joined: 30. Jun 2013, 19:21

Re: Which networking mode should I use?

Post by hrichards »

Hmmm....

VB Manager's Network prefs:
Host-only networks: vboxnet0
Adapter: IPv4 Address: 192.168.56.1
IPv4 Network Mask: 255.255.255.0
DHCP Server: Enabled
Server Address: 192.168.56.100
Lower Address Bound: 192.168.56.101

Guest OS: "Limited or no connectivity"
Network Connection Details:
IP Address 169.254.247.75 (looks self-assigned)
Subnet mask: 255.225.0.0

Looks like I'm missing something. Thanks for your patience.

--hr
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Which networking mode should I use?

Post by Perryg »

169.254.247.75 is an APIPA address Windows assigns when it can't obtain an address from DHCP or other network failure issues.

If you setup the guest to use DHCP and it does not work, try a static address (no gateway)
Also make sure that you do not have a firewall issue.
hrichards
Posts: 5
Joined: 30. Jun 2013, 19:21

Re: Which networking mode should I use?

Post by hrichards »

YESSS!!!

Static IP address worked.

In case anyone else has this problem:

VirtualBox Manager/Preferences/Network:
vboxnet0 Adapter
IPv4 Address: 192.168.56.1
IPv4 Network Mask: 255.255.255.0
DHCP server: NOT enabled

Windows XP/Network Connections/Local Area Connection Status
Address Type: Manually Configured
IP Address: 192.168.56.101
Subnet Mask: 255.255.255.0
Default Gateway: [blank]
Windows Firewall ON
Exceptions include SQL Server Port 1433

Many thanks, Perryg!

--hr
Post Reply