Skip to content

Remote Desktop Access

Run a Desktop environment on your device and access it accessed remotely via network. It is a great option for headless SBC devices.

Overview

Remote Desktop

Remote Access

How do I run DietPi-Software and install optimised software items?

To install any of the DietPi optimised software items listed below run from the command line:

dietpi-software

Choose Browse Software and select one or more items. Finally select Install.
DietPi will do all the necessary steps to install and start these software items.

DietPi-Software menu screenshot

To see all the DietPi configurations options, review the DietPi Tools section.

Info

From the list of Browse Software, together with any of the Remote Desktop Software choose also one of Graphical Desktop environment. DietPi will install both of them, enabling you to use your keyboard and mouse to interact with a graphical desktop environment on your device.

Return to the Optimised Software list

TigerVNC Server

TigerVNC desktop screenshot

You can monitor the VNC service with:

systemctl status vncserver

Although any VNC viewer may work, the latest official TigerVNC viewer can be downloaded here: https://bintray.com/tigervnc/stable/tigervnc/

Connection Details

  • Use the IP address of your DietPi device, e.g.: 192.168.0.100.
    If you can’t connect, try connecting to screen 1, e.g.: 192.168.0.100:1.
  • Use the password you entered during the installation. If you would like to change the password execute from the console/terminal, run vncpasswd.
  • The default port is 5901.
    Note: To enable access from outside of your local network, this port needs to be forwarded from your router.

Shared desktop

The shared desktop mode is used to have more than one single VNC viewer connected to the same desktop session. To enable this mode, edit /boot/dietpi.txt, e.g. via nano /boot/dietpi.txt. Change to value 1 the following line:

SOFTWARE_VNCSERVER_SHARE_DESKTOP=1

A running desktop is required for this mode, therefore enable desktop autostart via dietpi-autostart 2, or assure that a local desktop session is active before starting TigerVNC manually.

Resolution settings

The following shows an example how to run VNC server on screen :1 by creating a new desktop with 1280x720 resolution by editing /boot/dietpi.txt:

nano /boot/dietpi.txt

and change the following settings:

SOFTWARE_VNCSERVER_WIDTH=1280
SOFTWARE_VNCSERVER_HEIGHT=720
SOFTWARE_VNCSERVER_DEPTH=32
SOFTWARE_VNCSERVER_DISPLAY_INDEX=1

At last restart the service to activate the new settings:

systemctl restart vncserver

TigerVNC is enabled by default to start automatically at boot. Run systemctl disable vncserver to disable this behaviour and systemctl start vncserver to start it manually from console.

To re-enabled TigerVNC autostart, run systemctl enable vncserver, to stop it manually systemctl stop vncserver can be used.


See also https://tigervnc.org
Man page: https://tigervnc.org/doc/Xvnc.html
Source code: TigerVNC/tigervnc

RealVNC Server

RealVNC consists of the VNC Server and the VNC Viewer application to share the desktop or control the computer running the VNC Server.

RealVNC desktop screenshot

Basics

By default DietPi will start a virtual VNC session on boot at screen :1 for user root.
The screen index can be changed via SOFTWARE_VNCSERVER_DISPLAY_INDEX in /boot/dietpi.txt. Logs can be viewed via journalctl -t Xvnc:1 -t vncserver and in /root/.vnc/. When you logout (instead of only closing the VNC Viewer window), the session will exit. Restart it via systemctl restart vncserver.

Shared desktop

If you set SOFTWARE_VNCSERVER_SHARE_DESKTOP=1 in /boot/dietpi.txt or select desktop auto login via dietpi-autostart (index 2), RealVNC server will be started on boot in shared desktop mode, attaching to the first found local desktop session.
Check the service status via systemctl status vncserver-x11-serviced. Check all logs via journalctl -u vncserver-x11-serviced.

RealVNC enterprise subscription

