vnc-serverxdotool

xdotool is not functioning properly when I start my vnc session using Xvnc instead of vncserver


I was using xdotool in my GUI tests and it was functioning properly. Then I had to change my tests to start the vnc session using Xvnc command instead of vncserver command (TigerVNC 1.8.0) because the vncserver command was failing on some machines, that's when my tests starts to fail. When I run the tests I find that commands like

xdotool key Return

never get executed (the command doesn't error however no return key is pressed). Anyone knows what could have caused that and how to fix it?


Solution

  • Noticing the processes that vncserver command runs vs the processes Xvnc command runs, I noticed that vncserver runs a Xvnc server process and also runs that script ~/.vnc/xstartup which starts the window manager that xdotool seems to need to function properly. My xstartup file contents:

    #!/bin/sh
    
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    /etc/X11/xinit/xinitrc
    vncserver -kill $DISPLAY