Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a GUI test stand simulation connected to some hardware that is under test. The test stand is a Sun Sparc Ultra 2 SunOs 5.7. The simulation software checks to see if your running your display on :0.0. If not it won't apply power. We do not have the source to re-write the simulation to not check this. I have a need to "See" what is being displayed on the local terminal. I have tried x11vnc but it seems that Xsun might not support the record extension. SSH -X sets the DISPLAY to :10.0 so that is out. I really need to port forward the 6000 port to the say the 6001 port on my windows box running cgwin. (I am assuming 6001 is :1.0 and is what my x server on my windows box will be listing too). Is any of this possible I am at whits end.

Here is the offending code.

/* Console can always access the HW */
if (xserver != (char *) NULL)
    /* if the first two characters are ":0" */
    if ((xserver[0] == ':') && (xserver[1] == '0'))
        termtype = TERMINAL_LOCAL;
    else if (uname(&utshost) == 0)
        nnlen = strlen(utshost.nodename);
        if ((int) strlen(xserver) >= (int) (nnlen + 2))
            if ((strncmp(xserver, utshost.nodename, nnlen) == 0) &&
                    (xserver[nnlen] == ':') && (xserver[nnlen + 1] == '0'))
                termtype = TERMINAL_LOCAL;
                termtype = TERMINAL_REMOTE;
        } /* END if */
    } /* END if/else */
} /* END if */

I get this when running xdpyinfo -queryExtensions (truncated for relevancy):

name of display:    localhost:0.0  
version number:    11.0  
vendor string:    The Cygwin/X Project  
vendor release number:    11001000  
maximum request size:  16777212 bytes  
motion buffer size:  256  
bitmap unit, bit order, padding:    32, LSBFirst, 32  
image byte order:    LSBFirst  
number of supported pixmap formats:    7  
supported pixmap formats:  
    depth 1, bits_per_pixel 1, scanline_pad 32  
    depth 4, bits_per_pixel 8, scanline_pad 32  
    depth 8, bits_per_pixel 8, scanline_pad 32  
    depth 15, bits_per_pixel 16, scanline_pad 32  
    depth 16, bits_per_pixel 16, scanline_pad 32  
    depth 24, bits_per_pixel 32, scanline_pad 32  
    depth 32, bits_per_pixel 32, scanline_pad 32  
keycode range:    minimum 8, maximum 255  
focus:  window 0x200023, revert to PointerRoot  
number of extensions:    22  
    BIG-REQUESTS  (opcode: 132)  
    Composite  (opcode: 146)  
    DAMAGE  (opcode: 147, base event: 90, base error: 149)  
    DOUBLE-BUFFER  (opcode: 138, base error: 138)  
    DPMS  (opcode: 139)  
    GLX  (opcode: 148, base event: 91, base error: 150)  
    Generic Event Extension  (opcode: 128)  
    MIT-SCREEN-SAVER  (opcode: 133, base event: 82)  
    RANDR  (opcode: 143, base event: 88, base error: 146)  
    RECORD  (opcode: 137, base error: 137)  
    RENDER  (opcode: 142, base error: 141)  
    SGI-GLX  (opcode: 148, base event: 91, base error: 150)  
    SHAPE  (opcode: 129, base event: 64)  
    SYNC  (opcode: 134, base event: 83, base error: 133)  
    X-Resource  (opcode: 145)  
    XC-MISC  (opcode: 136)  
    XFIXES  (opcode: 141, base event: 86, base error: 139)  
    XFree86-Bigfont  (opcode: 140)  
    XINERAMA  (opcode: 144)  
    XInputExtension  (opcode: 130, base event: 65, base error: 128)  
    XKEYBOARD  (opcode: 135, base event: 85, base error: 136)  
    XTEST  (opcode: 131)  
default screen number:    0  

When I ssh name@server.com The $DISPLAY is servername:0.0 which is local but I can not see. When I ssh -X name@server.com The $DISPLAY is localhost:0.0 which my simulation sees as remote.

share|improve this question
x11vnc has a nxrecord command line option: see karlrunge.com/x11vnc/x11vnc_opts.html#opt-noxrecord – Frederik Deweerdt Aug 12 '11 at 4:52
It might help to know what extensions the Sun X server supports. Post the output of xdpyinfo -ext all (if that option doesn't exist, try xdpyinfo -queryExtensions). – Gilles Aug 14 '11 at 17:43
up vote 7 down vote accepted

If the simulation software really checks that the display number is 0, you can arrange for your remote display to be 0. Make sure you're not running Xsun locally or run it on a different display (e.g. Xsun :1). In the OpenSSH server configuration file /etc/ssh/sshd_config, add the line X11DisplayOffset 0.

If you connect over ssh, the DISPLAY environment variable will be set to localhost:0.0 (having set X11DisplayOffset as above). This is (for all practical purposes) synonymous to localhost:0 which your application accepts, so you can put this in your .profile:


If the simulation software wants a local display :0, you can try running it in Xvfb (virtual framebuffer X server, I don't know if it's shipped with Solaris). As above, don't run an X server locally on display :0, run it on :1 if at all. With Xvfb, you can't connect to the display easily, but you can see stills of the screens.

Xvfb :1 -screen 0 1024x768x16 -fbdir /tmp &
DISPLAY=:1 simulation-program &
xwud -in /tmp/Xvfb_screen0

Alternatively, you might try an X server that displays in a window, such as Xnest, Xephyr or VNC — again, if you're running a local X server at all on the Sun machine, run it on display :1. For example, with VNC:

vncserver :1

and you can even connect to that server with a VNC viewer on your Windows machine.

share|improve this answer
it checks localhost:0.0 – Paul Aug 12 '11 at 15:49
@Paul Ok, here are a few more things you can try. I can't test if my suggestions work since I don't have a Solaris 7 machine around, let alone your simulation software. Do you need help finding how to change the display number of the local X server? – Gilles Aug 14 '11 at 17:37
Added offending code. See know way around this. – Paul Aug 17 '11 at 16:01
@Paul Can't you recompile the code without this check? Given what you've posted, any of the solutions I propose would work, if you can arrange to run Xsun on a display other than :0. All this takes is adding :1 on the Xsun command line; I don't know where to control that on Solaris, but probably in a file under /etc. – Gilles Aug 17 '11 at 18:42
No I can't recompile the code. The problem is that the DISPLAY var is localhost:0.0. It really does not like that. Now I have done this. I did this export DISPLAY=:0.0 then I SSH'd just using SSH me@server. I echoed $DISPLAY it was server:0.0. Which should work looking at the above c code. – Paul Aug 17 '11 at 19:07

Your Answer


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.