Rudis1261 / blink-server

This is the server you would need to be able to run the Blink Android Application.
MIT License
34 stars 7 forks source link

Xauth not setup: failed creating new xdo instance #14

Open mttbrt opened 5 years ago

mttbrt commented 5 years ago

Hello, when I run the first time sudo blink-server I got this errors in the server after using swipe area:

No protocol specified
Error: Can't open display: (null)
Failed creating new xdo instance

I found a solution that worked for me:

  1. Add these instructions to ~/.bashrc file:
    export DISPLAY=:0 
    export XAUTHORITY=~/.Xauthority
  2. Apply changes:
    source ~/.bashrc
  3. Remove old .Xauthority file
    cd ~
    rm .Xauthority
  4. Create a blank .Xauthority file
    touch .Xauthority
  5. Generate a new .Xauthority file:
    xauth generate :0 . trusted
  6. Create a new magic-cookie key
    randomkey=`/usr/bin/ksh -c 'echo $(( $RANDOM * $RANDOM * 2 ))'` 
  7. Add a new entry for another server
    xauth add ${HOST}:0 . $randomkey
  8. Run the server
    xhost +local:
    sudo blink-server

If someone has a better solution please let me know, I'm just a beginner in Linux environment.