I am using AnyDesk on a Raspberry Pi 3. After around 6-7 days, it suddenly consumes all the memory and the device stops responding.

To prevent this, I am using crontab to execute /usr/bin/killall anydesk and stop anydesk.

I need to kill it on 0 * * * * and start it again on 2 * * * *.

However, it throws error saying gtk warning cannot open display.

I have tried using export DISPLAY=:0 and it still doesnt work. It keeps saying it cannot open Display 0. I have tried 0.0 and 1.

There is anydesk.desktop in the /etc/xdg/autostart/ which I tried to execute from crontab using xdg-open, but even that didn't work.


This is probably because root doesn't have permissions to access the display.

I put it in my user's crontab instead of sudo crontab and it worked!

export DISPLAY=:0 /usr/bin/anydesk --tray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.