4

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 Server from AppCenter.
  2. Run:
sudo x11vnc -storepasswd # This will prompt password and the confirmation of it.
  1. Create the file /etc/systemd/system/x11vnc.service with the following commands:
echo "[Unit]" | sudo tee /etc/systemd/system/x11vnc.service
echo "Description=\"x11vnc\"" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "Requires=display-manager.service" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "After=display-manager.service" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "[Service]" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /home/$(whoami)/.vnc/passwd" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "ExecStop=/usr/bin/killall x11vnc" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "Restart=on-failure" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "RestartSec=2" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "[Install]" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/x11vnc.service
echo "" | sudo tee -a /etc/systemd/system/x11vnc.service
  1. Make the system 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

Source

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.