2

I connect to my VPS using tigerVNC Viewer and run a command like:

 xdotool getmouselocation

but I always get the error:

 Segmentation fault (core dumped)

On my desktop it is working but not on my VPS

This is how I set up my VPS:

apt-get update
apt-get upgrade
apt install xfce4 xfce4-goodies tightvncserver
vncserver
vncserver -kill :1
nano ~/.vnc/xstartup
     #!/bin/bash
     xrdb $HOME/.Xresources
     startxfce4 &
chmod +x ~/.vnc/xstartup
vncserver
sudo apt update
sudo apt install xdotool

What can I do?

Byte Commander
  • 107,489

1 Answers1

2

Looks like a bug/incompatibility between xdotool and some VNC implementations, especially tightvnc. See this ~3 years old open GitHub issue on xdotool.

In the thread the xdotool developer mentions a workaround, by building a specific older version of xdotool from source:

As a workaround, y'all can use edbbb7a (from December 2013) as a git commit and is successful on tightvnc:

% git checkout edbbb7a8f664ceacbb2cffbe8ee4f5a26b5addc8
% make install
% DISPLAY=:1 xdotool getmouselocation
x:320 y:240 screen:0 window:37

Alternatively, you can try replacing tightvnc with e.g. tigervnc, which doesn't seem to have this issue.

Byte Commander
  • 107,489
  • 1
    I am running x11vnc server which also doesn't seem to have this bug. That would explain why I can't duplicate the issue. =) – Terrance May 27 '19 at 15:30
  • @RapidGainz I am pretty certain that this is the one I followed for my install: https://askubuntu.com/questions/229989/how-to-setup-x11vnc-to-access-with-graphical-login-screen – Terrance May 27 '19 at 19:04
  • @Terrance i can finally connect to my vps using vnc by adding a dummy monitor https://unix.stackexchange.com/questions/78103/cant-start-x11vnc-without-attached-monitor but now it ask for an username and password and i tryed vnc password and my vps name but it wont login :( – RapidGainz May 27 '19 at 20:20
  • @RapidGainz Ah, yes, the fake monitor works fine. I ended up adding a monitor to my host just for that reason. But anyway, in my startup service file my exec line looks like ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared And mine only asks for the password. – Terrance May 27 '19 at 20:52