Community discussions

MikroTik App
 
massinia
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Thu Jun 09, 2022 7:20 pm

DLNA container

Sat Feb 11, 2023 8:55 pm

Sorry for the stupid question...
Is it possible to use a container like this with the hAP ac 2?
https://hub.docker.com/r/vladgh/minidlna/

Obviously with an ext4 formatted usb hdd.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Sun Feb 12, 2023 8:43 pm

Sure, if you look at "tags" and something has "linux/arm/v6", it should work – yes, assuming an external disk (or potentially ROSE).

You should be able to follow the Pi-Hole example in the docs EXCEPT...

- just use "vladgh/minidlna" as remote image.

- for the "mounts" use:
/media to your RouterOS disk path

- for env variables add:
MINIDLNA_MEDIA_DIR /media
MINIDLNA_FRIENDLY_NAME=MikrotikMiniDLNA

- for the networking, skip adding the "docker" bridge, instead just add the created VETH to the existing LAN bridge

- when creating the VETH for minidlna... use an unused IP address from your LAN (e.g. 192.168.88.8/24 and 192.168.88.1 as VETH gateway if your using default LAN), and use the Mikrotik's LAN IP address as the gateway
Last edited by Amm0 on Sat Jul 01, 2023 4:00 am, edited 2 times in total.
 
massinia
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Thu Jun 09, 2022 7:20 pm

Re: DLNA container

Mon Feb 13, 2023 11:40 am

Thank you, it works perfectly!

I got the mount directory wrong, must be /minidlna

Image

I can't change minidlna root_container value to B but that's another story...

EDIT: fixed with env "MINIDLNA_ROOT_CONTAINER=B"

Thanks again
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Mon Feb 13, 2023 3:36 pm

Great!

Let us know how it goes. I'm sure you'll like not be the only one requesting this one...

