Accessing Network Shares On The Host From The Guest

Discussions related to using VirtualBox on Windows hosts.
Post Reply
nhelder
Posts: 7
Joined: 30. Sep 2011, 18:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win2003, Win7, RHEL

Accessing Network Shares On The Host From The Guest

Post by nhelder »

Hi, all~

So, I'd like to be able to access a network share on my host (Windows 7 x64) from my guest (Windows 7 x86). I'm aware of shared folders via VirtualBox but would like to go this route instead.

I've installed a host-only network on the host and have configured the guest with both a bridged network adapter and a host-only network adapter. For purposes of my testing, within the guest I've disabled the bridged adapter.

The host-only IP configuration for the host is 192.168.56.1 / 255.255.255.0. In the guest the host-only IP configuration is 192.168.56.2 / 255.255.255.0.

The host can ping the guest at 192.168.56.2.
The guest can ping the host at 192.168.56.1.
For purposes of testing, I've disabled the Windows firewall on both OSes.

The host has File And Printer Sharing enabled on the host-only network (and not on it's actual, physical adapter).

However, if I attempt to access \\192.168.56.1\[share] from within the guest, I get:

Code: Select all

Windows cannot access \\192.168.56.1\[share]
Check the spelling of the name. Otherwise, there might be a problem with your network.
Advanced details for the error message are:

Code: Select all

Error code: 0x80070043
The network name cannot be found.
On the host, if I turn off file sharing on the host-only adapter and enable it on the physical adapter, I'm able to access the share from another machine on the physical network without issue.

...does anyone know what might be wrong here? Have others been able to get native Windows file shares working between a host and a guest?

Thanks in advance,

- Nathan
hawkeye62
Posts: 42
Joined: 4. Mar 2012, 00:07

Re: Accessing Network Shares On The Host From The Guest

Post by hawkeye62 »

Well, I have Windows 8 Pro 32 bit as guest on a Windows 7 Pro 64 bit host. I have the Windows 8 adapter set to Bridged. I can access the shared folder on the host from the guest. But I haven't been able to access the guest from host yet. It fails with a message that user and or password is unknown.

Good luck, Jim
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: Accessing Network Shares On The Host From The Guest

Post by BillG »

nhelder,

Why are you trying to access the share by the target's IP address? You should have full network sharing and be able to see it all in the Network GUI. And there is no need to disable the firewalls. Configuring file sharing opens all the necessary firewall ports.

If the host an guest are in the same network and the same IP subnet (as yours are) you have full networking between them and file sharing works just like two physical machines plugged into the same hub/switch. I suspect your problem is how you set up your networking or file sharing and nothing to do with VirtualBox.
Bill
nhelder
Posts: 7
Joined: 30. Sep 2011, 18:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win2003, Win7, RHEL

Re: Accessing Network Shares On The Host From The Guest

Post by nhelder »

Thanks for the replies, BillG and hawkeye62.

When initially attempting to find a solution to my issue, I came across a number of posts of folks with similar issues that got around them by adding in a second host-only adapter. But based on the feedback above (that a single bridged adapter should work fine) I've removed that second adapter from the guest and the host.

This leaves fairly simple network configurations - the host machine:

Code: Select all

C:\Windows\system32>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : host1
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
   Physical Address. . . . . . . . . : [removed]
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 10.0.0.3(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.224
   Default Gateway . . . . . . . . . : 10.0.0.1
   DNS Servers . . . . . . . . . . . : 10.0.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled
And the guest machine:

Code: Select all

C:\Windows\system32>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : nhelder1
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter LAN:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Red Hat VirtIO Ethernet Adapter
   Physical Address. . . . . . . . . : [removed]
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 10.0.0.4(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.224
   Default Gateway . . . . . . . . . : 10.0.0.1
   DNS Servers . . . . . . . . . . . : 10.0.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

...I'm using paravirtualized network drivers from http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/ on the guest, so that's why the description lists it a Red Hat adapter
On host1, there's a shared folder called "docs" - so, \\host1\docs is the shared location.

However, when I attempt to access that share from within the guest, I get the "The network name cannot be found" error message mentioned above.

...and that's why I started testing with IPs - if it was a host-name resolution issue like the error indicates, accessing the share directly via IP address would be a way to work around that. However, attempting to access \\10.0.0.3\docs from the guest results in the same error.

It's worth mentioning that both approaches - \\host1\docs and \\10.0.0.3\docs - work just fine when access from another physical machine on the network. So, it seems to be something specific with the VM... but I've not yet been able to figure out what.

...any ideas? - if there's more I can provide about my configuration that would help sort out what's going on, just let me know.

Thanks again,

- Nathan
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: Accessing Network Shares On The Host From The Guest

Post by BillG »

What happens if you disable all adapters except the host only adapter and set the guest to get its IP automatically? The guest should then get its network config from the built-in DHCP server in the host only adapter and everything should just work.

If it does not work, post the ipconfig from the guest. (It should have an IP like 192.168.56.101).
Bill
nhelder
Posts: 7
Joined: 30. Sep 2011, 18:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win2003, Win7, RHEL

Re: Accessing Network Shares On The Host From The Guest

Post by nhelder »

Hi, Bill~

Please have another look at my previous post; in it I show the ipconfig for both the host and the guest and describe that I've removed the host-only adapter after Hawkeye reported that Windows file sharing should work just fine over a birdged adapter...

Thanks,

- Nathan
nhelder
Posts: 7
Joined: 30. Sep 2011, 18:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win2003, Win7, RHEL

Re: Accessing Network Shares On The Host From The Guest

Post by nhelder »

As it turns out, I've narrowed down my issue to the "TCP/IP NetBIOS Helper" service having been set to Disabled in my guest... once that service was returned to Automatic and Started I was able to access my host's share from within the guest without issue.

Thanks for the replies - talking it out made me realize there must be something specific to the guest that was wrong and so I did a service-by-service comparison between the guest and the working physical box to narrow down the issue.

- Nathan
Post Reply