Skip to content

Anydesk cannot connect to Anydesk relay server #59

Open

Description

@Delapro

Checklist

Report



Describe what is happening
I built a PhoenixPE ISO with Anydesk selected. After booting I started Anydesk. But Anydesk cannot connect to the Anydesk relay server. Network connection is available I can ping and tracert sites on the internet. I also can ping boot.net.anydesk.com, the standard Anydesk relay server address without problems. But Anydesk doesn't get an address and cannot connect to the anydesk server.

To Reproduce

  1. Build PhoenixPE with Anydesk selected
  2. Boot created PhoenixPE
  3. Wait/Establish internet connection
  4. Start Anydesk
  5. See Error

Expected behavior
After starting Anydesk it should connect to the Anydesk relay server.

Screenshots/Logs
image

Activity

  1. Delapro commented on Sep 26, 2023

    @Delapro
    Author

    As I found out by accident, when the created PE ist running for a longer time, I finally get the connection and remote access via Anydesk is possible! Every 3-90 seconds, its random, Anydesk tries to connect to the relay server. Waiting for a longer time it suddenly gets the connection. I have to further investigate this if the time it takes to connect is maybe constant.

  2. Delapro commented on Sep 28, 2023

    @Delapro
    Author

    OK, I can confirm now. After booting PE and starting Anydesk it always takes one hour and then Anydesk is able to connect to the Anydesk relay server. After that time period I can restart Anydesk as often I want, it always connects instantly to the Anydesk network. If I reboot the machine I have to wait one hour again.

    The question is now, what is responsible for this strange behaviour? Anydesk or the built PE?

  3. homes32 commented on Sep 29, 2023

    @homes32
    Contributor

    Sometime back in July? Anydesk changed it's behavior and requires an ssl certificate for authentication. once you have logged into your anydesk account, an client certificate and private key are are stored in %AppData%\AnyDesk\service.conf.

    if you copy this file to your build Anydesk should start instantly.

    To test, edit the Anydesk script and paste the following code

    System,GetEnv,"APPDATA",%HostAppData%
    If,ExistFile,"%HostAppData%\AnyDesk\service.conf",FileCopy,"%HostAppData%\AnyDesk\service.conf","%TargetAppData%\AnyDesk\service.conf"
    

    under

    ///////////////////////////////////////////////////////////////////////////////////
    // Settings
    

    I'm looking to see if there is a more elegant solution then copying the certificate from the host, but I'll eventually get this script updated. :)

  4. added
    enhancement
    on Sep 30, 2023
  5. Delapro commented on Oct 20, 2023

    @Delapro
    Author

    I haven't tried the way to copy the certificate, because it is not always feasible to rely an a previous installed Anydesk. Especially in forensic or catastrophic situations it is necessary to interact as less as possible with the target system.

    But after investigating the subject further I can tell that the problem comes from the timezone of the created WinPE. If I run "tzutil /g" it shows "W. Europe Standard Time" but with the appendix "_dstoff", hence daylightsavingtime known as summertime is not set correctly.

    The problem seems to be a well known problem with PE: https://forum.acronis.com/forum/acronis-true-image-home-forum-older-versions/using-winpe-image-hard-disk-important.

    So if I run

    .\tzutil /s "W. Europe Standard Time"
    sc start w32time
    .\w32tm.exe /resync
    

    after booting into PE, "tzutil /g" shows no "_dstoff" appendix anymore and then starting Anydesk it connects instantly.

    I'm currently playing with PhoenixPE to extent it and to add tzutil.exe and w32tm.exe to PhoenixPE. Do you accept a pullrequest, if I get it done?

  6. Delapro commented on Oct 30, 2023

    @Delapro
    Author

    One more thing, the problem is currently solved until March, 31 of 2024. Because now daylightsaving time (summertime) is over :-)

  7. homes32 commented on Oct 31, 2023

    @homes32
    Contributor

    Thanks for all your investigation into this issue. I have been able to verify your findings and decoding the certificates AnyDesk generates also confirms that the "valid from" attribute is behind an hour, causing the cert to be invalid until time has elapsed.

    I have been playing with some enhancements to the localization script. It is possible to auto set DST, but it has consequences (https://learn.microsoft.com/en-us/archive/blogs/winpe/daylight-savings-time-in-winpe) such that it can end up causing WinPE to set the CMOS clock backwards every reboot for a period after the fall transition making the solution unacceptable.

    Also experimenting with syncing the clock once a network connection is established. It works, but there have been some inconsistent behavior that I'm trying to work out to make it reliable.

    I have attached a dev snapshot of the script if you want to experiment further.
    Localization-dev.zip

  8. added
    external
    on Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementexternal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions