I’m currently playing around with Netcode for Gameobjects. I created a really simple Game where you can join a server and run around a plane as a bean. When i make a build for the game everything works fine. I can let it run a s a server and connect as a client or let it run as a host and then connect with an other client. Everything works perfectly.
In the next step i tried to let it run as a dedicated server. When i build a dedicated windows server everything works still as expected but when i let it run as dedicated linux server it does not work. I can start the server without a problem. It also outputs the same logs like the windows server but when i try to connect to the server as a client nothing happens. The console outputs “[Netcode] Syncing Time To Clients” all the time and nothing else. After a while i get a timeout on my client (Editor). Im running the dedicated linux server with WSL (Ubuntu) and Windows 11.
I tried to run the server as sudo but it did not change anything.
I also tried to add a new rule to my firewall to allow the port 9000 for private networks.
Here is my Setup:
NetworkManager Settings:
Server Startup Script:
public class Server : MonoBehaviour
{
private void Start()
{
Debug.Log("Start Server");
NetworkManager.Singleton.StartServer();
}
}
Player Prefab Script:
public class PlayerNetwork : NetworkBehaviour
{
#region Variables
// >> Private
private Vector3 m_moveDir = Vector3.zero;
public float m_moveSpeed = 3f;
// << Private
#endregion Variables
#region Unity Functions
public override void OnNetworkSpawn()
{
Debug.Log("Spawn");
}
private void Update()
{
if (!IsOwner)
return;
if (Input.GetKey(KeyCode.W))
MovePlayerServerRpc(KeyCode.W, new ServerRpcParams());
if (Input.GetKey(KeyCode.S))
MovePlayerServerRpc(KeyCode.S, new ServerRpcParams());
if (Input.GetKey(KeyCode.A))
MovePlayerServerRpc(KeyCode.A, new ServerRpcParams());
if (Input.GetKey(KeyCode.D))
MovePlayerServerRpc(KeyCode.D, new ServerRpcParams());
}
#endregion Unity Functions
[ServerRpc]
private void MovePlayerServerRpc(KeyCode keyCode, ServerRpcParams serverRpcParams)
{
Debug.Log("Client with ID " + serverRpcParams.Receive.SenderClientId + " pressed the Key: " + keyCode.ToString());
m_moveDir = Vector3.zero;
if (keyCode == KeyCode.W) m_moveDir.z = 1f;
else if (keyCode == KeyCode.S) m_moveDir.z = -1f;
else if (keyCode == KeyCode.A) m_moveDir.x = -1f;
else if (keyCode == KeyCode.D) m_moveDir.x = 1f;
transform.position += m_moveDir * m_moveSpeed * Time.fixedDeltaTime;
}
}
I’m using Unity 2021.3.7f1
Edit: I tested it with Unity 2022.2.11f1. It behaves the same.
Thank you for your help.

