Sunday, 30 June 2019

Raspbian Lite with GUI, RDP, VNC

Updated 2019-06-30, Buster !

I like the Raspberry Pi(RPi), with Raspbian Lite (no Desktop is included), headless operation, and then adding the software You need. Until now I haven't had a use case where I needed a Desktop but now was time. 

You maybe wonder, why don't use the Raspbian with Desktop ?? In that package there is a lot of software I don't need and I really want to optimize the RPi. I think that the less software You install the happier RPi will be. ;-)


So after some Googling inspired from this guide I came up with the following setup.

Start up with a fresh Debian Lite installation.

Then You have to choose a GUI to Your RPi. Pixel is the standard RPi GUI or choose another mentioned in the guide.

After logging on to the RPi, Pixel is installed with 

sudo apt install raspberrypi-ui-mods

or 

XFCE with 

sudo apt-get install xfce4 xfce4-terminal

And if You are not using the RPi with remote access You can stop here.

Remote access via VNC

You have to install the software for the VNC server and the easiest way is to use 

sudo raspi-config

and then in the menu

5/ Interfacing options
  P3 VNC   Enable/Disable graphical remote access to your Pi using RealVNC   

7/Advanced options   Set a specific screen resolution
  A5 Resolution
DMT Mode 16

Finish and reboot

Please note that two systemd services are initiated via 

vncserver-x11-serviced.service
vncserver-virtuald.service    

Access the RPi with VNC Viewer from Your PC/Mac/Phone.

Remote access via RDP

If You want o use RDP instead install the following software

sudo apt-get install xrdp


If using Stretch delete the following package (In Buster it is not installed)

sudo apt-get purge xserver-xorg-legacy

and use a RDP client. I prefer the Microsoft package which works well on both PC/Mac/iPad/iPhone

Add WEB-browser ?

Install the default one with 

sudo apt-get install chromium-browser --yes

Remark

(Installing RDP made VNC stopped working, in older packages, but with 2018-06-27-raspbian-stretch-lite they worked together. According to this post, there is a bug, VNC and RDP can't exist together in the OS, which made it necessary to delete/purge the above package. Some additional info.)

6 comments:

  1. unfortunatley sudo apt-get install raspberrypi-ui-mods does not work on my rpi i get the error massage unable to locate package raspberry-ui-mods. i tried sudo apt-get install raspberrypi-gui-mods but that gives the same result.
    what did I do wrong?

    ReplyDelete
  2. Thanks for this. I set up my Pi4 as a NAS and wanted to keep it completely headless but trying to move files around drives via the terminal was getting old, quick. Using samba file browsers on other systems was slow and often failed. Now I can use vnc to control my pi with the familiar interface.

    ReplyDelete
  3. Hi, I followed all the instructions, but when I try connecting from my PC using realvnc client, the mouse cursor spins for a moment and nothing happens. No error messages or anything.
    I'm running the client on Win10 Pro, and vnc server is on an rpi zero W

    ReplyDelete
    Replies
    1. Hi, since "ssh" seems to work, check the log with "cat /var/log/syslog". Another approach is to use RDP instead or just connect mouse/keyboard/screen to the Zero, and troubleshoot from there.

      Delete