How can I specify a display?

前端 未结 11 889
挽巷
挽巷 2020-12-02 05:40

When I run some programs over SSH, such as firefox &, I get an error

Error: no display specified 

I would like to open ma

相关标签:
11条回答
  • 2020-12-02 05:56

    I through vnc to understand the X11 more. To specify the display to get a many-displayed program, export DISPLAY=IP:DisplayNum.ScreenNum

    For example,

    vncserver :2
    vncserver -list
    echo '$DISPLAY'=$DISPLAY 
    export DISPLAY=:2  # export DISPLAY=IP:DisplayNum or export DISPLAY=:DisplayNum for localhost; So that can vnc connect and see the vnc desktop :2 if $DISPLAY is not :2.
    echo '$DISPLAY'=$DISPLAY
    
    0 讨论(0)
  • 2020-12-02 06:05

    Even i faced the same in CentOS 6.8.

    yum reinstall xorg*
    

    End your current session and open another session in tool like mobiXterm. Make sure session has X11 forwarding enabled in the tool.

    0 讨论(0)
  • 2020-12-02 06:06

    Please do NOT try to set $DISPLAY manually when connecting over SSH.
    If you connect via SSH -X and $DISPLAY stays empty, this usually means that no encrypted channel could be established.

    Most likely you are missing the package xauth or xorg-x11-xauth. Try to install it on the remote machine using:

    sudo apt-get install xauth
    

    or

    sudo apt-get install xorg-x11-xauth
    

    After that end and restart your SSH connection. Don't forget to use SSH -X so that X Window output is forwarded to your local machine.

    Now try echo $DISPLAYagain to see if $DISPLAY has been set automatically by the SSH demon. It should show you a line with an IP address and a port.

    0 讨论(0)
  • 2020-12-02 06:11

    Try installing the xorg-x11-xauth package.

    0 讨论(0)
  • 2020-12-02 06:13

    Try

    export DISPLAY=localhost:0.0
    
    0 讨论(0)
  • 2020-12-02 06:17
    $ export DISPLAY=yourmachine.yourdomain.com:0.0
    $ firefox &
    
    0 讨论(0)
提交回复
热议问题