Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to Windows server from Linux client #241

Closed
roland65 opened this issue Nov 16, 2023 · 14 comments
Closed

Unable to connect to Windows server from Linux client #241

roland65 opened this issue Nov 16, 2023 · 14 comments

Comments

@roland65
Copy link

Hi,

I installed sanzu server in Windows 10 20H2 (running in a VM, Windows Defender disabled) using the command:

sanzu_server --config sanzu.toml

(the file sanzu.toml I used is the one you give).

Then in Linux (Ubuntu 22.04 with the package sanzu-client_0.1.4_amd64.deb installed) I issued the command:

sanzu_client 192.168.122.215 1122

and got the errors:

[2023-11-16T15:01:48.929045572Z ERROR sanzu_client] Client error
[2023-11-16T15:01:48.929060976Z ERROR sanzu_client] - due to Error in tcp server connection "192.168.122.215:1122"
[2023-11-16T15:01:48.929065707Z ERROR sanzu_client] - due to Connection refused (os error 111)

What am I doing wrong? Is there some login/password to pass to the server?

@serpilliere
Copy link
Contributor

Hi @roland65
Can you:

  • check if your firwall windows/linux opens the tcp port 1122
  • or disable the firewall

As explained in the error, this is not a login error, but a filtering problem.
Is your VM is natted or bridged to the host?
What is you VM network configuration?

@roland65
Copy link
Author

Hi, thanks for the answer.
On the Windows server, I use no firewall (Windows Defender disabled).
The Windows server (Windows 10) is running within a kvm/qemu VM, with a natted network.

@serpilliere
Copy link
Contributor

@roland65
I think this is a network problem, not a sanzu related issue.
Do you manage to ping the windows guest ip from the linux host?

@roland65
Copy link
Author

I can ping the Windows server. I also tried to open and RDP session on the Windows server, from a Linux xfreerdp client and it works.

On the Windows server, do I need some other dependency than ffmpeg?

@roland65
Copy link
Author

I tried to do the reverse, that is connecting to a Linux sanzu server using a sanzu client from the Windows VM.

On the Linux server side (Ubuntu 22.04) I did:

Xvfb :100 -screen 0 1920x1080x24
DISPLAY=:100 xfwm4
DISPLAY=:100 sanzu_server --config sanzu.toml

On the Windows client, I did:

cd c:\ffmpeg\bin
sanzu_client.exe 192.168.123.1 1122

and I received the following error:

c:\ffmpeg\bin>[2023-11-22T13:24:19.080439800Z ERROR sanzu_client] Client error
[2023-11-22T13:24:19.080732400Z ERROR sanzu_client] - due to Error in tcp server connection "192.168.123.1:1122"
[2023-11-22T13:24:19.085084400Z ERROR sanzu_client] - due to Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée. (os error 10061)

On the Linux server, I did:

netstat -na | grep :1122

and I got:

tcp 0 0 127.0.0.1:1122 0.0.0.0:* LISTEN

so it seems the sanzu server is indeed listening, but there is some communication problem...

Any idea?

@roland65
Copy link
Author

I also tried with a VM in VirtualBox and host only networking: same issue...

@serpilliere
Copy link
Contributor

serpilliere commented Nov 27, 2023

The default listening address is 127.0.0.1 (so only local listening)
add the option:

sanzu_server  --config sanzu.toml --address 0.0.0.0

Does it solve the problem?

@roland65
Copy link
Author

Hi serpilliere,

thanks for the tip, now I can connect!

However, in the Windows server I get tons of errors like this:

[2023-11-27T08:43:57.257719400Z ERROR sanzu::server_windows] acquirenextframe -2005270489
[2023-11-27T08:43:57.259290800Z ERROR sanzu::server_windows] - due to wait timeout

and in the client I get one error:

[2023-11-27T08:45:06.751261742Z ERROR sanzu_client] Client error
[2023-11-27T08:45:06.751284157Z ERROR sanzu_client] - due to Error in send client events

And the rendering is slow...

Any idea?

@serpilliere
Copy link
Contributor

Hi @roland65
If I understand correctly, the sanzu server in on a windows Virtual Machine.
As said in the readme, sanzu uses video compression to encode the stream.
So if the serveur is in a virtual machine, maybe the virtual machine doesn't have access to hardware capabilities, which may give non reactive behavior.

In your case, you didn't provide specific encoders on the command line, so sanzu_server uses libx264 by default for encoding. This encoding will be done on the cpu in the virtual machine which may be slow.

One solution to this is doing the following steps (if it's acceptable from your point of view):

  • use an emulated ram in the guest (which is backed by a memory mapped file on the host, using IVSHMEM qemu feature)
  • tells sanzu to not compress the video, but to output it as raw i this ram
  • run a sanzu_proxy on the host, and use the host graphic card to encode the video.

This has the advantage to compress video on the host, so if you don't trust your VM, this is interesting as the video stream doesn't come from the guest but from the host in this case.

If you want to try this, the steps are explained in an old PR here:
#113

@serpilliere
Copy link
Contributor

Another point: Can you confirm you compiled using "--release" ?

@roland65
Copy link
Author

In fact, I used the release you provide. I'll test your solution but for now I have a question: I tried to launch the server in seamless mode, like this (in Windows):

sanzu_server -x --config sanzu.toml --address 192.128.xxx.yyy

but on the client side (Linux) I didn't find a way to launch an application. How do you do that?

@serpilliere
Copy link
Contributor

Hi @roland65
That's a problem in seamless environment: You need at least one remote window opened, for example by auto launching firefox on login (or a terminal)

@serpilliere
Copy link
Contributor

Note that for now, the sanzu windows server is not really optimized regarding to linux one.

@serpilliere
Copy link
Contributor

As the connection problem is resolved, I am closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants