Accessing The pcDuino Desktop Without An HDMI Monitor (Part 2)

In my last post I began describing how to access the pcDuino desktop without the need for an HDMI monitor.  The first step was to install an SSH server via the debug serial port, which gives you access to the pcDuino command line.  For access to the desktop display you will also have to:

  1. Configure a Virtual Network Computing (VNC) server
  2. Install and connect via a VNC client

Configuring The VNC Server

As it turns out, the pcDuino comes with the x11vnc server already installed and all that’s necessary is to configure SSH on the pcDuino and local machine to support it.  (Note:  while working on putting together a bootable SD card I found out this is not necessarily the case.  If you find the x11vnc server is not installed, you can do so by executing the command

sudo apt-get install x11vnc

from the pcDuino command line.)

On the local machine and change to the /etc/ssh directory as root:

sudo su
cd /etc/ssh

Open the file ssh_config file in your editor of choice and find the ForwardX11 option.  Uncomment it if necessary, change its value to YES, and save the file.

Now log into the pcDuino via the SSH link and gain root access in the same manner:

sudo su
cd /etc/ssh

Open the file sshd_config file in your editor of choice, find the X11Forwarding option, change its value to YES, and save the file.

Install and Connect Via a VNC Client

The final step is to install a VNC client on your local computer.  There are a number of them to choose from.  Of these, I chose xtightvncviewer for no other reason than it was there, installing it as:

sudo apt-get install xtightvncviewer

Putting It All Together

At this point if you SSH into the pcDuino and try to start the VNC server, you’ll get an error indicating you cannot connect to the display (XOpenDisplay failed) along with hints on how to fix it.  The cause of this error is that the account used for SSH does not have sufficient permissions to connect to the X display.

To fix this, execute the command ps -fe | grep /usr/bin/X | grep -v grep from the pcDuino command line.  The returned process will have have an -auth flag.  Take note of the associated file. On my machine, it was /var/run/lightdm/root/:0.

Exit from the SSH session and reconnect to the pcDuino using the command

ssh -L 5900:localhost:5900 <user>@<pcDuino_ip_address> ‘sudo x11vnc -auth <path_to_authority_file>’ -display :0

where <path_to_authority_file> is the file associated with the -auth flag noted above.  This will log you into the pcDuino via SSH and start an instance of the X server.  You can then start the VNC viewer from the local machine command line with the command:

vncviewer localhost:5900 &

Below is a picture of the pcDuino desktop seen on my local machine.

Selection_007

The update speed will naturally be limited by the speed of your network but if you are looking for access to the pcDuino desktop and don’t have an HDMI monitor, you can’t beat the price.

Advertisements

4 Comments

  1. Nathan Rapp

    Hi – thanks for putting this together. This is not working for me on my pcduino. I’m getting this as a result (note I tried leaving the :0 in the auth path and without it as well, just trying two options. Same is returned on both. Any thoughts?

    kmartburrito@CrunchNetbook:~$ ssh -L 5900:localhost:5900 ubuntu@192.168.2.136 ‘sudo x11vnc -auth /var/run/lightdm/root/:0’ -display :0
    ubuntu@192.168.2.136‘s password:
    bash: $’\342\200\230sudo’: command not found
    kmartburrito@CrunchNetbook:~$ ssh -L 5900:localhost:5900 ubuntu@192.168.2.136 ‘sudo x11vnc -auth /var/run/lightdm/root/’ -display :0
    ubuntu@192.168.2.136‘s password:
    bash: $’\342\200\230sudo’: command not found
    kmartburrito@CrunchNetbook:~$

    • joesugar

      Nathan,

      It appears you’re getting extra characters in front of your sudo command. Try separating the login from the x11vnc command. Log in via ssh using the command:

      ssh -L 5900:localhost:5900 ubuntu@

      Then, at the pcDuino command line execute the command:

      sudo x11vnc -auth /var/run/lightdm/root/:0 -display :0

      If the x11vnc server starts normally your installation is ok and the problem is in the ssh login connection.

      Hope this helps.
      Joe

      • Nathan Rapp

        Thanks Joe,

        I ended up doing exactly what you’re suggesting here, just connecting through SSH first, and then initiating the command. Turns out I found that the 5/31 release of the Ubuntu software for the pcduino has it starting by default, so I only need to start it via the viewer.

        Thanks!

Trackbacks

  1. Accessing The pcDuino Desktop Without An HDMI Monitor (Part 1) | Computer/Electronics Workbench
Tabula Candida

Doodles of a distracted historian

rtl-sdr.com

A blog about RTL-SDR (RTL2832) and cheap software defined radio

DuWayne's Place

Computers, Electronics, and Amateur Radio from KC3XM

QRP HomeBuilder - QRPHB -

Computers, Electronics, and Amateur Radio from KC3XM

Open Emitter

Computers, Electronics, and Amateur Radio from KC3XM

Ripples in the Ether

Emanations from Amateur Radio Station NT7S

m0xpd's 'Shack Nasties'

Computers, Electronics, and Amateur Radio from KC3XM

%d bloggers like this: