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

Discussions related to using VirtualBox on Windows hosts.
Post Reply
justin_th
Posts: 2
Joined: 12. Jun 2015, 14:04

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

Post 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
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

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

Post by noteirak »

NAT won't play nice here. I would suggest to use "Host-Only" which doesn't leak outside of the host environment.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
justin_th
Posts: 2
Joined: 12. Jun 2015, 14:04

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

Post 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?
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: Samba share from Win Host to Ubuntu guest (with NAT)

Post by mpack »

The traditional solution is to have two NICs in the VM. One NAT and the other host-only.
Post Reply