Linux Lite Forums

Software - Support => Tutorials => Topic started by: ralphy on March 15, 2017, 12:45:08 AM

Title: Remote Access/Control Linux Lite 3.x
Post by: ralphy on March 15, 2017, 12:45:08 AM
Here is a quick tutorial on how to configure x11vnc (VNC Server) for remote access/control to your Linux Lite 3.x PC via VNC client. (please consider adding it to Lite Manual)

A 30 seconds setup:

Code: [Select]
sudo apt install -y x11vnc
(http://i.imgur.com/sDhaq0S.png)


Code: [Select]
sudo mkdir /etc/x11vnc

Code: [Select]
sudo x11vnc --storepasswd /etc/x11vnc/vncpwd
(http://i.imgur.com/9fPza4M.png)


Code: [Select]
gksu leafpad /lib/systemd/system/x11vnc.service
Copy & paste the code below into leafpad:

Quote
[Unit]
Description=VNC Server for X11
Requires=display-manager.service
After=display-manager.service
[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -dontdisconnect -auth guess -forever -shared -noxdamage -repeat -rfbauth /etc/x11vnc/vncpwd -rfbport 5900 -bg -o /var/log/x11vnc.log
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=5

[Install]
WantedBy=multi-user.target

(http://i.imgur.com/PrMxssx.png)

Save changes and close leafpad. Then copy /lib/systemd/system/x11vnc.service to /etc/systemd/system/

Code: [Select]
sudo cp /lib/systemd/system/x11vnc.service /etc/systemd/system/

Code: [Select]
gksu leafpad /lib/systemd/system/graphical.target
Update graphical.target file content as shown below:

Quote
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service x11vnc.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes

(http://i.imgur.com/ZHnHcHn.png)

Save changes and close leafpad. Then copy /lib/systemd/system/graphical.target to /etc/systemd/system/

Code: [Select]
sudo cp /lib/systemd/system/graphical.target /etc/systemd/system/

Code: [Select]
sudo systemctl daemon-reload
sudo systemctl enable graphical.target


Reboot:

Code: [Select]
sudo reboot now
or start x11vnc without rebooting:

Code: [Select]
sudo systemctl start x11vnc.service(http://i.imgur.com/xctfqQq.png)

[/list]


Add Firewall Rule to allow VNC traffic IN

Open Firewall Configuration, select the Rules tab and add a firewall rule as shown below

(http://i.imgur.com/lxTE0qx.png)


Remotely accessing/controlling Linux Lite 3.x

From a client computer in your network, using a VNC client of your choice (Remmina, Ultra VNC, TightVNC, Chicken VNC, VNC Viewer, Screen Sharing, (you name it) enter the IP address of your Linux Lite box or its hostname (if there is local DNS resolution available in your network) and enjoy your hard work :)

(http://i.imgur.com/opbzeWn.png)

(http://i.imgur.com/89DbNR3.jpg)

For additional details on x11vnc configuration options such as file transfers, etc. read on x11vnc manual:
Code: [Select]
~ $ man x11vnc
Title: Re: Remote Access/Control Linux Lite 3.x
Post by: Jerry on March 15, 2017, 01:29:19 AM
Brilliant! Will add to Help Manual.

Sent from my mobile phone using Tapatalk

Title: Re: Remote Access/Control Linux Lite 3.x
Post by: torreydale on April 26, 2017, 08:55:56 PM
Er.  Umm.  "Quick" tutorial?
Title: Re: Remote Access/Control Linux Lite 3.x
Post by: Jerry on April 26, 2017, 10:44:41 PM
Er.  Umm.  "Quick" tutorial?

I'm unsure what that means.
Title: Re: Remote Access/Control Linux Lite 3.x
Post by: torreydale on April 27, 2017, 08:52:06 AM
Quote
Here is a quick tutorial on how to configure x11vnc (VNC Server) for remote access/control

@Jerry,
To me, it wasn't quick.  But I'm just teasing.  I'm glad for the contribution.
Title: Re: Remote Access/Control Linux Lite 3.x
Post by: Jerry on April 27, 2017, 09:54:49 AM
Ah I see. No worries.

Sent from my Mobile phone using Tapatalk

Title: Re: Remote Access/Control Linux Lite 3.x
Post by: donbrew on July 04, 2022, 03:51:22 PM
Why copy the service unit?  What is the use of having 2 of them.  Why do either, it is already installed in /lib/systemd/system?
Why bother editing graphical.target
you don't need to enable x11vnc.service?  But do need to enable graphical.target?
Why reboot?

Or, is it all different in 5.6?

All I did was:
sudo apt install x11vnc
sudo systemctl start x11vnc (maybe not needed)
sudo systemctl enable x11vnc
Then I did the password thing.