1. Open the terminal and type the following command to edit /etc/gdm/custom.conf file:
sudo vi /etc/gdm/custom.conf
2. Give your password and press Enter key.
3. Press "Insert" or "Ins" key to enter insert mode in vi editor.
4. Add below line after "#WaylandEnable=false" line.
DefaultSession=gnome-xorg.desktop
See below for my custom.conf file:
5. Press Esc key to exit edit/Insert mode.# GDM configuration storage
[daemon]
# Uncoment the line below to force the login screen to use Xorg
#WaylandEnable=false
DefaultSession=gnome-xorg.desktop
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
#Enable=true
6. Type :wq and press Enter key.
7. Restart your PC or log out.
8. At the login screen click your username.
9. Click the cogwheel ⚙ button near the Sign in button and select "Gnome on Xorg". Please see the screenshot.
10. Type your password and sign in.
Now your teamviewer should be able to connect. Please see the screenshot