Hoping someone can help. I have been searching the web put failed find a solution that has helped.I have recently updated my Ubuntu VM from version 20.04 to version 22.04. After the update was complete, I am no longer able to use winxserver to open a browser of the server on my local laptop screen. Luckly, I have a VMWare snapshot and can easily jump between the 2 version of the server. Ubuntu 20.04 works using the below steps, but 22.04 will not.
I have followed some hints found online:
/etc/ssh/sshd_config -> X11Forwarding yesecho $DISPLAY -> localhost:11.0cat /etc/hosts -> 127.0.0.1 localhost 127.0.1.1 server_name
I have tried deleting my .Xauthority file in the home directory of the user I am ssh'ing as, and letting it recreate at next log, but error persists.confirmed x11-apps is at latest version
sudo apt install x11-appsx11-apps is already the newest version (7.7+8build2).
Steps taken to reproduce:
On Windows 11 laptop installed cygwin with Xserver
Open cygwin, atthe prompt start the Xserver with command
startxwin -- -listen tcp
Open a 2nd window in cygwin
On the 2nd terminal screen set thedisplay variable ->
export DISPLAY=11.0
Attempt to ssh ->
ssh -Y -C user@IP firefox
Get prompt for password. After entering my password get error:
Could not find ':' in DISPLAY: 11.0Error: Can't open display: localhost:13.0
I then change my cygwin display to be 13.0 by using command '$ export DISPLAY=13.0'then get error.
Warning: No xauth data; using fake authentication data for X11 forwarding.Could not find ':' in DISPLAY: 13.0Error: Can't open display: localhost:14.0
For interest if I just use PuTTy and ssh to the server as the same user. Attempt to open firefox in the background from the command prompt, using command
firefox &
I get error:
server_name:~$ MoTTY X11 proxy: Unsupported authorisation protocol Error: cannot open display: localhost:11.0
Any ideas on how to fix this?
Hi Jos I gave your suggestion a try still getting error. When starting the Xserver in cygwin I see it exports the display as 0:0 -> winClipboardThreadProc - DISPLAY=:0.0. I have exported my display like you suggested: $ export DISPLAY=:0 Make ssh connection $ ssh -Y -C user@IP user@IP's password: Make connection to Ubuntu Server Attempt to start firefox kw@kpmg-apicup:~$ firefox & [1] 21635 user@server_name:~$ X11 connection rejected because of wrong authentication. Error: cannot open display: localhost:12.0
I seem to have found a solution by continuing to search on google. Incase anyone else gets this issue in the future here is what I did.
- Open cygwin session on windows 11 laptop
- From there start the xserver running command#startxwin -- -listen tcp
- check what display cygwin exports, in my case it was 0:0
- Open a new window on the cygwin and export Display#export DISPLAY=0.0
- On a ssh connection to the Ubuntu VM I then typed the below commandto start firefox, should be done as the user you want to connect as#XAUTHORITY=$HOME/.Xauthority /snap/bin/firefox (found this ongoogle)
- A couple of seconds later my firefox browser from the VM appears onmy laptop screen.