How to use Samba in LXD?

I want to share the Linux folder with Windows so I try to know how to create Samba.
Maybe there is better method than Samba. Have anyone try to share file though Samba?

Samba needs a number of ports to be exposed to the LAN. You can either open up all those ports, or expose the samba container to the LAN using either macvlan or bridge.

Another way (other than macvlan or bridge ) is using iptables rules.

  1. Know ports for samba or default port of samba .
  2. Use iptables .

This guide can help you :

Thank a lot of suggestion.
I could share my computer’s OS ubuntu14.04 with the other window10.
How could share this container which is created by OS ubuntu 14.04 with other windows 10?

Is it same way in ubuntu 14.04?

It should be no different between versions of the container images.

I could set iptable rule prerouting to container and samba can work.
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 137 -j DNAT --to IP:137
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 138 -j DNAT --to IP:138
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 139 -j DNAT --to IP:139
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 445 -j DNAT --to IP:445

How could I let my OS ubuntu 14.04 and its container share file via samba at the same time?
When I use this iptable rule my OS ubuntu14.0 could not share the file via samba, but its container could and i user this method the other container could not use samba to share file.
Should I use the other method to achieve this target?