Ubuntu 22.04 has a bug which is we can't share our screen on any platforms.
5 Answers
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_TYPEIf 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.confUncomment this line.
WaylandEnable=falseReboot your system.
Voila! You can share your screen. You can confirm this by re-entering this command.
echo $XDG_SESSION_TYPENow it should display x11.
Enjoy!
4I 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
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.confAt chrome experimental features enable the WebRTC PipeWire support
chrome://flags/#enable-webrtc-pipewire-capturerRestart the browser and now you can share your screen.
As mentioned this is a Security Feature of Wayland. You can either use XOrg or disable the save mode of Wayland by doing:
- Press
Alt+F2 - Type
lgand press enter - Disable save mode by typing
global.context.unsafe_mode=trueand 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
Just install
sudo apt-get install xorg openbox 2