0

I am new to elementary os but have used ubuntu for a long time.

I have use gnome-sessions as my vnc server option through the settings - Sharing, especially because this option works without requiring sudo.

Does elementary os come with any native VNC server?

1

Elementary OS comes with the least amount of software needed for someone not familiar with Linux so it is easy for them. So, no. You can try using TightVNCServer. It is quite popular and you can easily find guides on how to use it on the internet.

0

To answer your actual question

@murali asks: Does elementary os come with any native VNC server?

No, elementary OS does not come with a GUI frontend for setting up a VNC server.

Note: Most likely this is not a deliberate rejection of the functionality so much as the fact that elementary OS exclusively uses its own GUI applications built from scratch in Vala, and building a GUI frontend for setting up a VNC server is just a relatively low priority. It would be a good project for a Settings panel at some point, though.

To set up a VNC server anyway

Note: I found this as a web search result for setting up a VNC server on elementary OS. The other results on the elementary OS StackExchange are fairly old (or vague), so I'm just going to go ahead and put extremely basic (but detailed) instructions here despite the fact that you didn't directly ask for them.

We are going to use x11vnc, which is a fairly simple, fairly generic VNC server. x11vnc is conveniently available from elementary OS's apt repositories (which for elementary OS Odin are Canonical's repositories for Ubuntu 20.04 LTS Focal Fossa). It has tons and tons of options that we're just not going to use. There are other VNC servers you can use that among other things may have commercial support. Because you're here, I'm assuming you're not using one of them, so x11vnc it is.

We are going to use the command line in order to keep things as simple as possible.

These instructions are adapted from, among other things, this tutorial, which worked for me.

Prerequisites

  • You will need sudo privileges.
  • You will need to set up OpenSSH if you haven't done so already.

Note: These instructions do not include steps for VNC authentication or allowing VNC through the firewall because it assumes you will use an SSH tunnel. This keeps things simple and also more secure.

If you haven't set up SSH, in order to do so in the very most basic way with default settings, run each of the following commands in Terminal:

$ sudo apt install openssh-server -y
$ sudo systemctl enable ssh
$ sudo systemctl start ssh
$ sudo ufw allow ssh

Install x11vnc

In Terminal (or over SSH):

$ sudo apt install x11vnc -y

Create systemd service (so x11vnc runs automatically)

Open a new file in nano:

$ sudo nano /etc/systemd/system/x11vnc.service

Paste this into the file:

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbport 5900 -shared -o /var/log/x11vnc.log

[Install]
WantedBy=multi-user.target

Save the file by typing Ctrl-O and exit nano by typing Ctrl-X.

Enable and start the x11vnc service

$ sudo systemctl enable x11vnc
$ sudo systemctl start x11vnc

x11vnc should now be running, and it should start automatically whenever you log in locally.

To log in remotely

Note: This is assuming the client machine is on the same local network as the host machine. If you are connecting to the host machine over WAN, I'll assume you already know the public hostname or IP address.

Gather the necessary information

To get the host machine's hostname, on the host machine, run:

$ hostname

This should print the host machine's hostname, e.g. foobar.

If, further in the instructions, the hostname doesn't work, you can use the IP address instead. To get the host machine's IP address, on the host machine, run:

$ hostname -I

This should print all of the host machine's IP addresses, like so:

192.168.XXX.XXX [a bunch of ipv6 addresses follow]

You can probably just use the first one, i.e. the ipv4 address.

Enter the information on the client computer

On the client computer, use the following information:

  • The hostname, e.g. foobar plus .local, or the IP address from above
  • Port 22, i.e. SSH
  • Whatever login information you use for SSH, which should by default be your local login username and password on the host computer

Example client setup: Edovia Screens

Note: My client computer is a MacBook, and I'm using Edovia Screens because Apple Screen Sharing doesn't like the authentication we're using. Because it's what I'm using to test these instructions as I write them, the following instructions use Edovia Screens as the example. If I figure out a way to use Apple Screen Sharing I'll update these instructions. If someone with edit privileges wants to add examples for other client platforms, feel free.

  1. In Edovia Screens, click the + icon in the toolbar and select New Screen.
  2. In the first popup, click Custom...
  3. In the second popup, enter the information as follows:
    • Name is the "pretty" display name for the bookmarked host computer, e.g. Foo Bar (i.e. you can use capitalization and spaces)
    • Address or Hostname is the hostname or IP address from above, e.g. foobar.local or 192.168.XXX.XXX
    • Operating System is Linux
    • Authentication type is None
  4. Click on the Secure Connection tab and do the following:
    • Check Enable Secure Connections
    • Enter your local login username and password from the remote computer (unless you are using SSH keys)
    • Check Enable Secure Connections on Local Network
  5. Click Save

Your Linux computer should now appear in the lefthand side of the main Edovia Screens window, with an illustration of Tux the penguin. (This image will be replaced with a screenshot each time you close a VNC session.)

To open a VNC connection to the host computer, double-click on the representation of it in the main Edovia Screens window.

Caveats

  • I haven't tested this with any clients other than Edovia Screens. My apologies that I'm only testing this on a piece of paid Mac software that costs $30.
  • This is almost certainly not the best way of doing things. It's just relatively simple and relatively secure.
  • I don't know if x11vnc requires you to be logged in with a running Pantheon session on the host computer in order for you to be able to connect via VNC. If so, and if you want to be able to connect via VNC to a host without a running Pantheon session, that's probably an entirely different rabbit hole.
  • I haven't tested this using a host computer with multiple login (i.e. human) user accounts. If you have multiple login users on your host computer, you may have to do additional configuration.
  • While you do need sudo privileges in order to set this up, I don't know if you need sudo privileges in order to log in remotely (i.e. on a managed host computer where some login users may not have sudo privileges).

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.