Skip to main content

Install/Setup Xfce and TightVNC to Armbian OrangePi

Following https://www.instructables.com/id/The-OrangePi-Lite/, the next instruction after network started is usually VNC server setup. Many Internet resources suggested TightVNC, an open source software for this purpose. However, Armbian distribution for OrangePi does not include any X window desktop, therefore install TightVNC itself is just half of the journey. This is how I complete the work.

1. Make sure Armbian is updated:

sudo apt-get update
sudo apt-get upgrade

2. Install XFont used by TightVNC server

sudo apt-get install xfonts-base

3. Install TightVNC server

sudo apt-get install tightvncserver

4. Create a user dedicate for this service. I use user ID 'vnc'

sudo adduser vnc
gpasswd -a vnc sudo

5. Setup this user for VNC server,

vncserver :1

We need to assign a password. No need to specify a view-only password.

Use the command to confirm the server is running and the default options applied

ps -ef | grep Xtightvnc

6. VNC Client can now connect to this server, display :1 refers to port 5901. Hence the connection string is <IP Address>:5901.

7. However, there is no windows shown up, as Armbian distribution does not include any X-window manager. Now we install Xfce, a light weight X-window desktop.


sudo apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme dbus-x11
 
8. Restart VNC server,

vncserver -kill :1
vncserver :1
 
Now the client will show up Xfce desktop over TightVNC.
 
9. To make TightVNC autostart on OrangePi startup, use systemctl control. Create a new script,

sudo nano /usr/local/bin/tightvncserver
 
10. The content of this script,

#!/bin/bash
PATH="$PATH:/usr/bin/"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

case "$1" in
start)
/usr/bin/vncserver ${OPTIONS}
;;

stop)
/usr/bin/vncserver -kill :${DISPLAY}
;;

restart)
$0 stop
$0 start
;;
esac
exit 0 

11. Make this script executable,
sudo chmod +x /usr/local/bin/tightvncserver
 
12. Setup systemd script

sudo nano /lib/systemd/system/tightvncserver.service
 
13. With this content,

[Unit]
Description=Manage tightVNC Server

[Service]
Type=forking
ExecStart=/usr/local/bin/tightvncserver start
ExecStop=/usr/local/bin/tightvncserver stop
ExecReload=/usr/local/bin/tightvncserver restart
User=vnc

[Install]
WantedBy=multi-user.target 

14. Restart Systemd service and enable tightvncserver,

sudo systemctl daemon-reload
sudo systemctl enable tightvncserver.service 
  
15. Now we have 4 commands to start, stop, restart, and status over tightvncserver,
sudo systemctl start tightvncserver.service
sudo systemctl stop tightvncserver.service
sudo systemctl restart tightvncserver.service
sudo systemctl status tightvncserver.service
 
16. Reboot Orangepi. Now the connection is ready as OrangePi started.
sudo reboot 

Lee Sir,
14 December, 2019
Hong Kong.



 Reference:

1. Instructables, The OrangePi Lite, https://www.instructables.com/id/The-OrangePi-Lite/ 
2. DIY Projects, Install the TightVNC server on Armbian, https://diyprojects.io/armbian-access-remote-desktop-orange-pi-vnc/#.XfO9YPwRXIV
3. DIY Projects, Armbian (Orange Pi): installing an XFCE desktop to server distribution, https://diyprojects.io/armbian-tutorial-installing-xfce-desktop-server-distribution/#.XfREqPwRXIV
4. nixCraft, Fix: /bin/dbus-launch terminated abnormally without any error message and solution, https://www.cyberciti.biz/faq/fix-bindbus-launch-terminated-abnormally-without-on-centos-rhel/

 

Comments

Post a Comment

Popular posts from this blog

Configure OrangePi Lite WiFi

There are many websites and Youtube videos show you how to install Armbian to OrangePi with a SD-card. There are many ways to connect to the initial console of the device. Most of them tell you to utilize the LAN interface. This is a quick and easy method, however, my OrangePi Lite simply lacks a LAN interface. We need to setup Wifi before we can use it for console connection. But without the console how can we setup Wifi connection? Finally I used a USB to TTL device. With only 3 wires I connected the device to OrangePi: Rx-Tx, Tx-Rx, and GND-GND. Then I can use PuTTY to bring up the console thru SSH. Up to this point basically I am following this website: https://www.instructables.com/id/The-OrangePi-Lite/ . I continued with the instructions and successfully connect to WiFi, but puzzle why I have do that with so many manual editings. Especially when I edit the /etc/network/interface file, it has a remark say "# Network is managed by Network manage". My question is can N

Setup USB Camera to work in Octoprint

This passage summerize the website "Orange Pi Zero and Webcam for Octoprint", https://www.iot-experiments.com/orange-pi-zero-and-webcam-for-octoprint/, aimed to make my life easier. Check the USB webcam present, octoprint@orangepizero:~$ lsusb Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 002: ID 046d:0826 Logitech, Inc. HD Webcam C525 Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 007 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub To discover webcam information, (octoprint@orangepizero:~$sudo apt-get install hwinfo) octoprint@ora