INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Remote can't connect to MC on NAS [NAS Network Problem]  (Read 2100 times)

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Remote can't connect to MC on NAS [NAS Network Problem]
« on: May 12, 2021, 01:01:39 am »

I have Media Center running in a container on a QNAP NAS, and neither JRemote or Gizmo can connect using the Access Key. Instead, I can connect using 192.168.1.x and access my library that way, but my Yamaha receiver isn't available as a renderer - I can only play to the mobile device that's hosting the remote or Chromecast to my TV. MinimServer, on the other hand, works fine with BubbleUPnP and the receiver is available as a renderer.

However, I've also installed Media Center on a Mac laptop. I have no issues using JRemote or Gizmo to connect to this version of MC using its Access Key, and everything works as it should - the receiver appears as a renderer on the same remote apps that can't see it when connected to the NAS install of MC (using 192.168.1.x instead of the Access Key to connect).

I understand running MC directly on a QNAP NAS isn't supported by JRiver, and I realise it seems my problem can be solved by just using MC on my laptop, but I don't want this additional device in the pipeline. I just want to be able to use JRemote to play music from my NAS to my receiver. I'm hoping somebody here has successfully got a similar setup functioning and can please share their expertise. I just can't think what else to try, especially as my knowledge is limited.

Sorry, admins for cross-posting this question - my original post wasn't as specific in the beginning and the thread seems to have dried up. I think I've only got a bit more than a week left before I presume JRiver will ask me to buy a license, and I only want to do this if I know it's going to work how I'd like it to.
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Remote can't connect to MC on NAS using Access Key
« Reply #1 on: May 12, 2021, 02:55:58 am »

Check if UPnP is enabled on the QNAP Virtualization Station. This is needed to automatically tell the router to forward incoming requests on port 52199 to the QNAP device. When you use the Access Key it gets translated to your current public IP address, so the connection goes to your Router; it needs to be told where to redirect that connection to - UPnP does that.

https://www.qnap.com/en/how-to/tutorial/article/how-to-access-virtualization-station-behind-routers-and-other-ip-sharing-devices

Enabling UPnP is the easiest solution, but it's not the best as it may also open other services on the QNAP to the internet. Instead, you should enter your router's management page and add a forwarding of port 52199 to your QNAP at 192.168.1.x.

Also note that you can only have one redirect active at any given point; so if you have 2 MC servers running at the same time (Mac and QNAP), only one of the access keys will work - whichever one is active on the Router either via a manual config or via UPnP. To have both working at the same time they would need to be using different ports, so you could setup the router to forward 52199 to one, and 52299 to the other for instance.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 743
  • Looking Busy
Re: Remote can't connect to MC on NAS using Access Key
« Reply #2 on: May 12, 2021, 07:20:10 pm »

I have the same setup as you, and I can access my renderers in JRemote using the IP address setup you are using, I've never tried the Access Key.

Maybe its your Container network setup, can you share that?
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS using Access Key
« Reply #3 on: May 12, 2021, 09:14:48 pm »

Thanks zybex and Scobie for your support.

I can't find Virtualization Station on my QNAP NAS, nor can I find it in the AppCenter to download and install. I've attempted port forwarding, but this isn't something I fully understand - my router gives me the option of an internal port and an external port - I've tried 52199 in both, to the internal IP address of the NAS using TCP and TCP/UDP and it doesn't seem to help.

Container Station lists the MC docker URL as:

http://192.168.1.195:49158/ → 52199
http://192.168.1.195:49162/ → 5800

^ Does this affect what values I should be entering as external/internal ports?

Also, I don't know how to disconnect my laptop's UPnP connection (if it's somehow hogging the system with it's MC Access Key). I've disconnected from the network and shut it down - is this enough to give priority to MC on the NAS?

I was unsure how to share my container network setup, except to say I tried installing it the first time without any customisation, just basically clicking ok until it was done. However, when it didn't work, I deleted it and installed it again using this guide:

https://blog.linuxserver.io/2017/09/17/how-to-setup-containers-on-qnap/

