5

I installed elementary OS on my laptop and tried to install VNC server. First I installed vnc4server, opened and logged from phone. On screen I saw:

failed to load session gnome

How do I need to configure it to run under elementary OS? I am not interested in installing GNOME.

2 Answers 2

1

Create a file named .xsession in your home directory and write the following content into it.

 gnome-session --session=pantheon

Then restart the vncserver and connect again. I tested this with tightvncserver.


If you want to use display:0 use x11vnc. Here you can find more information about how to setup and connect to a x11vnc server.

0
  1. Install x11vnc via apt (or X11VNC Server application from AppCenter in EOS 5 or earlier).

  2. Run:

sudo x11vnc -storepasswd # This will prompt password, confirmation and the location, choose `/home/your-user/.vnc`.
  1. Create the file /etc/systemd/system/x11vnc.service with the following commands:
[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /home/your-user/.vnc/passwd
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
  1. Make the systemd get the changes:
sudo systemctl daemon-reload
sudo systemctl start x11vnc.service
sudo systemctl enable x11vnc.service

Done. This should allow you to hook into existing session or start a new one.

Tested with:

$ lsb_release -a
No LSB modules are available.
Distributor ID: elementary
Description:    elementary OS 5.1.7 Hera
Release:    5.1.7
Codename:   hera

And:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Elementary
Description:    elementary OS 7 Horus
Release:    7
Codename:   horus

Source

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .