Docker series uses LXC to set up a Minecraft Bedrock Edition server based on Turnkey-gameserver
本文最后更新于 340 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。

Preface

After I set up the Trinitycore 3.3.5 World of Warcraft server, I was also thinking about what other game servers I could set up. After all, my blog "Game World" section cannot only have World of Warcraft. The name is so big, but the pattern is so small, it's too low. After some research, the Turnkey-gameserver solution caught my eye. It is basically a one-click setup, and there are more than 100 game servers to choose from. This article takes the setup of a Minecraft (bedrock edition) server as an example to demonstrate how to use the PVE LXC template to quickly build a game server.


A quick introduction to Turnkey linux: "Turnkey GNU/Linux is a free system image based on Debian that pre-integrates and polishes the best free software components into secure, easy-to-use solutions. TurnKey is inspired by a belief in the democratizing power of free software, which, like science, promotes the advancement of a free and humane society. Without the freedom to distribute, patch, and study free software, the Internet as we know it would cease to exist. Free software is the silent and often invisible force behind the greatest technological wonders of our time."

Simply put, Turnkey has deployed various excellent free software based on the Debian system and formed numerous ct templates. Users only need to use these ct templates to create a virtual machine, and they can immediately get a Debian-based LXC with relevant software deployed. This is as simple as deploying an application using docker.

In fact, in the PVE ct template, you can see a lot of turnkey-(software name) naming templates:

image.png

By using these ct templates to build LXC, you can immediately have a Linux container with the corresponding software deployed. This article will build a gameserver in this way.


Use ct template: Turnkey-gameserver to create LXC

Follow the steps below to create the gameserver LXC:

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Click to create LXC.

Initialize gameserver

In PVE, select the gameserver linux container you just created, and log in to the terminal using root and the password you created earlier in the console interface on the right:

image.png

After logging in, you will directly enter the gameserver initialization interface, create a new account named "gameuser" and set a password for it:
image.png

After setting the password, enter the "Initialize Hub services" interface:
image.png

Here we mainly configure Turnkey's backup, migration, domain name management and other functions. If necessary, you need to provide an API key.https://hub.turnkeylinux.org/profileRegistration and a free AWS account are required. If you need it, just follow the prompts. This step is not necessary. You can select the Skip button below to skip and enter the system notification and security warning interface:
image.png

If you need to accept the notification, fill in your email address and select Enable below. Otherwise, you can directly select Skip and enter the security update interface:
image.png

If you need to install the security update immediately, select the Install button below to install it, otherwise select Skip. I chose Install. After installing the update, it is recommended to reboot:
image.png

After reboot, the terminal displays the following interface:
image.png

The two red boxes in the above picture show the IP address of this Linux container and the command to enter the advanced command line console.confconsoleAt this time, you can directly use the SSH client to directly access the IP address for management.

Installing the Game

GUI installation (not recommended, many problems)

Use an ssh client or the pve console to log in to the gameserver, then runconfconsoleCommand to enter the game server application service interface, as shown below (if you choose skip in the last security update in the previous section, you will go directly to this interface):

image.png

The Web shell in the figure above is a web-based command line tool. Webmin can be understood as a panel tool (in my other article:Docker series builds a DNS server based on bind9Here we first select "Advanced menu" in the red box below to enter the advanced menu:
image.png

Select Game Server in the image above, then select Select below:
image.png

Select Select game in the image above, then select Select below:
image.png

The above picture indicates that some games may require some basic configuration such as server name. Just select OK below, and then you can finally enter the stage of choosing to install the game:
image.png

Because we are going to set up a Minecraft Bedrock Edition server this time, select 60, and then select OK below:
image.png

The installation is completed quickly:
image.png

Because gameserver installation must bind the game to a non-root account, when installing the game through gui, the system will bind the game to the gameuser account created during initialization and install the game to/home/gameuser/gameserver/Directory, because this time is the installation of minecraft (bedrock edition), so the final path of the final execution program is/home/gameuser/gameserver/mcbserver:

image.png

Note: Try not to use the GUI to install, as it seems more likely to go wrong. I also encountered the problem of incomplete installation files. The official recommended installation method is command line.

Command line installation

implementauto_install.shCommand to install, as follows:

cd /root/gameservers ./auto_install.sh --list # to see which games can be installed

image.png

Then you can see the code (first column) corresponding to the game you need to install, as shown in the red box above, the code for Minecraft (bedrock edition) is mcb, then run the following command:

./auto_install.sh --game mcb --user gameuser --path /home/gameuser/gameserver/

--user gameuseris to bind Minecraft to the user gameuser, --path /home/gameuser/gameserver/Specifies the installation directory of the game. The default is/home/$USERNAME/gameserver, press Enter to complete the game installation. To be honest, the command line is much faster than the GUI installation.

Please pay attention to whether there is any lack of dependencies during the installation process:

image.png

You can use apt install directly in root mode to install the corresponding dependencies or enter in root mode/home/gameuser/gameserverDirectory Run./mcbserver installAutomatically install the corresponding dependencies.

Run the game

Log in to the system with the account bound to the game (gameuser), enter the game installation directory, find the executable program and run it with the start parameter. The steps are as follows:

su gameuser cd /home/gameuser/gameserver ./mcbserver start

Direct operation./mcbserverYou can see the supported operations:

image.png

If you want to check the running status of the server, you can use the monitor option:
image.png

Of course, if you want to put it on the public Internet, you need to do the corresponding domain name resolution and udp 19132 port mapping (or the firewall policy allows it).

Although this article uses Minecraft as an example, there are actually more than 100 game servers that can be created using the same method. The only thing to note is that if it is a domestic environment, scientific and technological assistance is required.

The content of the blog is original. Please indicate the source when reprinting! For more blog articles, you can go toSitemapUnderstand. The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠(ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ°Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Emoticons
Emoji
Little Dinosaur
flower!
Previous
Next
       

This site has disabled the right mouse button and various shortcut keys. The code block content can be copied directly by clicking the copy button in the upper right corner

en_US