title: Java minecraft server cannot run/listen on IPv4 at a linux virtual server machine
body: <p>There is a Linux centOS 6 system installed on a parallels virtual machine as a vServer with one public IPv4 address XX.XXX.XXX.XX </p>
  
  <p>I try to run a Java Minecraft Server on it but that does not work. I can't connect to the server with my IPv4 address at the specified port.</p>
  
  <p>If I run the command:</p>
  
  <pre><code>java -Xmx1024M -Xms1024M -jar minecraft-server.jar nogui 
  
  --&gt;
  
  [14:55:47] [Server thread/INFO]: Starting minecraft server version 1.12.2
  [14:55:47] [Server thread/INFO]: Loading properties
  [14:55:47] [Server thread/INFO]: Default game type: CREATIVE
  [14:55:47] [Server thread/INFO]: Generating keypair
  [14:55:48] [Server thread/INFO]: Starting Minecraft server on XX.XXX.XXX.XX:12345
  [14:55:48] [Server thread/INFO]: Using epoll channel type
  Nov 01, 2018 2:55:48 PM  io.netty.util.internal.MacAddressUtil defaultMachineId 
  WARNING: Failed to find a usable hardware address from the network interfaces; using random bytes: 8b:07:0a:a8:aa:46:68:dd
  </code></pre>
  
  <p>When I check the connections there is only a process listening at IPv6 loopback address:</p>
  
  <pre><code>lsof -i
  
  COMMAND   PID   USER   FD   TYPE   DEVICE  SIZE/OFF  NODE NAME
  java      9962  minecraftServer  21u  IPv6 1030838584  0t0  TCP sXXXXXXX.onlinehome-server.info:italk (LISTEN)
  
  netstat -lptu
  
  Proto Recv-Q Send-Q Local Address               Foreign Address             Stat
  tcp        0      0 s18608488.onlinehome-:italk *:*                         LISTEN   9962/java
  
  netstat -tulpn
  
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
  tcp        0      0 ::ffff:82.165.154.60:12345  :::*                        LISTEN      9962/java
  </code></pre>
  
  <p>This are all avaible Java connections.</p>
  
  <p>I tried a soulution I found here and elsewhere with</p>
  
  <pre><code>java -Xmx1024M -Xms1024M -Djava.net.preferIPv4Stack=true -jar minecraft-server.jar nogui
  </code></pre>
  
  <p>though, this also does not work.
  I get stuck and have no Idea anymore, suggestions
  on other websites did not helped.</p>