One note... v7.8rc1 supports "ROSE" (see https://help.mikrotik.com/docs/display/ROS/ROSE-storage). This adds RAID and NFS/iscsi clients and servers, so your minidlna container here should be able to operate on a remote file share and/or any RouterOS connected disks can be raid'ed. This obviously become useful when your start having media files to serve over DLNA.
 
massinia
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Thu Jun 09, 2022 7:20 pm

Re: DLNA container  Topic is solved

Mon Feb 13, 2023 4:36 pm

One note... v7.8rc1 supports "ROSE" (see https://help.mikrotik.com/docs/display/ROS/ROSE-storage).
Unfortunately I can't use it because hAP ac2 doesn't have enough space in the flash.
Let us know how it goes. I'm sure you'll like not be the only one requesting this one...
Sure!
I read this guide carefully and luckily I understand how containers work.
https://help.mikrotik.com/docs/display/ROS/Container

Summing up...

I create a new VETH interface with a new IP address of my LAN
Please note that I use 192.168.11.0/24 and not 192.168.88.0/24, so change the IP address according to your LAN
minidlna_1.png
I added veth1 to the main bridge
minidlna_2.png
I inserted a usb hdd and formatted it in ext4 with no partitions.

I can't stand clutter so I created a folder for containers, one for container data and one for media.
minidlna_4.png
minidlna_5.png
minidlna_6.png
I shared only the media folder with smb so everyone can add movies but no one can edit the container files.
You do not have the required permissions to view the files attached to this post.
 
NicoBellic
just joined
Posts: 2
Joined: Thu May 04, 2023 1:48 pm

Re: DLNA container

Mon May 22, 2023 1:55 am

Hi, dear massinia!

I did everything according to your instructions, but I have a problem with permissions, if I add films via SMB.

MikroTik:/Films# ls -l
total 3047816
-rwxr-xr-x 1 nobody nobody 3117904332 May 21 22:12 Film1.mkv


It works before first reboot. And container can't started with message in log chown: /minidlna/Films/Film1.mkv: Operation not permitted

How can I fixed permissions? Why user and group nobody:nobody? I think that must be minidlna:minidlna.
 
massinia
Member Candidate
Member Candidate
Topic Author
Posts: 159
Joined: Thu Jun 09, 2022 7:20 pm

Re: DLNA container

Tue May 23, 2023 9:36 am

Hi, dear massinia!

I did everything according to your instructions, but I have a problem with permissions, if I add films via SMB.

MikroTik:/Films# ls -l
total 3047816
-rwxr-xr-x 1 nobody nobody 3117904332 May 21 22:12 Film1.mkv


It works before first reboot. And container can't started with message in log chown: /minidlna/Films/Film1.mkv: Operation not permitted

How can I fixed permissions? Why user and group nobody:nobody? I think that must be minidlna:minidlna.
Hi, I specified that the files inside the container shouldn't be modified.
one folder for container data and one folder for media.
You don't need to change permissions, don't put the movie folder inside the container folder.
 
NicoBellic
just joined
Posts: 2
Joined: Thu May 04, 2023 1:48 pm

Re: DLNA container

Wed May 24, 2023 10:41 am

You don't need to change permissions, don't put the movie folder inside the container folder.
Yes, I made a mistake on this point. Thank you. Now it works great.
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 7:51 pm

Help to configure. The server starts and immediately stop.
Image
Image
Image
Last edited by nabus on Thu Aug 10, 2023 7:59 pm, edited 2 times in total.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Thu Aug 10, 2023 8:32 pm

Check the "Logging" box, then try to start it. The log should have some clues on what's going on.

Also post the results from a ":export" at the terminal if you can.
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 9:03 pm

Log noted.Where can I watch it?
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 9:23 pm










MMM MMM KKK TTTTTTTTTTT KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK

MikroTik RouterOS 7.10.2 (c) 1999-2023 https://www.mikrotik.com/

Press F1 for help




[admin@MikroTik] > export
# 2023-08-10 21:22:46 by RouterOS 7.10.2
# software id = IZLE-ES5A
#
# model = RBD52G-5HacD2HnD
# serial number = E5780E89B9DB
/interface bridge
add admin-mac=2C:C8:1B:EE:86:3F auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether1 ] mac-address=04:5E:A4:C9:E0:00
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
disabled=no distance=indoors frequency=auto installation=indoor mode=\
ap-bridge ssid=Mikro wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX \
disabled=no distance=indoors frequency=auto installation=indoor mode=\
ap-bridge ssid=MikroTik wireless-protocol=802.11
/interface veth
add address=192.168.88.11/24 gateway=192.169.88.1 name=veth1
/container mounts
add dst=/minidlna name=DLNA src=/usb1-part1/router-serv/minidlna-data
add dst=media name="DLNA MEDIA" src=/usb1-part1/media
/disk
set usb1 type=hardware
add parent=usb1 partition-number=1 partition-offset=512 partition-size=\
"15 634 300 416" type=partition
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
/container
add envlist=DLNA interface=veth1 mounts="DLNA,DLNA MEDIA" root-dir=\
usb1-part1/router-serv/containers/minidlna start-on-boot=yes
/container config
set registry-url=https://registry-1.docker.io tmpdir=usb1-part1/tmp
/container envs
add key=MINIDLNA_MEDIA_DIR name=DLNA value=/media
add key=MINIDLNA_FRIEDLY_NAME name=DLNA value=minidlna
add key=MINIDLNA_ROOT_CONTAINER name=DLNA value=MBp
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
add bridge=bridge disabled=yes interface=ether1
add bridge=bridge interface=veth1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=ether1 list=WAN
add interface=bridge list=LAN
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0
/ip dhcp-client
add comment=defconf interface=bridge
add interface=ether1
/ip dhcp-server network
add address=0.0.0.0/24 comment=defconf dns-server=0.0.0.0 gateway=0.0.0.0 \
netmask=24
add address=192.168.88.0/24 dns-server=192.168.88.1 gateway=192.168.88.1 \
netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=\
invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" \
connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=\
out,none out-interface-list=WAN
add action=masquerade chain=srcnat src-address=172.17.0.0/24
/ip smb
set enabled=yes
/ip upnp
set enabled=yes
/ip upnp interfaces
add interface=veth1 type="(unknown)"
add interface=bridge type=internal
add interface=ether1 type=external
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMPv6" protocol=icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=!LAN
add action=accept chain=forward comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=\
invalid
add action=drop chain=forward comment="defconf: drop packets with bad src ipv6" \
src-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: drop packets with bad dst ipv6" \
dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=!LAN
/system clock
set time-zone-name=Europe/Kiev
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
[admin@MikroTik] >
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Thu Aug 10, 2023 9:34 pm

Log noted.Where can I watch it?
Well "Log" on left in winbox... or but from New Terminal easier to cut-and-paste here ;)...

