Ubuntu 22.04 has a bug which is we can't share our screen on any platforms.
-
What does it look like when you can't share your screen? For me, on Ubuntu 22.04 LTS, I have the share screen button, and can click through fine to share a screen, and it switches as if it's about to share screen on the view for others. But it then doesn't share my screen, just the Teams view of my user icon. If, however, I leave the meeting and come back once or twice or sometimes 3-5 times, the screen share starts working. I'm using X11 by default, not wayland, because my laptop has an Nvidia GPU. – CivMeierFan Sep 22 '23 at 17:00
13 Answers
The issue with Ubuntu 22.04 is that it now uses a display feature called wayland by default, while in versions prior to 21.04 Ubuntu defaulted to using xorg as its display server. Wayland does not support screen sharing by default (until now, at least!).
To check which display system your Ubuntu is using, please enter this command
echo $XDG_SESSION_TYPE
If the above command outputs wayland, your system is using wayland.
In order to use screen sharing, 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.
If x11 is not shown yet, run the command below:
sudo systemctl restart gdm
-
8Lifesaver, thank you. I've had this issue ever since upgrading to 22.04, I'm still shocked this question barely has any upvotes. – gordon_freeman May 12 '22 at 06:43
-
after I did that, the screen sharing is working but it's super slow – Kyaw Kyaw Soe Jun 02 '22 at 12:11
-
5people using DisplayLink could have problems because of x11 compatibility (using 2 displays through a docking station, for example) – rogelio Jun 09 '22 at 20:45
-
8The minimum qualification for using Ubuntu should be to be a stackexchange user lol. This is really bad practice they break functionality in a stable upgrade. – ahron Aug 16 '22 at 11:32
-
1
-
-
15this gets you working with thirty year old tech, a more modern solution: see next answer (enabling chrome pipewire support) – bernstein Aug 23 '22 at 16:46
-
3I think the author of this answer should warn people that other issues can be compromised by downgrading to Xorg, such as this case, for example. – Camilo Febres Aug 24 '22 at 05:00
-
14
-
This also worked for me. On X11 now and everything is working as supposed to. I guess it will take another 15 years for them to sort this Wayland bs out ¯_(ツ)_/¯ – Jorge Campos Oct 04 '22 at 22:29
-
1So, there is no disadvantage of using X11 instead of Wayland? – Agnishom Chattopadhyay Oct 18 '22 at 22:06
-
2
-
2problem with x11 I have: touch screen not working properly, any dialog window has no focus -> which is super anoying. This shouldn't be accepted answer. – Dutch77 Mar 08 '23 at 08:27
-
This should not be the accepted answer. As others have said, while downgrading might indeed help the problem, I just don't feel like downgrading is the right solution. – Mike Williamson Mar 08 '23 at 13:04
-
3@gordon_freeman Once you select your user in the login screen, a cog-like button appears in the lower right corner. Clicking on it let's you select "Ubuntu on Xorg" vs "Ubuntu" (which defaults to Wayland). It will remember this preferences for your user. – Tulains Córdova Mar 08 '23 at 15:22
-
@DBencz indeed, I was using gnome gesture improvements https://extensions.gnome.org/extension/4033/x11-gestures/, however when switching to X11 it no longer works. I had to use https://extensions.gnome.org/extension/4245/gesture-improvements/ gesture improvements for X11 instead and was able to get gestures back (three finger swipe to reveal all windows and horizontal three finger swipe to change desktop), it is less customizable indeed, but at least we get functionality back. – gordon_freeman Sep 28 '23 at 16:57
-
If I do this, my computer doesn't boot, is someone experimenting this issue? I had to set back the
WaylandEnable=false
– Henry Navarro Nov 15 '23 at 13:16 -
Simply logging in with xorg seems to be more appropriate for just switching over when screen sharing is desired – matanox Feb 03 '24 at 11:44
-
@matanster how do you do this? I don’t see any such option on the logging screen. – bfontaine Feb 21 '24 at 08:53
Only works for web browser
Go to chrome://flags/#enable-webrtc-pipewire-capturer
using the address bar of your browser.
Click the drop down menu, and click Enabled.
Finally Restart the browser
This will enable the browser to prompt screenshare access
-
4
-
4It worked perfectly for me and without the need of switching to Xorg. – Camilo Febres Aug 24 '22 at 04:32
-
4Actually, it doesn't need to reboot the system, just restart the chrome. – Muhammad Dyas Yaskur Sep 09 '22 at 01:56
-
@MuhammadDyasYaskur thanks for the suggestion will update – Jatin Krishna Habibkar Sep 09 '22 at 11:55
-
2This doesn't work for me using Chrome, Teams and Ubuntu 22.04 with Wayland and who know what other components are relevant to this – Hakaishin Sep 28 '22 at 09:47
-
2
-
This solution is bettern then activating X11 because X11 can cause other problems such as mouse freez on newer laptops with amd ryzen. – newandlost Feb 07 '23 at 10:32
-
1This didn't work for me, I had to disable Wayland in favour of X11 as the accepted answer suggests. – Caumons May 02 '23 at 08:22
-
-
1The chrome://flags/#enable-webrtc-pipewire-capturer option is no longer there in latest Chrome ... – matanox Feb 03 '24 at 11:41
For Slack in-app screen recording and screen sharing before version 4.33.90 (the entire video capture got broken in or around 4.33.90, so I'm unable to test screen recording):
- Quit the Slack app completely (use
Quit
from the tray icon). - In the terminal:
slack --enable-features=WebRTCPipeWireCapturer
- See if it works.
- (Optional) Persist the change across reboots:
gedit admin:///usr/share/applications/slack.desktop
In text editor find a line that says:
Exec=/usr/bin/slack %U
Change the line to say:
Exec=/usr/bin/slack --enable-features=WebRTCPipeWireCapturer %U
That's it. Tested on Ubuntu 22.04LTS and:
$ slack --version
4.27.156
$ echo $XDG_SESSION_TYPE
wayland
$ dpkg -l | grep -i pipewire
ii libpipewire-0.3-0:amd64 0.3.48-1ubuntu1 amd64 libraries for the PipeWire multimedia server
ii libpipewire-0.3-common 0.3.48-1ubuntu1 all libraries for the PipeWire multimedia server - common files
ii libpipewire-0.3-modules:amd64 0.3.48-1ubuntu1 amd64 libraries for the PipeWire multimedia server - modules
ii libspa-0.2-modules:amd64 0.3.48-1ubuntu1 amd64 libraries for the PipeWire multimedia server Simple Plugin API - modules
ii pipewire:amd64 0.3.48-1ubuntu1 amd64 audio and video processing engine multimedia server
ii pipewire-bin 0.3.48-1ubuntu1 amd64 PipeWire multimedia server - programs
ii pipewire-media-session 0.4.1-2ubuntu1 amd64 example session manager for PipeWire
Source: https://github.com/flathub/com.slack.Slack/issues/101#issuecomment-808430530

- 572
-
Slack (Snap 4.33.90 64-bit) appears to completely ignore this option. When I dump the logs for troubleshooting it does not show it as something that got configured. By setting the pipewire flag in chrome (above), I can share screens when I run Slack in a Chrome tab. It is just the electron app that doesn't work. Also, FWIW, the snap version of slack complains vociferously if you try to edit the desktop file (which is in the /opt/snap folder) even as root. – rotten Sep 07 '23 at 20:42
-
@rotten Yeah, thanks. Previously video capture didn't work, whereas now on 4.33.90 (electron non-snap) the whole process segfaults with a sole syslog line
[0908/160234.011451:ERROR:elf_dynamic_array_reader.h(64)] tag not found
which comes from crashpad (so it's probably a bug in crash handling, unrelated to the root cause). – kubanczyk Sep 08 '23 at 14:13
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.

- 81
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

- 150
-
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. – Community May 31 '22 at 19:49
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
lg
and press enter - 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

- 179
-
-
alt-f2
brings up the headphones volume control for me.lg
as a command doesn't exist. – rotten Sep 07 '23 at 20:44 -
@polyte, this works for me. Useful since sharing appears broken again in 5.15.12.7665. NOTE: It appears your plugin simply logical NOTs the current value for
global.context.unsafe_mode
rather than setting it totrue
when the switch is on andfalse
when it's off. This means if you previously manually set it totrue
before installing your plugin your state will be backwards (as I did). I suggest having the switch determine if you set it totrue
orfalse
in the plugin to avoid this. I created a PR to change this (warning, untested :)). – stuckj Sep 13 '23 at 16:10 -
@rotten you might need to press a function (fn) key. Depends on your (laptop) keyboard. See https://wiki.gnome.org/Projects/GnomeShell/CheatSheet#Developer_tools – polyte Sep 15 '23 at 16:37
-
That does not work as a shortcut to open a text window on my laptop. alt/control/function or any combination of them. It is ok, I always have a dozen or more windows open already. The "lg" command does not exist on my machine either. It must be a separate package that needs to be installed. – rotten Sep 18 '23 at 22:16
-
@rotten lg is not a installable package. Alt+F2 will bring up the gnome prompt dialogue and lg will open the gnome debugger. This does not work in your normal shell. – polyte Sep 19 '23 at 17:39
-
There seems to also be a gnome extension for it. https://github.com/linushdot/unsafe-mode-menu?tab=readme-ov-file. although the above makes it simpler through just one shell command. – matanox Feb 03 '24 at 12:05
I changed graphic drivers (in additional drivers menu) from xorg-server to Nvidia proprietary. It worked for me.

- 31
-
Replacing the Nvidia Nouveau driver with the proprietary one did the trick. – Sergey May 17 '23 at 15:32
I have a computer with a Nvidia EVGA Geforce GTX - 1660 Super graphic card with a Ubuntu 22.04.3 LTS OS and none of the above answers worked for my case. Neither the chrome flag, neither dismissing the safe mode of wayland and neither changing to use xorg on logon screen.
What did the job was going into Additional Drivers then select the option Using NVIDIA driver metapackage from nvidia-driver-535 (proprietary, tested)
amongst many others (this one did the job at first so I didn't change anymore).
Previously the selected one was the Using X.Org X server -- Nouveau display driver from xserver-xorg-video-nouveau (open source)
Hope it helps someone.

- 31
-
Same here. I had to run apt upgrades, then try and switch to this driver a couple of times before it would 'take' without an error. Then a restart was necessary before screen-sharing actually worked. – twhitney Feb 06 '24 at 20:21
Now the screen sharing in Wayland is available with the zoom client for Ubuntu.
Check the release notes in 5.11.0 (3540)
release.
-
Still not working. I'm on 5.12 and it is still broken. Changing to x11 was the only thing that worked. – Jorge Campos Oct 04 '22 at 22:38
-
After struggling for days I found the solution from this thread only
I changed graphic drivers (in additional drivers menu) from xorg-server to Nvidia proprietary. It worked for me.
But there are many! So the following one worked for me (just so you guys save time and know this actually works).
And doing the wayland method used to break my display and turn it into -ve colours.
Using NVIDIA Server Driver metapackage from nvidia-driver-535-server (proprietary)

- 144
- 11

- 11
- 2
(On Ubuntu 22.04.3 LTS)
Deactivating wayland as the first answer suggests worked the best but you have to give up the much better touchpad usess.
Alternatively I found a solution here that works on the browser version, at least for Zoom and Google Meet.
It requires installing the packages xdg-desktop-portal-gnome
and gnome-remote-desktop
and then rebooting:
sudo apt install xdg-desktop-portal-gnome gnome-remote-desktop
While reverting back to x11 did work for me, I wanted to find an alternative that allowed me to continue using Wayland. What ended up working was uninstalling the snap version of zoom and installing the .deb downloaded from Zoom's website

- 101
I was resolved by going to chrome://flags/#enable-webrtc-pipewire-capturer
and changing the value from Default
to Enabled
.
then
Search for the file.conf in /etc/gdm3/ in my case, Ubuntu 20, it's custom.conf
sudo nano /etc/gdm3/custom.conf
uncomment the line
#WaylandEnable=false
to be WaylandEnable=false
then reboot
"uncommenting that line will use the Xorg display manager instead of Wayland "
-
Please do not copy and paste identical answers to different questions on AU. The system has detected this exact answer given to 3 slightly different questions. – andrew.46 Sep 19 '22 at 23:16
-
Please do not copy and paste identical answers to different questions on AU. The system has detected this exact answer given to 3 slightly different questions. – andrew.46 Sep 19 '22 at 23:16
-