Jump to content

Help: Emby on Unraid with UNC path names to local libraries


Go to solution Solved by rbjtech,

Recommended Posts

Posted

Following on from 

 

I have no migrated my Windows Server based emby platform (of almost 10 years) to Unraid.  However, I cannot access my local media libraries with UNC path names.  The media path names resolve if I use the Unraid server IP address but not if I use it's NetBIOS name: \\IP address\Video resolves but not \\Servername\Video.  Can anyone point me in the right direction as I am a newbie to Unraid.

I do not want to use the Backup & Restore plugin because the Windows Server will continue to function as the backup and slave emby server (as well as a domain controller for my local windows network).  By using UNC path names to the library, the emby instances becomes portable and I can replicate the master with the slave every evening using Syncovery.  Portability means that I can switch between the master and slave servers at a moments notice using either the master library on Unraid or the backup library on Windows Server.

The portability of UNC pathnames is important also as it has in the past made migrating between the 4 hardware platforms before the move to Unraid simply a matter of copying the entire emby instance to the new machine.

Thanks in advance for any help.

  • Like 1
jiggity
Posted
14 hours ago, kkhan said:

I have no migrated my Windows Server based emby platform (of almost 10 years) to Unraid.  However, I cannot access my local media libraries with UNC path names.  The media path names resolve if I use the Unraid server IP address but not if I use it's NetBIOS name: \\IP address\Video resolves but not \\Servername\Video.  Can anyone point me in the right direction as I am a newbie to Unraid.

https://forums.unraid.net/topic/60814-unc-paths-in-containers/?do=findComment&comment=596830

rbjtech
Posted

I have never used unraid - but it sounds like the 'server' name (shortname, or you can use a fqdn if you like) is simply not being resolved in DNS (usually done by NetBIOS).  So on the unraid server - does this have a local 'hosts' file ?  (it should do) - in which case, just manually add the local server name against it's ip - and the 'shortname' will these resolve to the IP in your UNC path names.

 

rbjtech
Posted
18 hours ago, kkhan said:

The portability of UNC pathnames is important also as it has in the past made migrating between the 4 hardware platforms before the move to Unraid simply a matter of copying the entire emby instance to the new machine.

Agree 100% and even on local direct attached storage on Windows,  I still use UNC for all my paths in emby (via local shares), as it makes the entire thing portable as you say because the UNC is then just a 'pointer' and you can create the 'share' again on any device you like, and emby will be none the wiser .. 👍

Neminem
Posted (edited)

Have you set Server name under settings -> Identification

image.png.4c2f2ff096e650c355d471ef8c05907c.png

Edited by jaycedk
Posted

Yes I have.  I can access the shares from an external device no problem using the server name.

 

Posted

Jiggity: I have already had a look at the dicussion thread you pointed me to, but the issue is different.  I am not trying to change the host mount point as that simply manages the data "folders" presented to emby.  I do not want to add media libraries using folders from the mount point in Unraid as these would not be portable between windows and linux platforms.  Instead, I want to add them as UNC paths to shares pointing to the media 'folders'.

A workaround would be to simply use the physical IP address in the UNC name.  Then when I switch between the master and slave emby servers, I simply change the IP address of the server.  However, this is not a clean solution as I need to make sure that the network subnet never changes.

I get the impression that as Netbios names are a Windows things, they are not supported in Linux.

 

 

rbjtech
Posted (edited)
45 minutes ago, kkhan said:

Jiggity: I have already had a look at the dicussion thread you pointed me to, but the issue is different.  I am not trying to change the host mount point as that simply manages the data "folders" presented to emby.  I do not want to add media libraries using folders from the mount point in Unraid as these would not be portable between windows and linux platforms.  Instead, I want to add them as UNC paths to shares pointing to the media 'folders'.

A workaround would be to simply use the physical IP address in the UNC name.  Then when I switch between the master and slave emby servers, I simply change the IP address of the server.  However, this is not a clean solution as I need to make sure that the network subnet never changes.

I get the impression that as Netbios names are a Windows things, they are not supported in Linux.

