Firefox with X11 Forwarding is not working

11,788

Firefox is using some specialities of X so it does not work over X11 forwarding out-of-the box. You need to play a bit with switches to firefox binary. Basically specifying X11 display. This works for me:

firefox --no-remote --no-xshm

or similar.

Share:
11,788

Related videos on Youtube

sebelk
Author by

sebelk

Updated on September 18, 2022

Comments

  • sebelk
    sebelk over 1 year

    I cannot open firefox via ssh:

    I've tried with:

    ssh -vvv -X [email protected]
    

    But it outputs:

    debug3: send packet: type 50
    debug2: we sent a password packet, wait for reply
    debug3: receive packet: type 52
    debug1: Authentication succeeded (password).
    Authenticated to 192.168.40.21 ([192.168.40.21]:22).
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug3: send packet: type 90
    debug1: Requesting [email protected]
    debug3: send packet: type 80
    debug1: Entering interactive session.
    debug1: pledge: exec
    debug3: receive packet: type 91
    debug2: callback start
    debug1: X11 forwarding requested but DISPLAY not set
    debug2: fd 3 setting TCP_NODELAY
    debug3: ssh_packet_set_tos: set IP_TOS 0x10
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug3: send packet: type 98
    debug1: Sending environment.
    debug3: Ignored env HOSTNAME
    debug3: Ignored env SHELL
    debug3: Ignored env TERM
    debug3: Ignored env HISTSIZE
    debug3: Ignored env USER
    debug3: Ignored env LS_COLORS
    debug3: Ignored env MAIL
    debug3: Ignored env PATH
    debug3: Ignored env PWD
    debug1: Sending env LANG = es_AR.UTF-8
    debug2: channel 0: request env confirm 0
    debug3: send packet: type 98
    debug3: Ignored env KDEDIRS
    debug3: Ignored env HISTCONTROL
    debug3: Ignored env SHLVL
    debug3: Ignored env HOME
    debug3: Ignored env LOGNAME
    debug3: Ignored env CVS_RSH
    debug3: Ignored env LESSOPEN
    debug3: Ignored env _
    debug2: channel 0: request shell confirm 1
    debug3: send packet: type 98
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug3: receive packet: type 99
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug3: receive packet: type 99
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    

    And then:

    Error: no display specified
    

    And:

    ls -l .Xauthority 
    -rw-------. 1 user user 73 may 31 13:21 .Xauthority
    

    UPDATE:

    I've found that if I run another X app it works:

    links -g
    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 2 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59036
    debug2: fd 7 setting O_NONBLOCK
    debug3: fd 7 is O_NONBLOCK
    debug1: channel 1: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    

    But not with Firefox:

    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 2 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59038
    debug2: fd 7 setting O_NONBLOCK
    debug3: fd 7 is O_NONBLOCK
    debug1: channel 1: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59040
    debug2: fd 8 setting O_NONBLOCK
    debug3: fd 8 is O_NONBLOCK
    debug1: channel 2: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    debug2: channel 2: rcvd adjust 40476
    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 4 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59042
    debug2: fd 9 setting O_NONBLOCK
    debug3: fd 9 is O_NONBLOCK
    debug1: channel 3: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    debug2: channel 3: rcvd adjust 32792
    debug3: receive packet: type 96
    debug2: channel 3: rcvd eof
    debug2: channel 3: output open -> drain
    debug2: channel 3: obuf empty
    debug2: channel 3: close_write
    debug2: channel 3: output drain -> closed
    debug1: channel 3: FORCE input drain
    debug2: channel 3: ibuf empty
    debug2: channel 3: send eof
    debug3: send packet: type 96
    debug2: channel 3: input drain -> closed
    debug2: channel 3: send close
    debug3: send packet: type 97
    debug3: channel 3: will not send data after close
    debug3: receive packet: type 97
    debug2: channel 3: rcvd close
    debug3: channel 3: will not send data after close
    debug2: channel 3: is dead
    debug2: channel 3: garbage collecting
    debug1: channel 3: free: x11, nchannels 4
    debug3: channel 3: status: The following connections are open:
      #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)
      #1 x11 (t4 r2 i0/0 o0/0 fd 7/7 cc -1)
      #2 x11 (t4 r3 i0/0 o0/0 fd 8/8 cc -1)
      #3 x11 (t4 r4 i3/0 o3/0 fd 9/9 cc -1)
    

    UPDATE 2

    I've tried even disabling xshm and adding local cookie to remoto side with xauth command

    firefox --no-remote --no-xshm --display localhost:10.0
    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 2 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59181
    debug2: fd 7 setting O_NONBLOCK
    debug3: fd 7 is O_NONBLOCK
    debug1: channel 1: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    debug3: receive packet: type 90
    debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
    debug1: client_request_x11: request from 127.0.0.1 59183
    debug2: fd 8 setting O_NONBLOCK
    debug3: fd 8 is O_NONBLOCK
    debug1: channel 2: new [x11]
    debug1: confirm x11
    debug3: send packet: type 91
    debug2: channel 2: rcvd adjust 39228
    

    Just in case: SSH Server os CentOS 7.2 and SSH client os Fedora 23 ranking Xorg

    Nothing at all.

    What's wrong?

    • Luciano Andress Martini
      Luciano Andress Martini almost 8 years
      I know is non-sense but close all firefox session in your computer and try again, this helps?
  • sebelk
    sebelk almost 8 years
    I've tried disabling xshm too.
  • Vasco
    Vasco over 6 years
    When there is already a firefox instance running on the client, running "firefox" on the server will result in a new firefox window in the existing firefox instance on the client, instead of starting a new firefox instance on the server. "firefox --no-remote" fixes this unwanted behaviour.