In crontab, the script is executed in a totally different environment than from xterm.
For practice, make a script that exports the environment to a logfile.
refer to bash's manpage for how to do this
OTOH root ain't supposed to have access to X, as it's a security hole