14.04.2017 - A simple and effective way to test that your display server is available and valid is to test it with xhost . You can't always rely on checking for a value in the .