15

When trying to enable "Screen Sharing" under the "Sharing" section of the system settings I can click on the "ON/OFF" slider but it will not stay set to "ON". I can set the "Sharing" slider to "ON" and the "Remote Login" slider to "ON" but not the "Screen Sharing" one. Am I missing something?

Running Ubuntu 18.04.1 LTS and have attempted this both on GNOME on xorg and GNOME Flashback

2

This happened to me, here is how I corrected it.

My network showed "wired-unmanaged"; to correct this, I had to do the following:

Note: If you're interested in a set of commands to copy/paste into your terminal, I'd encourage you to review these instructions first, before running the commands listed at the end of this answer.

  • cd /etc/NetworkManager
  • save NetworkManager.conf to NetworkManager.orig (as a backup)
  • sudo vi NetworkManager.conf

    Change managed=false to managed=true

    New file looks like this:

    [main]
        plugins=ifupdown,keyfile
    [ifupdown]
        managed=true
    [device]
        wifi.scan-rand-mac-address=no
    
  • sudo service network-manager restart
  • cd /etc/netplan
  • sudo vi 50-cloud-init.yaml

    Add this line just below network:

    renderer: NetworkManager

    New file looks similar to this (ensure the renderer line is indented as shown):

    network:
        renderer: NetworkManager
        ethernets:
            enp3s0:
                addresses: []
                dhcp4: true
    version: 2
    
  • save
  • sudo netplan apply
  • I had then to restart the computer for this to be effective.
  • After restart the network will now show "wired-connected"
  • Then you can go to Settings » Sharing » Screen Sharing
    • You should now be able to toggle Screen Sharing to ON
    • Under Networks (bottom of dialog), toggle those ON as well

Commands

If all you're looking for is some terminal commands, and you haven't made any manual changes to the files mentioned in the instructions above, running the commands below should take care of the file modifications:

cd /etc/NetworkManager
sudo cp NetworkManager.conf NetworkManager.orig
# Change NetworkManager.conf: 'managed=false' to 'managed=true'
sudo sed -i 's/managed=false/managed=true/g' NetworkManager.conf
sudo service network-manager restart
cd /etc/netplan
# Ensure networks are managed by NetworkManager
# Whitespace in this command is important!
sudo sed -i '/^network:/a \    renderer: NetworkManager' 50-cloud-init.yaml
sudo netplan apply
# Restart your machine, or uncomment one of the lines below:
#sudo shutdown -r now
#gnome-session-quit --reboot

After you run these commands, refer to the final step above to enable screen sharing.

  • Thanks for the reply Jay, I took a shot at the changes, the first part with the NetworkManger worked fine. The second part when I update the netplan I get an error on that new line that says "Error in network definition: expected mapping". Any idea what to do there? – thewill2live Nov 13 '18 at 5:12
  • /etc/Netplan I don't have this directory – PetroCliff Dec 23 '18 at 19:04
  • @dpg I assume this was a mistake; the folder is /etc/netplan, all lower-case. – Joshua Shearer Jan 4 at 17:45
  • This didn't helped for me. Is there any ozher solution to get Screen sharing to work? – sporc Jan 11 at 10:05
  • 1
    In my case, I didn't have the file 50-cloud-init.yaml, I had 01-netcfg.yaml (probably I followed a tutorial to setup netplan and that's why I got it) and I changed the renderer to NetworkManager (was networkd before). After sudo netplan apply I clicked "Connect" and it was not needed to restart the PC. Sharing > screen sharing worked. – firepol May 30 at 20:22
0

I assume he added the ethernet and interface lines. You have to make sure the interface for your computer is used. His was enp3s0

You can run "ip a" and it will list your network devices. Will look like this:

:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever
2: ens2f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:67:79:08:5c brd ff:ff:ff:ff:ff:ff
inet 131.192.176.162/24 brd 131.192.176.255 scope global dynamic noprefixroute ens2f0
   valid_lft 680301sec preferred_lft 680301sec
inet6 fe80::21e:67ff:fe79:85c/64 scope link
   valid_lft forever preferred_lft forever
3: ens2f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:1e:67:79:08:5d brd ff:ff:ff:ff:ff:ff

Note in this there are 2 interfaces: ens2f0 and ens2f1

I realize you asked this question a while back. You should be able to get screen share working.

0

For me, I couldn't enable screen sharing, because I was running in "Wayland" (as that was the only desktop I could use). Well, Wayland doesn't support the screen sharing option. I fixed this issue by switching to the original XOrg "Ubuntu" desktop. In order to get that to work, however, there was a battle...

Check out my post on this other thread: Ubuntu 18.04 won't show desktop after login

0

I had this problem from two new installs of 18.04. The fix that worked was running code below in a terminal and then rebooting:

sudo apt install vino

Answer was from here: Cannot turn on sharing on ubuntu 18.04

0

Use x0vncserver as explained in how to start a vnc server for the actual display.

sudo apt-get install tigervnc-scraping-server

Then set a password

vncpasswd

Then start the server with

 x0vncserver -passwordfile ~/.vnc/passwd -display :0
0

@Jay's answer is good. The problem is caused if one disables network manager and instead use networkd in netplan. To continue to use networkd, I simply added:

/usr/lib/vino/vino-server

To my Startup Applications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.