In fact your session stats show that latency is indeed the problem, 1106 ms latency 5s, 840 ms latency 30s with regards to your network. So check your network 😉
Did you follow the tips in the article I referred you to in my previous reply, it’s about headless Linux machines. Is your Ubuntu headless?
Please clarify the problem you are experiencing when connecting to the physical display. In your first message you said that you “get disconnected directly”.
Logs from the server would be useful. You can extract them using the instructions here: https://kb.nomachine.com/DT07S00243
Send them to forum[at]nomachine[dot]com. Please use the title of this topic as the subject of your email. Thanks!