/log print where topics~"container"
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Thu Aug 10, 2023 9:38 pm

You have a typo on the VETH gateway...
/interface veth
add address=192.168.88.11/24 gateway=192.169.88.1 name=veth1

That should be "192.168.88.1" not 192.169...

Also, you don't need the veth1 in /ip upnp, since it already part of the "bridge", it doesn't need to be listed.
/ip upnp interfaces
add interface=veth1 type="(unknown)"
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 9:45 pm

[admin@MikroTik] > /log print where topics~"container"
20:21:04 container,info,debug removing files, container ea4eee61-aadc-4ebd-95e9-12559c36a670
20:31:51 container,info,debug importing remote image: vladgh/minidlna, tag: latest
20:31:54 container,info,debug getting layer sha256:487e2b03bf21cee5114358865c5f238ace7f45a96
10894c7b35f40f604c07fb1
20:32:00 container,info,debug layer sha256:487e2b03bf21cee5114358865c5f238ace7f45a9610894c7b
35f40f604c07fb1 downloaded
20:32:03 container,info,debug getting layer sha256:5860ffff0c012e63b2ae5e7fa22141c412415e7f9
ddf291acacba37d88ff2974
20:32:23 container,info,debug layer sha256:5860ffff0c012e63b2ae5e7fa22141c412415e7f9ddf291ac
acba37d88ff2974 downloaded
20:32:57 container,info,debug getting layer sha256:8070f1e72ed71395974e02b36921596c0bf8d9750
43a133345d90c9624f057eb
20:32:58 container,info,debug layer sha256:8070f1e72ed71395974e02b36921596c0bf8d975043a13334
5d90c9624f057eb downloaded
20:32:58 container,info,debug import successful, container 3dad3d6a-8426-485c-8d52-3a9b61635
6b8
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 9:48 pm

deleted veth1 в /ip upnp
changed 192.168.88.1
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Thu Aug 10, 2023 10:11 pm

Can you hit "Start" in on the container, then grab the log?
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 10:30 pm

Does not display. Does it come out and does not start?
22:00:29 wireless,info 6A:DD:89:FC:56:65@wlan2: connected, signal strength -57
22:00:32 dhcp,info defconf assigned 192.168.88.247 for 6A:DD:89:FC:56:65
22:22:36 system,info,account user admin logged in from 192.168.88.253 via local
22:23:50 system,info,account user admin logged out from 192.168.88.253 via local
22:24:01 system,info,account user admin logged in from 192.168.88.253 via local
22:24:05 wireless,info 6A:DD:89:FC:56:65@wlan2: disconnected, received disassoc: sending sta
tion leaving (8), signal strength -57
22:24:27 system,info,account user admin logged out from 192.168.88.253 via local
22:26:08 system,info,account user admin logged in from 192.168.88.253 via local
22:27:03 system,info,account user admin logged out from 192.168.88.253 via local
22:30:06 system,info,account user admin logged in from 192.168.88.253 via local
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3169
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DLNA container

Thu Aug 10, 2023 11:10 pm

Hmm. I was kinda expecting it to start after fixing the gateway. And the logs don't show anything, which is kinda strange since normally there be some error in logs AFTER hitting start...

I've seen containers be picky about changes in the VETH'sgateway... Maybe try deleting the VETH, and re-create it again with same/correct IP information, then re-assign the new VETH in the container. Then try to start again...
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Thu Aug 10, 2023 11:15 pm

Ok, I'll try tomorrow. Thank you.
 
nabus
just joined
Posts: 8
Joined: Tue Aug 08, 2023 11:55 pm

Re: DLNA container

Fri Aug 11, 2023 12:01 am

I did as you advised. I deleted veth1 and reconfigured it. Everything works. Thank you so much for your help.

Who is online

Users browsing this forum: tangent and 3 guests