Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using an Ubuntu Server EBS-based AMI on Amazon EC2. I have installed the desktop packages and ssh -X to my machine using the default ubuntu account but when I enter the command:

startx

I get the following output:

X: user not authorized to run the X server, aborting.

What do I need to do to get a remote X session running from here?

share|improve this question
1  
Do you actually want a full desktop, or is running individual tools adequate? What client OS are you connecting from. –  Zoredache Nov 6 '10 at 3:37
    
I do want a full desktop. I am connecting from OS X and have successfully run remote desktop sessions from another Ubuntu machine on my LAN. –  ProbablePattern Nov 6 '10 at 12:36
    
Beware programmers carrying screwdrivers... –  gWaldo Nov 7 '10 at 1:43
    
@gWaldo There are some programs that can't be run without a screen. (At least as far as I can tell, this is the easiest or only solution java headless-exceptions.) –  isomorphismes Dec 17 '12 at 2:23
add comment

3 Answers 3

startx is used when you want to run a full X server, which is almost never what you want to do on a remote system. Instead, just run the app directly and ssh will forward the X messages to your local system.

share|improve this answer
1  
Even when I use ssh -X -C -i key.pem ubuntu@mymachine to login, I can't get an X session. –  ProbablePattern Nov 6 '10 at 3:17
    
Have you double checked. Maybe X11 forwarding is disabled in your sshd_config. –  Zoredache Nov 6 '10 at 3:34
1  
X11 forwarding is set to yes in sshd_config –  ProbablePattern Nov 6 '10 at 12:48
add comment

Are you sure that you do, indeed have X installed? One clue would be to see if you have an /etc/X11/xorg.conf (especially if it's not just a blank file)

Also, do you have any GUI apps installed?

share|improve this answer
add comment

sudo xinit

Do you have gnome-desktop-environment installed?

BTW, you can look through programs to install with apt-cache search gnome-desktop. Might be helpful in whatever you're trying to do.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.