INTERACT FORUM

Please login or register.

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

Author Topic: MC21 for Linux - Headless  (Read 5514 times)

thehammer86

  • Recent member
  • *
  • Posts: 16
MC21 for Linux - Headless
« on: October 27, 2015, 10:00:41 am »

I don't know if this is possible in MC21 for Linux or if this question has already been asked but is it possible to run it as a service (i.e. without logging in) on a headless machine?  I already run a number of servers with Ubuntu 14.04 LTS server 64-bit and I have found it a rock solid distro.  I have a powerful (but power hungry ~ 168W idle {overclocked}) Windows desktop that currently runs MC21 and I would like to reduce my power consumption.  I've had a look at the "JRiver Id" but I can't find enough information about the installed software which is why I'm considering configuring my own device.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5242
  • "Linux Merit Badge" Recipient
Re: MC21 for Linux - Headless
« Reply #1 on: October 27, 2015, 10:36:46 am »

You asked a multi-part question, so the answer to your question is yes and no.  Yes you can run MC on a headless server without manually logging in, but MC needs an active X session in order to run so there needs to be some kind of user session running (but that can be automated).

By far the easiest way to automate it is to run a cron script either @reboot or once a minute that starts a VNC server if one isn't running (which generates the necessary virtual X session) and then starts MC if it isn't running.  On debian-based distros (which typically ship tightvnc rather than tigervnc) it would look like this:

Code: [Select]
#!/bin/bash
export USER=Username
ps -e | grep tightvnc || vncserver :1 -geometry 1920x1080
export DISPLAY=':1'
ps -e | grep mediacenter || mediacenter21 /mediaserver

If Ubuntu 14.04 uses a different VNC server, substitute the appropriate one; if you're already running a VNC server for remote access you can skip that part.  There are other ways to do it that are more complex that have a slightly smaller memory footprint, or that allow the use of RDP or other remote protocols, but this is the method I recommend because it's very simple.

I use a slight modification of this method on my own headless server and it works nicely.  

If you need more complete instructions look here: https://yabb.jriver.com/interact/index.php?topic=99370.msg687832#msg687832  
The instructions are geared towards a Raspberry Pi running Debian, but they should work with minor modifications.

EDIT:  One additional thing to keep in mind:  there isn't perfect feature parity between the Windows and Linux versions, so make sure that all the features you use are supported on the Linux side before migrating your server.  The main one to be aware of in a server context is the lack of TV support, but there are others.
Logged

thehammer86

  • Recent member
  • *
  • Posts: 16
Re: MC21 for Linux - Headless
« Reply #2 on: October 27, 2015, 06:13:35 pm »

Hi mwillems,

Thanks for your reply.  Is it safe to assume that if my main goals are passing audio and video in it's native format from the MC21 Linux server to Windows 10 and JRemote clients, I shouldn't really run into any feature mismatches?
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5242
  • "Linux Merit Badge" Recipient
Re: MC21 for Linux - Headless
« Reply #3 on: October 27, 2015, 06:48:32 pm »

Hi mwillems,

Thanks for your reply.  Is it safe to assume that if my main goals are passing audio and video in it's native format from the MC21 Linux server to Windows 10 and JRemote clients, I shouldn't really run into any feature mismatches?

You'll probably be fine.  I run a mixed ecosystem of linux and windows computers and it works fine for audio and video.  One limitation to be aware of: filepaths don't convert in cross platform contexts right now, which can cause a performance hit. 

In a single OS client/server arrangement, if you use UNC paths or replicate the paths to the files using mapped drives on both computers, you can check a box under client options labelled "use local file if available."  This setup allows the client to "serve itself" and the server is basically just a database synchronizing engine.  Because direct file access at the OS level tends to be faster and more reliable this improves performance and reliability.

However, that configuration is not currently possible with a mixed OS ecosystem due to the filepaths issue, so the client will be entirely dependent on the server to serve it content. If you have a well-behaved fast network connection it shouldn't matter at all, but if your setup's throughput is marginal this may push it over the edge.  As noted, I run client/server with mixed linux and windows computers and it works perfectly for me, but about half of my boxes are wired (including the server) so YMMV.

I would advise spending some time with MC for linux (use the trial period before purchase) and make sure it fits your needs.
Logged

thehammer86

  • Recent member
  • *
  • Posts: 16
Re: MC21 for Linux - Headless
« Reply #4 on: October 28, 2015, 07:25:54 am »

Thanks for the heads up about the file paths.  I didn't know that I could have the client computer serve itself.  If a Samba server was running on the Linux Server would that simply not allow for the Windows client to serve itself?
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5242
  • "Linux Merit Badge" Recipient
Re: MC21 for Linux - Headless
« Reply #5 on: October 28, 2015, 07:56:54 am »

Thanks for the heads up about the file paths.  I didn't know that I could have the client computer serve itself.  If a Samba server was running on the Linux Server would that simply not allow for the Windows client to serve itself?

The paths in the library/database would be wrong so MC wouldn't know where to find the files.  Samba shares work fine with MC, but if MC thinks the files are at /mnt/data/audio/* and they're actually at c:\Users\Audio the client won't be able to find them. 
Logged

thehammer86

  • Recent member
  • *
  • Posts: 16
Re: MC21 for Linux - Headless
« Reply #6 on: October 28, 2015, 08:31:05 am »

Thanks.  I'm looking forward to this correction in future releases.
Logged

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: MC21 for Linux - Headless
« Reply #7 on: October 28, 2015, 04:43:33 pm »

The paths in the library/database would be wrong so MC wouldn't know where to find the files.  Samba shares work fine with MC, but if MC thinks the files are at /mnt/data/audio/* and they're actually at c:\Users\Audio the client won't be able to find them. 

This. My Samba shares are on my linux box (as is my MC server). I found if I created the library using the local mounts (/media/music) for instance, when I tried to access that library using a windows client the file location (/media/music) couldn't be found (obviously).

Mounting the Samba share locally on the linux machine and creating the library on the server using the Samba share locations solved this.
Pages: [1]   Go Up