Screen Share Not working in Ubuntu 22.04 (In all platforms zoom, teams, google meet, anydesk , etc.,)

10,681

Solution 1

The issue with Ubuntu 22.04 is using a display feature called wayland. Wayland is not supporting to screen share by default(Untill now, atleast!). In previous ubuntu version we had xorg for display feature.

To check which display feature your ubuntu is using, please enter this command

echo $XDG_SESSION_TYPE

If the above command outputs, wayland, your system is using wayland.

We have to disable wayland and enable xorg (x11). To do this,

Please go to this file

sudo nano /etc/gdm3/custom.conf

Uncomment this line.

WaylandEnable=false

Reboot your system.

Voila! You can share your screen. You can confirm this by re-entering this command.

echo $XDG_SESSION_TYPE

Now it should display x11.

Enjoy!

Solution 2

I tried the global.context.unsafe_mode=true solution, but Google Meet was still showing black screens, so didn't test it any further.

What worked for me was switching to X11/Xorg, which I did by

  • logging off
  • clicking gear icon at bottom right
  • selecting "Ubuntu on Xorg"
  • logging back in

Solution 3

Since Wayland is not supporting screen share by default, there is already an experimental way with chrome browser.

First you need to export the metadata API from the pipewire media sessions.

sudo mkdir -p /etc/pipewire/media-session.d/
sudo cp /usr/share/pipewire/media-session.d/media-session.conf /etc/pipewire/media-session.d/
sudo sed -i 's/#metadata/metadata/g' /etc/pipewire/media-session.d/media-session.conf

At chrome experimental features enable the WebRTC PipeWire support

chrome://flags/#enable-webrtc-pipewire-capturer

Restart the browser and now you can share your screen.

Solution 4

As mentioned this is a Security Feature of Wayland. You can either use XOrg or disable the save mode of Wayland by doing:

  1. Press Alt + F2
  2. Type lg and press enter
  3. Disable save mode by typing global.context.unsafe_mode=true and enter

This will work till you reboot/log out. I wrote a small Gnome Extension which does can disable the safe mode on demand. See https://github.com/julianpollmann/zoom-wayland-gnome-extension

Share:
10,681
Admin
Author by

Admin

Updated on January 04, 2023

Comments

  • Admin
    Admin over 1 year

    Ubuntu 22.04 has a bug which is we can't share our screen on any platforms.

  • Admin
    Admin almost 2 years
    Lifesaver, thank you. I've had this issue ever since upgrading to 22.04, I'm still shocked this question barely has any upvotes.
  • Admin
    Admin almost 2 years
    Please explain why you are thinking this command will help.
  • Admin
    Admin almost 2 years
    this fix my problem with Ubuntu 22 i was unable to share my screen on any meeting software until i find xorg and openbox was not installed after i installed them it works with me
  • Admin
    Admin almost 2 years
    thank you, dear sir
  • Admin
    Admin almost 2 years
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
  • Admin
    Admin almost 2 years
    after I did that, the screen sharing is working but it's super slow
  • Admin
    Admin almost 2 years
    people using DisplayLink could have problems because of x11 compatibility (using 2 displays through a docking station, for example)