3

Setup

My goal is to use a web browser in a VNC session.

I followed this page to install tightvncserver with xfce4. The session works fine, i.e. I am able to open all other GUI programs. I ran apt install firefox and snap install brave. Connection is via SSH jump and then port forwarding between localhost of both client and server.

Symptoms

When I try to launch browsers from GUI, nothing happens. On the command line I get for Firefox:

Client is not authorized to connect to ServerError: cannot open display: :1.0

And for Brave:

Client is not authorized to connect to Server[11997:11997:0704/151224.702071:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[11997:11997:0704/151224.702198:ERROR:env.cc(226)] The platform failed to initialize.  Exiting.
[0704/151224.705242:ERROR:ptracer.cc(567)] ptrace: Input/output error (5)
[0704/151224.705436:ERROR:ptracer.cc(567)] ptrace: Input/output error (5)
[0704/151224.742590:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0704/151224.753358:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0704/151224.753382:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
/snap/brave/166/opt/brave.com/brave/brave-browser: line 48: 11997 Trace/breakpoint trap   (core dumped) "$HERE/brave" "$@"

Things I tried

On Redhat bugzilla they say to run firefox -no-remote. Same issue as before in my case.

I found a lot of related answers, but none seem the same. But they have problems with X11, too. So I try some ideas I read there.

$XAUTHORITY is empty. $DISPLAY is :1.0. I try xauth list, because ~/.Xauthority exists:

host:1  MIT-MAGIC-COOKIE-1  f91ec0372bd83eb72b686a16530ebb43
[five times the line above]
host/unix:1  MIT-MAGIC-COOKIE-1  f91ec0372bd83eb72b686a16530ebb43

Just in case, I try to set the environment variable:

export XAUTHORITY=c441e3e34e057b5a868d5520dc47e7f4

Still the same error. But echo $XAUTHORITY shows the cookie. Also Gilles states here that ~/.Xauthority is used, when it is not set. The cookie values differ, because I restarted xvncserver and deleted+recreated ~/.Xauthority before I wrote this.

Arch wiki lists: xhost +si:localuser:$USER. I did it for my user and root. As far as I understand, this lowers security, but many answers use it as a quick fix. In my case, it throws:

localuser:root being added to access control list
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0x5
  Serial number of failed request:  6
  Current serial number in output stream:  8

I am not sure if the error even relates to my problem. The same issue is caused by bugs or when the system is build wronlgy. Both things I cannot change at the moment.

By now, I am bit clueless:

  • What is my problem?
  • How can I solve it?

If someone knows a solution it would be great. But my priority is to have a browser inside a VNC session, so any kind of workaround would also be appreciated.

I also tried to enable SSH X11Forwarding in sshd_config. It did not work. I think this is unrelated, as I use VNC instead of ssh -X option.

Paul Smith
  • 193
  • 1
  • 8

3 Answers3

0

A workaround is to install tigervnc (Tutorial). Also the desktop environments can be installed via tasksel to reduce the chance for mistakes in that step.

In xfce Firefox and Brave both work. On gnome Firefox installed from apt works.

In the specific question, Brave had a snap error similar to this one, when launched on gnome. Also this bug was also still present.

Paul Smith
  • 193
  • 1
  • 8
0

I hit the same issues when launching an AWS Ubuntu EC2 (22.04 LTS ami) instance then installing xfce & tightvncserver on it. The default Firefox browser does not work out of the box, installing a new Firefox (via SNAP) is no bueno, hit this error:

client is not authorized to connect to server cannot open display 1:0

There are tons of online posts on Ubuntu GUI Desktop and remote access options, but none helped - either due to they were for older Ubuntu versions or missing some details or no longer applicable or obsolete.

I ended up installing google-chrome by following this 2/18/23 post and it works for my case.

[Edit] Added step by step instructions for how to resolve the following ubuntu 22.04 xfce desktop default browser launch error:

Unable to Launch Browser input/output error

1. in GUI desktop, start a terminal session, run commands in Step 2 to 4
2. sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
3. sudo apt install ./google-chrome-stable_current_amd64.deb
4. google-chrome
5. in GUI Desktop, click Settings > Default Applications > Web Browser
6. select chrome as the default browser, save the change.
7. in GUI Desktop, click default web browser icon to launch the chrome browser

Note: To enable connection via SSH then port forwarding between localhost of both client and server, I added SG inbound rules to my Ubuntu EC2 instance for ssh (port 22) & custom tcp (port 9501) to accept requests from anywhere on the internet. Add a rdp (port 3398) rule if you want to connect to the VNC server via RDP.

enter image description here Hopefully this answer may help someone with the same use case (web browser on ubuntu 22.04 LTS, xfce & tightvncserver)

0

Try this: rm -rfv ~/.Xauthority*

It worked for me