04-26-2016, 08:06 PM
(This post was last modified: 04-27-2016, 09:41 PM by pine64nutz.)
Since I couldn't find any info here about this I was thinking to write a little tutorial, maybe it going to help.
I got my Pine64 recently and I don't have any display or keyboard available so the only way to get desktop environment was over VNC (or RDP). This tutorial is for Debian 8 Jessie with MATE and how to VNC.
How to VNC
1: login into terminal via SSH
2: update server packages
3: install vnc4server
4: create a password for your vnc server
5: setup the xstartup script to get mate environment on VNC
overwrite with this code
6: start the vnc server with vnc4server -geometry <resolution> -depth <16,24 whatever depth you want>
you should get a message like this
this means that a VNC server has started on your at port :1 (5901) if it said :2 in means port 5902 and so on...
user a VNC viewer (Real VNC, Ultra VNC) to login to your VNC server, usually is <your_local_ip>:5901
If you get only a grey screen change the permissions on xstartup file
first stop the server
then
start the server again
Update #1
How to run VNC server as a service automatically
make sure you kill the server first
make a new script where you can setup the VNC server
paste the code bellow (here you can put your desired resolution and depth)
save the file and make it executable
now make a unit file, that will describe the service and tell the server how to work with the service
paste the code bellow (make sure to put your user under User=)
reload systemctl and enable VNC server
reboot and see if it's works
Coming next: connect to VNC server over SSH.
Have fun!
I got my Pine64 recently and I don't have any display or keyboard available so the only way to get desktop environment was over VNC (or RDP). This tutorial is for Debian 8 Jessie with MATE and how to VNC.
How to VNC
1: login into terminal via SSH
2: update server packages
Code:
sudo apt-get update
3: install vnc4server
Code:
apt-get install vnc4server
4: create a password for your vnc server
Code:
vnc4passwd
5: setup the xstartup script to get mate environment on VNC
Code:
sudo nano ~/.vnc/xstartup
overwrite with this code
Code:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
-terminal-emulator -geometry 80x20+10+10 -ls -title "$VNCDESKTOP Desktop" &
mate-session &
mate-panel &
6: start the vnc server with vnc4server -geometry <resolution> -depth <16,24 whatever depth you want>
Code:
vnc4server -geometry 800x600 -depth 24
you should get a message like this
Code:
New '<hostname>:1 (<your_username>)' desktop is <hostname>:1
Starting applications specified in /home/<your_username>/.vnc/xstartup
Log file is /home/<your_username>/.vnc/hostname:1.log
this means that a VNC server has started on your at port :1 (5901) if it said :2 in means port 5902 and so on...
user a VNC viewer (Real VNC, Ultra VNC) to login to your VNC server, usually is <your_local_ip>:5901
If you get only a grey screen change the permissions on xstartup file
first stop the server
Code:
vnc4server -kill :1
then
Code:
sudo chmod 755 xstartup
start the server again
Update #1
How to run VNC server as a service automatically
make sure you kill the server first
Code:
vnc4server -kill :1
make a new script where you can setup the VNC server
Code:
sudo nano /usr/local/bin/vncserver
paste the code bellow (here you can put your desired resolution and depth)
Code:
#!/bin/bash
PATH="$PATH:/usr/bin/"
DISPLAY="1"
DEPTH="24"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
case "$1" in
start)
/usr/bin/vnc4server ${OPTIONS}
;;
stop)
/usr/bin/vnc4server -kill :${DISPLAY}
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
save the file and make it executable
Code:
sudo chmod +x /usr/local/bin/vncserver
now make a unit file, that will describe the service and tell the server how to work with the service
Code:
sudo nano /lib/systemd/system/vncserver.service
paste the code bellow (make sure to put your user under User=)
Code:
[Unit]
Description=Manage VNC Server
[Service]
Type=forking
ExecStart=/usr/local/bin/vncserver start
ExecStop=/usr/local/bin/vncserver stop
ExecReload=/usr/local/bin/vncserver restart
User=pine64user
[Install]
WantedBy=multi-user.target
reload systemctl and enable VNC server
Code:
sudo systemctl daemon-reload
sudo systemctl enable vncserver.service
reboot and see if it's works
Coming next: connect to VNC server over SSH.
Have fun!