Setting up MineCraft Server in Ubuntu

To setup MineCraft server on Ubuntu, first you need to install Java.

Create a user to run minecraft

You can set a password if you want direct SSH login to this user or login as root, then “su – minecraft”.

Login as user minecraft with SSH or “su”.

Download minecraft server .jar file from

https://www.minecraft.net/en-us/download/server/

At the time of writing, i downloaded

Don’t use above link as it can get older, always go to minecraft site and get new link, so you get latest minecraft server jar file.

You can start minecraft server with command

First time when you run, it exit with some error related to EULA.

You need to edit file

Set

Now minecraft will run. You can create a run.sh file with following command for starting minecrat easily.

Paste following content

To make the file executable, chmod it 755

When you start minecraft from terminal/ssh, it get closed when you disconnect. To keep minecraft server running after you disconnect, use tmux or screen.

Ubuntu Configure systemd-resolved

Latest Ubuntu/Debian use systemd-resolved for DNS resolution. On a fresh Ubuntu 19.04 install DNS failed to resolve.

To fix this, create file

Add content

Restart systemd-resolved

You can find systemd-resolvd status with command

To resolve a domain, use

vmware-esxi-virtual-mac

Configure OVH Bridge Network from command line

If you have a Proxmox or VmWare ESXi server on OVH network, you need to configure network interface once virtual machine is created.

First login to OVH, go to IP page. Find the IP address you need to assign to this new VM, create a Virtual MAC. OVH allow 2 type of MAC. If you are using Proxmox, use OVH Mac. For VMWare ESXi, use vmware vmac.

Once you have Virual Mac. you need to configure it in your VM network interface settings. For Vmware ESXi

Now login to Virtial Machine, run following commands

In above, replace

NETWORK_INTERFACE_HERE = name of your network interface. This can be found with command “ip link”. Normally it is eth0 or ensXXX.

FO_IP_HERE = this is the Failover IP you will be using for this Virtual Machine.

GW_IP_HERE = This is gateway IP. For OVH network, it will be your servers MAIN IP address with last number replaced with 254.

Here is an actial example.

This settings will be lost when you reboot OS. For configuring network interface permanantly, you can do

Install iperf3 on ArchLinux

To install iperf3 on ArchLinux, run

To do speed test

Here we do speed test with http://ping.online.net, they run iperf3 server on port 5209

Ubuntu welcome message

Ubuntu remove SSH welcome message

When you login to an Ubuntu server using SSH, you get welcome message like

Ubuntu welcome message

On most Linux systems, this is generated by /etc/motd. On Ubuntu, MOTD (message of the day) generated dynamically with some scripts. I don’t want to see all the marketing message from Ubuntu everyday.

To disable MOTD on Ubuntu, just delete the scripts from /etc/update-motd.d/

If you want a differnt motd, you can put a shell script in this folder.

Method 2

Another way to disable motd is by disabling pam_motd.so module.

Edit files

Comment out the lines related to pam_motd.so