I'm running a virtual machine (VMWare/Fedora 12) on a server(host). The virtual machine has a running webserver on port 80, is on southpawtech network domain (different from the one on which the host is) and is also sharing a directory which can be accessed from \\ from the host by providing the password.

To access to webservice running on the virtual machine on the host machine's network I have setup this on the host machine:

netsh interface portproxy add v4tov4 listenport=1019 listenaddress=host connectport=80 connectaddress=

But how can I access the directory the virtual machine is sharing (I think using Samba) over the host's network?

Maybe something like specifying the port through which to make the UNC access so that I can use a variation of the above command to route it to the virtual machine, or something else.

  • Maybe forwarding 139 and 445 may work. I'd rather think of VPN or use a different protocol more NAT friendly. – LatinSuD Dec 5 '13 at 13:31
  • @LatinSuD Wouldn't that override the host's own file sharing? – Bleeding Fingers Dec 6 '13 at 11:30

Sounds to me like you have the virtual machine's vNIC bound to a host-only virtual network (used to just communicate from host -> VMs). Host-only networks aren't really intended for what you're doing here, and re-mapping the ports and having the host do some kind of NAT translation is overkill.

Why not just change the vNIC to a bridged configuration and assign it an IP on your host's network. (It will behave as if it were a physical machine directly connected to the host's network.) You could also add a second vNIC and use one for bridged, and one for host-only, if that's something you need.

Of course, if there is a reason why the VM needs to be on different network, then this isn't helpful. It doesn't sound like this is the case from your question, though.

| improve this answer | |
  • Worked. Don't know if this entitles another question but how does a virtual machine act as a physical machine? After all the host is connected to the network with one physical and IP address. How do packets get addressed to it? – Bleeding Fingers Dec 6 '13 at 14:05
  • 1
    @hus787 In a bridged configuration, the host puts traffic from the VM directly on the wire. This means packets from the VM hit the network and have the VM's IP and MAC address. At layer 2, the network switch you're connected to is seeing traffic coming from the VM's MAC address and the host's MAC address on a single port, and it doesn't know/care that either is a VM or a physical box. (There can be multiple 'destination' MAC addresses on a single switch port.) At layer 3, your host receives the packets for the VM and knows to hand packets for the VM's IP to the VM across the bridged config. – jlehtinen Dec 6 '13 at 15:26
  • Some of my false assumption and confusions are now fixed. Thanks. – Bleeding Fingers Dec 7 '13 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.