You can make Samba inaccessible from the physical network interface.

1

Open the Samba configuration file (/etc/samba/smb.conf) in a text editor.

2

Add the interfaces parameter and set it to vmnet*.

For example: interfaces = vmnet*

3

Restart Samba.