^ This method allowed me to specify a library folder in the NAS's root directory rather than one buried deep within the Container Station directory.

I had a look in the settings for something to report on my container network settings, and saw my Network Mode is NAT, so I tried changing to Host and Bridge (without understanding what these are) - neither worked and when I reset it back to NAT, container station now lists a single URL:

http://192.168.1.195:49162/ → 5800

But I can still access MC at http://192.168.1.195:49162 and JRiver Panel at http://192.168.1.195:49158 - functionality doesn't appear to have changed. I should probably clarify that JRemote and Gizmo can play music from my library on the NAS, I've never had any issue with that, I just can't access the Yamaha renderer, as I can if I use MinimServer/BubbleUPnP. Also, I only installed MinimServer after I couldn't get MC to work, so I don't think that's had any impact on the setup. One significant difference with MinimServer however, is that it's installed on the QNAP NAS as an app, not in a container - maybe that's a clue?

What specific container network setup data do you need to see, and where do I find it? Apologies for being so limited in my knowledge.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 743
  • Looking Busy
Re: Remote can't connect to MC on NAS using Access Key
« Reply #4 on: May 13, 2021, 12:21:36 am »

In Container Station click on the name of the Container, go to settings then Advanced Settings. There's a Network section in there.

Without giving away any address information, what is the setup? What is the Network Mode etc.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS using Access Key
« Reply #5 on: May 13, 2021, 01:11:45 am »

Image: merkulov1979/jriver-docker-armhf

Container MAC address: none

Network mode: NAT

Port Forwarding (host/container/protocol):

49163/1900/UDP
49200/52100/TCP
49199/52101/TCP
49158/52199/TCP
49162/5800/TCP
49201/5900/TCP


Thanks.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 743
  • Looking Busy
Re: Remote can't connect to MC on NAS using Access Key
« Reply #6 on: May 13, 2021, 01:20:02 am »

In the past I've found that the container needs a Mac address, otherwise MC loses its license on restart. I'm not sure this is still the case but I always assign one just to be safe, so I would generate a random Mac Address (plenty of sites do this free, just google it) and assign it to the container.

As far as your connectivity issue I'm thinking it may be your NAT setup. I have a bridged Network, and assign a static address on my home network and this works fine.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS using Access Key
« Reply #7 on: May 13, 2021, 01:45:05 am »

I tried Host and Bridge, with an assigned static address, but nothing seemed to change. I'll look into the MAC address - but would this be the issue if MC seems to be running fine and JRemote connects to it? It's the renderer that's missing.

EDIT: Sorry, my mistake, when I set it to Bridge, nothing seems to work. I can no longer access MC via the fixed IP address.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS using Access Key
« Reply #8 on: May 13, 2021, 02:09:42 am »

Actually, is having no MAC address my issue? Is this why I can't locate the renderer? I tried Googling container MAC addresses, and the assumption seems to be that the container should already be assigned one. I fear I'm in way over my head now.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 743
  • Looking Busy
Re: Remote can't connect to MC on NAS using Access Key
« Reply #9 on: May 13, 2021, 04:58:02 am »

No not sure the MAC address is your issue, more best practice that may stop other problems.

Did you assign an unused IP address as the static address in the Bridge config, different to the QNAP IP Address?

Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Remote can't connect to MC on NAS using Access Key
« Reply #10 on: May 13, 2021, 05:11:49 am »

Sorry, Virtualization Station is for VMs, it's Container Station in your case. The idea is the same though.
Lots of confusion on this thread, let me try to clarify a few things.

