If you have logged into X in a ‘normal’ fashion, you shouldn’t need to go through all that just to start an X application.
DISPLAY is the proper environment variable for display, though – not display. Try export DISPLAY=0.0 instead of
specifiying localhost. More detail on the steps that you are performing and the actual error message might help more.