Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Dec 03, 2011 12:05 pm 
Offline

Joined: Sat Dec 03, 2011 11:54 am
Posts: 1
I have Ubuntu Server 10.04 installed on Linode 512.

Somehow my program uses sun.awt graphics library in Java. It requires X server installed and running.

I did the following:

1) I tried
Code:
export DISPLAY=:0.0
and launched my program. It didnt work. It says :
Code:
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.


I also tried
Code:
xhost +
command. It also says
Code:
xhost:  unable to open display ":0.0"


2) I installed xorg
Code:
apt-get install xorg
(which already has xserver-xorg xserver-xorg-core etc.)

3) Then I tried
Code:
startx
command to start X.org Server. It basically says
fatal server error: no screens found

Code:
X.Org X Server 1.7.6
Release Date: 2010-03-17
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-29-server i686 Ubuntu
Current Operating System: Linux li195-5 3.0.4-linode38 #1 SMP Thu Sep 22 14:59:08 EDT 2011 i686
Kernel command line: root=/dev/xvda xencons=tty console=tty1 console=hvc0 nosep nodevfs ramdisk_size=32768 ip_conntrack.hashsize=8192 nf_conntrack.hashsize=8192 ro  devtmpfs.mount=1
Build Date: 20 October 2011  03:05:54PM
xorg-server 2:1.7.6-2ubuntu7.10 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.16.4
   Before reporting problems, check http://wiki.x.org
   to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
   (++) from command line, (!!) notice, (II) informational,
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Dec  3 11:00:15 2011
(==) Using config directory: "/usr/lib/X11/xorg.conf.d"
(EE) No devices detected.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support
    at http://wiki.x.org
 for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.

 ddxSigGiveUp: Closing log
giving up.
xinit:  No such file or directory (errno 2):  unable to connect to X server
xinit:  No such process (errno 3):  Server error.



4) I came across a post in this forums archive/o_t/t_264/running_x_server_on_minimal_distribution.html

a user tries

Code:
# grep X /etc/ssh/sshd_config 
X11Forwarding yes
X11DisplayOffset 10


and founds out that DISPLAY should be :10, therefore I also have tried

Code:
export DISPLAY=:10
and still does not work.

Does anyone have an idea why can't we install X.org Server on Linode?


Top
   
 Post subject:
PostPosted: Sat Dec 03, 2011 1:47 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Be aware that the client/server paradigm is "backwards" for the X Window System: "clients" are the programs you run, the "server" is the thing that tells your monitor to emit light. So, in the typical X11-over-the-network case, your application on your Linode would be the "client" and the X server on your workstation would be the "server". In other words, you run the client on the server to talk to the server on the client. ;-)

There's two ways to do what you're trying to do here. The first is the quick-and-easy mostly-automatic way, which tunnels connections from a remote machine to your local workstation's X server over ssh. This is nice because you already have everything to make it go (assuming your workstation isn't running Windows or some other non-X11 platform). Downside is that it has some performance constraints and requires that you be logged in and connected for clients to get their X fix. Nevertheless, if you just need it to get something installed or to run an occasional command, or are working over a LAN, it's awesome.

In this scenario, the DISPLAY variable will be set automatically if ssh tunneling is working, so you shouldn't have to set that. There are a few things that have to be present for it to work properly; xauth on the "client" side (your Linode) is probably the one I forget most often. You shouldn't have to mess around with xhost on the "server" side (your workstation), generally speaking.

Also, try the -v option when you connect to make sure the ssh client is requesting forwarding:

Code:
rtucker@witte:~$ echo $DISPLAY   # on my local machine
:0.0
rtucker@witte:~$ ssh -v framboise
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/rtucker/.ssh/config
...
debug1: Requesting X11 forwarding with authentication spoofing.
...
rtucker@framboise:~$ echo $DISPLAY    # on my Linode
localhost:10.0


If your local workstation's DISPLAY variable isn't set, ssh won't even try to negotiate X11 forwarding, for perhaps obvious reasons.

Code:
rtucker@witte:~$ unset DISPLAY
rtucker@witte:~$ echo $DISPLAY

rtucker@witte:~$ ssh -v framboise
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/rtucker/.ssh/config
...
(no mention of X11 at all)
...

rtucker@framboise:~$ echo $DISPLAY

rtucker@framboise:~$


The second approach is to install an X server on your Linode and have clients connect to that, then have some way for you to interact with it. The traditional tell-your-monitor-to-emit-a-blue-pixel-there configuration won't work, since your Linode doesn't have a video card. So, you'll need to install something like vnc4server to make it go. Per this page, I suspect you should just be able to

Code:
$ sudo apt-get install xorg vnc4server
$ vncserver :1


then connect a VNC client to port 5091 on your Linode and enjoy. Security and automation are left as an exercise for the reader.

I haven't tested this in awhile, 'tho I probably will if my wife keeps complaining about her PC being slower than some of my embedded systems. Nothing like ~50 ms of round-trip network latency to make you appreciate localhost.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Sat Dec 03, 2011 5:55 pm 
Offline
Senior Member

Joined: Sun May 23, 2010 1:57 pm
Posts: 315
Website: http://www.jebblue.net
Depending on what your program does and how it works you might be able to just use Java's headless mode:

java -Djava.awt.headless=true

http://java.sun.com/developer/technical ... /headless/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group