If you have an enterprise subscription on RealVNC, you can have virtual VNC sessions spawning automatically on demand per-client connection and closing once the client disconnects. That way no resource-intense X11/desktop session needs to be persistently active on the server to allow VNC connections.
To enable this, after adding your enterprise subscription credentials, do the following:

  • systemctl disable --now vncserver disables the persistent virtual VNC session on screen :1.
  • systemctl enable --now vncserver-virtuald enables the on demand VNC session daemon.

Simply select a VNC viewer for your system and download: https://www.realvnc.com/connect/download/viewer/

Connection details

  • To connect on the persistent VNC session on screen :1, add the screen index to your local IP or hostname, e.g. 192.168.0.100:1.
  • To connect to a shared desktop session, skip the screen index, e.g. 192.168.0.100.
  • Username = root
  • Password = <root password> (default: dietpi)

This may be the case e.g. if you want to run Minecraft remotely.

  • Enable shared desktop mode:
    • Run dietpi-autostart 2 to autostart into a desktop session and have RealVNC attached to it automatically.
    • Then reboot the system to have the changes taking effect.
  • Follow the instructions within the section Running directly rendered apps such as Minecraft remotely in https://www.realvnc.com/docs/raspberry-pi.html.

XRDP

XRDP is a remote desktop application using the Windows Remote Desktop Client.

XRDP desktop screenshot

To connect to the desktop, open the remote desktop application in Windows (or any other XRDP compatible client).
Enter the IP address of your DietPi device, e.g. 192.168.0.100.
Click connect and enter the following details once connected:

  • Module = Xorg
  • Username = root
  • Password = dietpi

XRDP uses port 3389 by default, so you need to open/forward it from your router to DietPi.

NoMachine

NoMachine is a remote desktop server with advanced features, such as screen recording. The client also scans for all available NoMachine servers on your network, allowing easy connection and maintenance of your remote desktops.

NoMachine client and desktop screenshot

Download the NoMachine client software from:

Once the NoMachine client is installed, and running on your system, you should see a device named DietPi. Execute the following steps:

  1. Double click it.
  2. Select Yes for Remote host identification has changed.
  3. Select Yes for Verify host authenticity.
  4. Enter the username root and password dietpi.
  5. Select Yes for Do you want NoMachine to create a new display.

You will now be connected to your device.

Remot3.it

Remot3.it allows you to easily access your DietPi device over the internet.

Remot3.it web interface screenshot

Remot3.it works by connecting you to a specific TCP port on your device, all of which can be customised during first run setup.

Examples of TCP ports for Remot3.it:

  • SSH port 22. Open a remote terminal to your device.
  • Transmission port 9091. Monitor your BitTorrent downloads.
  • Webserver port 80. Access your internal websites.

On interactive installs, dietpi-software will call the setup script to setup and manage your application connections. On unattended installs, e.g. via dietpi.txt, you can call it manually from console:

connectd_installer

Once your account is created and linked to this system, you can select a port for Remot3.it to enable remote access.

Sign into your Remot3.it account to access your devices remotely:


YouTube video tutorial (German language): Raspberry Pi einfach fernsteuern: Remote.It SSH ohne VPN von überall - Installation unter DietPi.

VirtualHere

The VirtualHere package is used to share physically attached USB devices from your SBC over the network to other systems.

VirtualHere client screenshot

Download the client for your PC from:

Once installed, available VirtualHere devices will be shown in the client user interface and can be used on the client PC.

USB Storage WARNING

  • As per https://github.com/MichaIng/DietPi/issues/852#issuecomment-292781475 it it highly recommended that you do not install VirtualHere if your DietPi user data is stored on a USB drive.
  • VirtualHere does not take into account mounted drives when selecting them for remote use. This is potentially dangerous for any mounted drive that is in use and may cause data loss.
  • Do not use drives on the client that are mounted on the SBC.
    Unmount the drive before hand in dietpi-drive_manager.

Return to the Optimised Software list