02-26-2016, 09:36 PM
You need to have an X server running, the user needs to have Xauth and/or ACLs need to be disabled, and the proper environment variable needs to be exported. Have a look at the wiki article on the topic, it's a bit outdated but has all of the relevant bits you need in there.