Page 1 of 1

Samba share from Win Host to Ubuntu guest (with NAT)

Posted: 12. Jun 2015, 14:18
by justin_th
Hello,

i want to connect from my windows 7 host System to a shared folder of my Ubuntu guest system.

The Problem ist that i have to use NAT for the Network connection, because my Guest System and Host System must have the same IP Address.

So i have created the port forwarding and opened all ports for using samba:

Code: Select all

sudo netstat -tulpn | egrep "samba|smb|nmbd|winbind"
Output:

Code: Select all

tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      1829/smbd       
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      1829/smbd       
tcp6       0      0 :::139                  :::*                    LISTEN      1829/smbd       
tcp6       0      0 :::445                  :::*                    LISTEN      1829/smbd       
udp        0      0 10.0.2.255:137          0.0.0.0:*                           1809/nmbd       
udp        0      0 10.0.2.15:137           0.0.0.0:*                           1809/nmbd       
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1809/nmbd       
udp        0      0 10.0.2.255:138          0.0.0.0:*                           1809/nmbd       
udp        0      0 10.0.2.15:138           0.0.0.0:*                           1809/nmbd       
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1809/nmbd       
From the Guest to Host with "smb://" is no problem...

Hint:
On the client i have running a jboss on port 8080 and a liferay with tomcat on port 8090 and i can access these servers from my host system. So the port forwarding is working fine...
Just for testing that my shared folder is accessable, i have changed the network mode to bridged and then i was able to access it.

Am i missing anything or is Samba from host to guest just not possible with a NAT Network Connection?!

Thanks for your time and help!

best regards
Justin

Re: Samba share from Win Host to Ubuntu guest (with NAT)

Posted: 12. Jun 2015, 17:01
by noteirak
NAT won't play nice here. I would suggest to use "Host-Only" which doesn't leak outside of the host environment.

Re: Samba share from Win Host to Ubuntu guest (with NAT)

Posted: 15. Jun 2015, 08:07
by justin_th
Okay with host only i can access the shared folder but the guest system can't connect to the Network and www -.-

Maybe another solution?

Re: Samba share from Win Host to Ubuntu guest (with NAT)

Posted: 15. Jun 2015, 09:29
by mpack
The traditional solution is to have two NICs in the VM. One NAT and the other host-only.