It's not a netbios name, it's simply a dns shortname - so you just need to get the unraid box to 'resolve it'.  Unless you are running your own local dns server, then a quick and easy way to do this is with a host file - it lives in /etc/hosts    Just edit it and add the host and IP that you want to resolve.  use dig to check it.

127.0.0.1		localhost	
192.168.1.1		myserver

and test with dig

dig localhost

; <<>> DiG 9.18.12-0ubuntu0.22.04.1-Ubuntu <<>> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65091
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;localhost.                     IN      A

;; ANSWER SECTION:
localhost.              0       IN      A       127.0.0.1

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Sun May 07 14:08:50 BST 2023
;; MSG SIZE  rcvd: 54

If the 'answer' is your IP - then it works .. :)

 

Edited by rbjtech
Posted

@rbjtech: thanks, very helpful.  I did not realise that linux also had a hosts file.

However, could not get it to work.  I edited (with nano) the host file and noticed that the UNRAID servername had automatically been added to the localhost loop back so it should have been resolved automatically.  However, when I tested with dig, servername could not be resolved.  Added an additional line with the external IP address also pointing to Servername but that would also not resolve.  However localhost resolved successfully. I am assuming that when I edit the host file, I am editing the non-persistent version in RAM so it should work. In any case, servername should have automatically worked as it was added by default.

I also tried to add  an extra parameter in the emby container (under advanced view) --add-host servername: IPAddress.  That also did not work.

Appreciate any help

 

pwhodges
Posted (edited)

The utilities dig, nsloopup, etc are programs for querying the DNS.  Hosts file entries aren't in the DNS, but are checked for by the network stack separately.  To test, you'll do better using another kind of program that is using the full network stack, like ping for instance.

https://unix.stackexchange.com/questions/212897/nslookup-dig-firefox-ignoring-etc-hosts-file-entries

Note that some programs cache lookups, and so will need to be restarted to see the change in hosts if their cache can't be cleared.  It shouldn't be necessary to reboot the system itself (I'm guessing for Linux, but Windows doesn't need a reboot for this).

Paul

Edited by pwhodges
Posted

@pwhodges.  Thanks for your input.  I used ping as well and could not actual get servername to resolve though localhost would resolve.  I did restart the emby container before each test ... so a bit stumped especially as UNRAID adds servername by default to the hosts file so I should not ever have had the issue I am seeing in the first place.

 

Posted

Can you mount the unc shares to a local path on the unraid machine, and then add the local path into emby server instead? That should work.

seanbuff
Posted
33 minutes ago, Luke said:

Can you mount the unc shares to a local path on the unraid machine, and then add the local path into emby server instead? That should work.

But that would not accomplish what OP is trying to achieve, and that is to add his media libraries to Emby using UNC paths (not local to unraid)

 

On 07/05/2023 at 22:24, kkhan said:

I do not want to add media libraries using folders from the mount point in Unraid as these would not be portable between windows and linux platforms.  Instead, I want to add them as UNC paths to shares pointing to the media 'folders'

 

Posted

The problem is:

  • Emby Server 4.7 only supports SMB1, but Windows only uses SMB2+ on Windows 10 and above
  • Emby Server 4.8 supports newer versions of the SMB protocol, but there's currently no place in the user interface for you to configure the username and password for the network share. This just hasn't been added yet, although it's coming. Workaround for now is for the share to allow anonymous access, although this is quite difficult to setup in Windows 10 and above now.
  •  
rbjtech
Posted (edited)
14 hours ago, pwhodges said:

The utilities dig, nsloopup, etc are programs for querying the DNS.  Hosts file entries aren't in the DNS, but are checked for by the network stack separately.  To test, you'll do better using another kind of program that is using the full network stack, like ping for instance.

https://unix.stackexchange.com/questions/212897/nslookup-dig-firefox-ignoring-etc-hosts-file-entries

Note that some programs cache lookups, and so will need to be restarted to see the change in hosts if their cache can't be cleared.  It shouldn't be necessary to reboot the system itself (I'm guessing for Linux, but Windows doesn't need a reboot for this).

Paul

I'm no linux guru, but if I dig an entry from my local hosts file (100% not in my local DNS server), it resolves and gives me an answer.   This is with Ubuntu... 🤔

