Skip to content
Advertisement

Setting up minecraft server service on usb hard drive problem

I’m trying to set up a minecraft server to play with my friends. It’s my first time doing this on linux, so I have a (I believe) small problem. I can’t figure out how to set up it on my usb hard drive.

Here’s my minecraft.service

JavaScript

small edit – I removed -%i, because it’s to make multi-server I believe

and here is status of service after start

JavaScript

user was created by “useradd minecraft” with no password

Distro is Ubuntu Server 18.04.3 LTS

I need it on usb hard drive because I have small sd card. In future I want to replace it with ssd on adpter

Advertisement

Answer

Ok. Thank you all for not helping me. After hours I found solution(s).

  1. I re-created user minecraft with –system
  2. Created group minecraft with –system
  3. added user to group
  4. Set home folder of minecraft user to …/.minecraft-server (when i did it on create it throwed error)

This fixed my problem with server not starting at all, but then i cannot attach to screen. I tried -c with custom config and editing /etc/screenrc (second option totally broke screen, so I needed to reinstall it). Finally i created .screenrc in /.minecraft-server with options multiuser on and added users that can attach.

Now it’s working, but I spend about 10 hours straight to fix it…

Creating user and group:

JavaScript

.screenrc in minecraft’s home directory:

JavaScript

Finall version of minecraft.service in systemd:

JavaScript

To attach to screen: screen -x minecraft/mc where minecraft is user, and mc is screen name

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement