INTERACT FORUM

Please login or register.

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

Author Topic: Starting MC before login  (Read 1969 times)

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1557
Starting MC before login
« on: May 12, 2021, 01:31:12 am »

Some russian dude is asking for help in Russian forum

https://yabb.jriver.com/interact/index.php/topic,129430.0.html

I have no experience with Linux so cannot help him. So thought to pass on request here.

Basically he builds headless MC box and whant to start MC before user login. My guess he wants to run MC as a service. How to do that?
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5174
  • "Linux Merit Badge" Recipient
Re: Starting MC before login
« Reply #1 on: May 12, 2021, 08:50:08 am »

Some russian dude is asking for help in Russian forum

https://yabb.jriver.com/interact/index.php/topic,129430.0.html

I have no experience with Linux so cannot help him. So thought to pass on request here.

Basically he builds headless MC box and whant to start MC before user login. My guess he wants to run MC as a service. How to do that?

MC needs a running x11 session in order to start at all, so there's no way to run it before a user has logged in.  What I do is run a headless server that auto-logs in to a desktop environment or window manager as a user (I use XFCE) and then I setup a systemd service to start MC after the x11 session has started.  There's no way to start MC without some kind of running x11 session, and I know of no way to start an x11 session without some kind of user logged in.

Check out this thread for more info.  It specifically addresses why running without login won't work in more detail and provides technical details on how to auto-start MC: https://yabb.jriver.com/interact/index.php/topic,123771.0.html
Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1557
Re: Starting MC before login
« Reply #2 on: May 12, 2021, 10:00:32 am »

MC needs a running x11 session in order to start at all, so there's no way to run it before a user has logged in.  What I do is run a headless server that auto-logs in to a desktop environment or window manager as a user (I use XFCE) and then I setup a systemd service to start MC after the x11 session has started.  There's no way to start MC without some kind of running x11 session, and I know of no way to start an x11 session without some kind of user logged in.

Check out this thread for more info.  It specifically addresses why running without login won't work in more detail and provides technical details on how to auto-start MC: https://yabb.jriver.com/interact/index.php/topic,123771.0.html

Thank you.
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2554
Re: Starting MC before login
« Reply #3 on: May 12, 2021, 11:18:21 am »

MC needs a running x11 session in order to start at all, so there's no way to run it before a user has logged in.  What I do is run a headless server that auto-logs in to a desktop environment or window manager as a user (I use XFCE) and then I setup a systemd service to start MC after the x11 session has started.  There's no way to start MC without some kind of running x11 session, and I know of no way to start an x11 session without some kind of user logged in.

Check out this thread for more info.  It specifically addresses why running without login won't work in more detail and provides technical details on how to auto-start MC: https://yabb.jriver.com/interact/index.php/topic,123771.0.html

AFAIK there's nothing preventing X or X in VNC from running as a system (root) service. That's how a lot of graphical containers are structured. I wouldn't do it on baremetal (OP's question is an X-Y), but I don't think anything explicitly prohibits it.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5174
  • "Linux Merit Badge" Recipient
Re: Starting MC before login
« Reply #4 on: May 12, 2021, 11:29:02 am »

AFAIK there's nothing preventing X or X in VNC from running as a system (root) service. That's how a lot of graphical containers are structured. I wouldn't do it on baremetal (OP's question is an X-Y), but I don't think anything explicitly prohibits it.

I was under the (maybe erroneous?) impression that running X as root is no longer permitted on modern X11 versions, but I haven't actually tried it since rootless X became an option.  If you're right that it's still possible to run X as root, then that's another potential solution (although there are security risks, obviously).  Thanks for the tip! 
Logged

bush74

  • Recent member
  • *
  • Posts: 10
Re: Starting MC before login
« Reply #5 on: May 15, 2021, 05:44:20 pm »

Thank you all for your attention.
I will auto-login a non-sudo user.
The topic is closed.
Logged
Pages: [1]   Go Up