13 hours ago, kkhan said:

@pwhodges.  Thanks for your input.  I used ping as well and could not actual get servername to resolve though localhost would resolve.  I did restart the emby container before each test ... so a bit stumped especially as UNRAID adds servername by default to the hosts file so I should not ever have had the issue I am seeing in the first place.

 

Can you show your local hosts file from \etc ?

Remember it's the emby server that needs the name resolution, so you may need the host enty on multiple machines.

Simply put - if you cannot resolve the name, then there is no chance of UNC/SMB working if using a shortname ..

If it works using IP instead (ie \\192.168.1.1\sharename) - then the issue is not Protocol or Authorisation related. 

Edited by rbjtech
Posted

@pwhodges.  Thanks for your continuing help. 

The Hosts file in \etc on the UNRAID server (& emby server) is pretty simple at 2 lines:

127.0.0.1                     Flower localhost
54.149.176.35            keys.lime-technology.com

Flower is the name of the UNRAID server and has been added by default.

I can resolve localhost within emby (... when selecting a share in setting up a library) but not Flower.  dig (as well as ping) resolves localhost but not Flower.

Putting Flower on a separate line as 127.0.0.1 Flower or 192.168.1.7 Flower (where 192.168.1.7 is the local network IP of UNRAID) has no effect.

From an external Windows machine (my emby backup running on Windows Server) I can ping Flower so it is clearly not a  network issue.  The only issue is that within UNRAID the name Flower does not resolve.

This is frustrating and you are probably right that there is little chance of UNC working. I may just add all the shares as \\localhost\myshare on both emby on UNRAID and mirror that exactly on the Windows Server emby backup.  That will make the two emby instances with with all the media files mirror images of each other (using Syncovery on the Windows Server to syncronise the two emby media library on a nightly basis).  Thus if I need to do maintenance on the main emby server on UNRAID, I can simply switch over to the backup emby server on Windows by changing port forwarding on the router.

 

rbjtech
Posted (edited)

little tip - don't use capitals in linux systems because they are case sensitive and may add unnecessary complexity - maybe just use 'flower'

try (obviously replacing your real ip) :-

127.0.0.1	localhost
192.168.1.1	flower
54.149.176.35	keys.lime-technology.com

if 'dig flower' does not resolve to 192.168.1.1 - then there is something seriously wrong somewhere - as this could not get an less complex !

Edited by rbjtech
seanbuff
Posted
1 hour ago, kkhan said:

I can resolve localhost within emby (... when selecting a share in setting up a library) but not Flower.  dig (as well as ping) resolves localhost but not Flower.

Putting Flower on a separate line as 127.0.0.1 Flower or 192.168.1.7 Flower (where 192.168.1.7 is the local network IP of UNRAID) has no effect.

I could be completely wrong, but isn't this just the nature of how Docker containers work? I am an UnRAID user, but I do not run Emby on UnRAID so have no experience there.

However, AFAIK each Docker container is run in an isolated environment, meaning each container has it's own /etc/hosts file. What you are showing above looks to be your physical UnRAID hosts "hosts" file.

I'm guessing that if you open a "Console" to your Emby container and look at that hosts file, it will have different entries to the above

Example:
image.png.42567181ffbc4a389d33cf470ca19a1f.png

Type "cat /etc/hosts" in that window and you should get a different list of entries, something similar to this:

image.png.5b165b8fbd350779f838bc59d399e8b3.png

So presumably if you can find a way to add an entry into the containers hosts file, it may work? Editing UnRAID's own hosts file is redundant in this scenario.

Happy to be corrected on any of the above of course 😁

rbjtech
Posted (edited)
35 minutes ago, seanbuff said:

I could be completely wrong, but isn't this just the nature of how Docker containers work? I am an UnRAID user, but I do not run Emby on UnRAID so have no experience there.

However, AFAIK each Docker container is run in an isolated environment, meaning each container has it's own /etc/hosts file. What you are showing above looks to be your physical UnRAID hosts "hosts" file.

I'm guessing that if you open a "Console" to your Emby container and look at that hosts file, it will have different entries to the above

