kkhan 16 Posted May 5, 2023 Posted May 5, 2023 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. 1
jiggity 35 Posted May 6, 2023 Posted May 6, 2023 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 5284 Posted May 6, 2023 Posted May 6, 2023 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 5284 Posted May 6, 2023 Posted May 6, 2023 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 1518 Posted May 6, 2023 Posted May 6, 2023 (edited) Have you set Server name under settings -> Identification Edited May 6, 2023 by jaycedk
kkhan 16 Posted May 7, 2023 Author Posted May 7, 2023 Yes I have. I can access the shares from an external device no problem using the server name.
kkhan 16 Posted May 7, 2023 Author Posted May 7, 2023 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 5284 Posted May 7, 2023 Posted May 7, 2023 (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 May 7, 2023 by rbjtech
kkhan 16 Posted May 13, 2023 Author Posted May 13, 2023 @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 2012 Posted May 13, 2023 Posted May 13, 2023 (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 May 13, 2023 by pwhodges
kkhan 16 Posted May 13, 2023 Author Posted May 13, 2023 @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.
Luke 42077 Posted May 14, 2023 Posted May 14, 2023 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 1315 Posted May 14, 2023 Posted May 14, 2023 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'
Luke 42077 Posted May 14, 2023 Posted May 14, 2023 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 5284 Posted May 14, 2023 Posted May 14, 2023 (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 May 14, 2023 by rbjtech
kkhan 16 Posted May 14, 2023 Author Posted May 14, 2023 @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 5284 Posted May 14, 2023 Posted May 14, 2023 (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 May 14, 2023 by rbjtech
seanbuff 1315 Posted May 14, 2023 Posted May 14, 2023 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: Type "cat /etc/hosts" in that window and you should get a different list of entries, something similar to this: 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 5284 Posted May 14, 2023 Posted May 14, 2023 (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: Type "cat /etc/hosts" in that window and you should get a different list of entries, something similar to this: 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 May 14, 2023 by rbjtech 1
kkhan 16 Posted May 14, 2023 Author Posted May 14, 2023 @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.
kkhan 16 Posted May 14, 2023 Author Posted May 14, 2023 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 5284 Posted May 14, 2023 Posted May 14, 2023 so if you simply dig testname - what does it respond with ?
kkhan 16 Posted May 14, 2023 Author Posted May 14, 2023 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 5284 Posted May 14, 2023 Solution Posted May 14, 2023 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 - 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 35 Posted May 14, 2023 Posted May 14, 2023 I have just roughly followed the topic. I also use unraid and for me it looks like this:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now