# HOWTO: Home Multimedia System using FreeBSD/Samba in a Raspberry and Kodi on the client



## joancatala (Jun 10, 2018)

My house is better than a cinema  As I will explain you, I can watch movies or listen to the music from a smartphone, table or my LG smartTV easily. You just need:

- Raspberry Pi 2 with FreeBSD 11 (for the Samba server)
- Dock station (with movies and music)
- Client for KODI (My Smartphone, my Tablet and another Raspberry Pi with Raspbian connected to my smartTV with a HDMI cable)
- SmartTV






First of all, I have a Raspberry Pi 2 with FreeBSD 11 and a Samba Server running. The Raspberry Pi has connected a dock (I bought in on Amazon, mainly because it is possible to clone them without a computer, just pressing a button, awesome! hehe) with 2 hardisks. I formated the disks with UFS format.

Each of the disks has 1TB. I clone them with rsyn on my root's crontab at 20:00 and at 23:00 every day:

`0 20,23 * * * rsync -uarmzhP --delete /mnt/disc1/ /mnt/disc2`






I installed Samba with *pkg install samba* and I configured it just editing */usr/local/etc/smb4.conf* and adding:

`[global]
workgroup = WORKGROUP
server string = Server
security = user
encrypt passwords = yes
max log size = 500
preferred master = yes
hosts allow = 192.168.1.
interfaces = ue0
bind interfaces only = yes
socket options = TCP_NODELAY
max protocol = SMB2
ntlm auth = yes

[disc1]
comment = Disc1
path = /mnt/disc1
public = no
writeable = yes
write list = [USER=1]admin[/USER]
directory mask = 0770
create mask = 0770`

You can start/stop/restart your Samba server by:

`# /usr/local/etc/rc.d/samba_server stop
# /usr/local/etc/rc.d/samba_server start`

Now, you have the Samba server configured. Now you need a client.... a tablet, a smartphone or a PC. In my case, the client sometimes is my Android Smartpohone, and also I have another Raspberry Pi (with Raspbian Linux). You can open the file explorer and try to connect to your files by Samba: *smb://USER@SERVER/MOUNTED_PATH*





You can find your if your mounted directories are fine just by:

`smbclient -L SAMBA_SERVER`


And I installed KODI (*apt-get install kodi*) and you can open KODI, go to VIDEOS and add a Samba Server.





I configured my samba's user/password on KODI. This configuration is the same for all your clients, because you are supposed to use KODI on the tablet, smartphone or PC client, aren't you?





(I WANTED TO ADD MORE PHOTOS, BUT THE FORUM DOES NOT ALLOW ME).

So, finally you will see all your movies, saved on your hard disk, on KODI, and you will be able to watch them at home easily.

If you want to see more photos, I wrote a post about this (in catalan language): http://jcatala.net/ca/node/1339

I hope you like the idea and you'll share your own experiments with FreeBSD and KODI ;-)

salut!


----------