Example:
image.png.42567181ffbc4a389d33cf470ca19a1f.png

Type "cat /etc/hosts" in that window and you should get a different list of entries, something similar to this:

image.png.5b165b8fbd350779f838bc59d399e8b3.png

So presumably if you can find a way to add an entry into the containers hosts file, it may work? Editing UnRAID's own hosts file is redundant in this scenario.

Happy to be corrected on any of the above of course 😁

Agreed - that's what I alluded to above .. ;)

The hard fact is that it is not resolving the name, meaning it's not using the correct hosts file. 

2 hours ago, rbjtech said:

Remember it's the emby server that needs the name resolution, so you may need the host enty on multiple machines.

 

Edited by rbjtech
  • Like 1
Posted

@rbjtech. @luke; everyone: Thanks for your help. Much appreciated.

My understanding was that I could modify the emby container hosts file by, and I quote from a previous post above "I also tried to add  an extra parameter in the emby container (under advanced view) --add-host servername: IPAddress.  That also did not work".  But I will try editing the container host file as suggested by @seanbuff and report back.  But  as Luke has stated, it is likely not going to work so I will probably revert to just using \\localhost\myshares etc as library paths as that will give exact equivalence between the main and backup emby environments allowing me to keep the backup synchronized to the main on a scheduled.

Thanks all.

Posted

This is the hosts file for the emby container.  I added three entries at the bottom to test whether emby would resolve either Flower or testname but it does not when trying to select media shares.  I used "--add-host Flower:192.168.1.7 --add-host Flower:127.0.0.1 --add-host testname:127.0.0.1" in the Extra Parameters section (under Advanced View) in the emby container.

/ # cat /etc/hosts
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.7     Flower
127.0.0.1       Flower
127.0.0.1       testname
/ # 

rbjtech
Posted

so if you simply dig testname - what does it respond with ?

Posted

Did a ping test within the emby console and both testname and Flower are resolved but I cannot get emby to resolved these names. \\localhost and the \\IPAddress are resolved but not testname and Flower.  This does not make logical sense. If the container environment can resolve these host names, then why can't emby?

/ # dig testname
sh: dig: not found
/ # ping testname
PING testname (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.065 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.048 ms
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: seq=3 ttl=64 time=0.045 ms
64 bytes from 127.0.0.1: seq=4 ttl=64 time=0.040 ms
64 bytes from 127.0.0.1: seq=5 ttl=64 time=0.038 ms
64 bytes from 127.0.0.1: seq=6 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: seq=7 ttl=64 time=0.038 ms
^C
--- testname ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 0.038/0.044/0.065 ms
/ # ping Flower
PING Flower (192.168.1.7): 56 data bytes
64 bytes from 192.168.1.7: seq=0 ttl=64 time=0.048 ms
64 bytes from 192.168.1.7: seq=1 ttl=64 time=0.041 ms
64 bytes from 192.168.1.7: seq=2 ttl=64 time=0.035 ms
64 bytes from 192.168.1.7: seq=3 ttl=64 time=0.040 ms
64 bytes from 192.168.1.7: seq=4 ttl=64 time=0.039 ms
64 bytes from 192.168.1.7: seq=5 ttl=64 time=0.030 ms
64 bytes from 192.168.1.7: seq=6 ttl=64 time=0.036 ms
64 bytes from 192.168.1.7: seq=7 ttl=64 time=0.040 ms
^C
--- Flower ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 0.030/0.038/0.0

  • Solution
rbjtech
Posted

Agreed - if the base OS is resolving them, but Emby is not - then the question needs to be answered by the Emby Dev's .. :)

Can you do a screen grab of exactly what you have put in the library fields ?

Mine below -

image.png.23a4209348bfc84b4c172c931a2afea0.png

Note optional path has the host in Caps as this is required from my Android Shield for mounting in Direct File play mode

Media is actually the local storage (I just choose to access it via a share), but this works equally as well with a remote SMB share from another server.

MrMackey
Posted

I have just roughly followed the topic.
I also use unraid and for me it looks like this:

Screenshot2023-05-14213032.png.f63c91d6adba574830c65de6128cae4a.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...