MAC Address:
if you leave it blank the container will be assigned a new random MAC address on each reboot. If the container is setup to use DHCP, it may receive a different IP address on each reboot because of this (the router thinks it's a different PC each time). This may lead to problems with your router later on, so it's better so specify a fixed MAC address, or a fixed IP address.
Exception: In HOST network mode, the container sees the real network card of the QNAP and has the same MAC address, so this setting doesn't matter.

Network mode:
The mode you select has implications on how you must setup your router and qnap port forwarding.

NAT mode: The container is assigned an IP (by QNAP) on a different range than your real network (ie, 10.1.2.3). All incoming connections need to be forwarded to this internal IP address (Network Address Translation).
- QNAP container station: remove the NAT automapping for 52199 (49158/52199/TCP) and add a NAT port mapping from 52199 (external) to 52199 (internal)
- Router: forward port 52199 to your QNAP's real IP address/hostname (internal = external = 52199)
- If you leave the default port mapping as you have above (49158/52199/TCP), then you would need to tell the router to forward port 52199 (external) to 49158 (internal)

Bridge Mode: The container sees the real QNAP network card, but acts as a separate Machine - it gets a different MAC address, so the router assigns it a different IP address on the same range as the QNAP and your other devices. Setting up a fixed MAC address is good to avoid having a different IP on each reboot.
- QNAP container: port-mapping is greyed out because there's no need to translate IP addresses/ports [Note: On some Docker implementations, Bridge mode still uses NAT - in that case, port forwarding still needs to be setup as above. Not sure what variant QNAP has]
- Router: forward port 52199 (internal=external=52199) to the IP address assigned to the container (NOT the QNAP's IP!)

Host Mode: The container sees the real QNAP network, using the same MAC address and IP address as the QNAP itself. It's a shared mode.
- QNAP container: port-mapping is greyed out because there's no need to translate IP addresses/ports
- Router: forward port 52199 (internal=external=52199) to the real IP address of the QNAP


I hope this helps clear out some confusion :)

Regarding your other MC server - no need to disable it. I would suggest that you simply put it on a different port like 52299 - this way you can have both running, and access both of them at the same time by using their respective access key and port ("CRhGkc:52299", for instance). Note that you will need to forward this other port 52299 to your PC, on the router.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 743
  • Looking Busy
Re: Remote can't connect to MC on NAS using Access Key
« Reply #11 on: May 13, 2021, 05:45:23 am »

Yes so Bridge mode is the easiest to work with. The MC container has its own Mac Address, it’s own IP address and any networking can treat it as a separate host making remote access a lot easier to manage.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72548
  • Where did I put my teeth?
Re: Remote can't connect to MC on NAS [NAS Network Problem]
« Reply #12 on: May 13, 2021, 07:55:03 am »

Nice summary, zybex.  Thank you.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS [NAS Network Problem]
« Reply #13 on: May 13, 2021, 09:16:19 am »

Thanks heaps, zybex. Your helpful guide was enough for me to get it working in Host Mode. I couldn't get the renderer to show up in the other modes, so I was clearly not doing something right, but I will now stick with what's working! Thanks also, JimH and Scobie for your support and perseverance while I tackled this.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS [NAS Network Problem]
« Reply #14 on: May 13, 2021, 09:36:20 am »

One more thing though... I can access the Panel at 192.168.1.x:52199 but can't find which port MC has been assigned, as it changed when I switched to Host Mode and restarted the container. Any idea how to find this out? (Assuming MC is accessible in Host Mode).

EDIT: Found it through trial and error: 5800
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2674
Re: Remote can't connect to MC on NAS [NAS Network Problem]
« Reply #15 on: May 13, 2021, 09:41:02 am »

In host mode there's no translation - so MC is running on port 52199, and that's the port that is 'visible' on your LAN - so you access it with your QNAP's IP address and port 52199, as you said above (192.168.1.x:52199)

For the renderer to work on other modes you would need to forward the DLNA ports too. I think MC uses the default DLNA ports - 1900 (UDP), and perhaps 5001 (TCP) and/or 2869 (TCP). On Host mode this is not needed since all ports are pass-through.
Logged

Dr_Hoon

  • Junior Woodchuck
  • **
  • Posts: 50
Re: Remote can't connect to MC on NAS [NAS Network Problem]
« Reply #16 on: May 13, 2021, 10:17:58 am »

Thank you. Much appreciated.
Logged
Pages: [1]   Go Up