Friday, February 20, 2015

Back to My Projects - Remote Desktop Protocal (RDP)

OK, it has been almost eleven weeks since my surgery - So now I can get back to; My Blog,  Electronic, Programming and Ham Radio Projects. I have been working on them, but in very short sessions.

The last few days I have been updating all of my Workstations to/with LinuxMint 17.1 (Cinnamon). I gave up on Ubuntu due to bloat and continual lack of support for problems that continued to bug me.

But LinuxMint (17.1) appears to have one of the same problems as Ubuntu - that is, Lack of "easy to use" Remote-Desktop-Protocal (RDP) configuration.

My desire is to connect and control other remote workstations and a few Raspberry Pi's from my Main Workstation. RDP is designed to display the remote Consoles on the main workstation, but people on the web have complained that after the last few system updates, it does not work as advertised, and I found that to be the case.

Disclaimer: There are many aspects of X Display, VNC and Remote Consoles that I do NOT know, nor understand. Information provided here has be found experimentally or after much online reading, your mileage may vary.

After many long hours of web research, trial and error, I now have a possible solution, which is really simple, once the magic is known. The solution is different for the remote Raspberry Pi (wheezy) than a remote LinuxMint (17.1) or newer Ubuntu system. The following examples assumes you have ssh, vnc-server and x11vnc installed as needed.

Using Remote Console of a Raspberry Pi is very easy, but several solutions are available depending on whether the Pi has a HDMI attached console or not, and whether or not there is an active logged in session.

Different methods are used to create, or use existing, Frame Buffers, and its address is denoted by the ":N" in the following examples. Any unused number can be used, but ":0" is normally reserved for the real graphic console (hardware monitor).

Pi systems "without" an HDMI attached Console (headless)

For Pi systems without an HDMI attached Console a "Display Frame Buffer" (fb) will not have been automatically created. The "vncserver" command creates a virtual Frame Buffer ":2", as seen in the following example. Also, note: ":2" is an alias for the value of the last two digits of "port number 5902".

Execute the following on the local system:

$ ssh remote_pi_sys_address 'vncserver -geometry 900x600 :2'
$ vncviewer remote_pi_sys_address:2

Note: the Geometry can be any size you like, I like 900x600 because it does not completely fill my local display.

Remote Virtual Console
Enjoy remote access to the PI, if the local window is deleted, it can be re-entered by re-executing the second command.

Pi systems "with" an HDMI attached Console, with Active Session

On remote system, run "Share Desktop", then on the local system execute:

$ vncviewer remote_pi_sys_address:0

Or, Pi systems "with" an HDMI attached Console, with Active Session

$ ssh -xCf -L 5900:localhost:5900 remote_pi_sys_address -l root \
        'x11vnc -q -auth /var/run/lightdm/root/:0 -display :0 -N'

$ vncviewer :0

Note: The required "-auth /var/lib/mdm/:0.Xauth" parameter is dependent on your remote_system and display manager used, which normally can be found via a remote "ps -efl | grep auth" command.

LinuxMint, Ubuntu and other Debian derived systems with RDP and VNC Console bugs.

See the Note above, regarding "auth". The following is accessing a remote LinuxMint system at the login prompt, supplying user name and passwd starts a normal remote session. Note: the displayed window will be the size and resolution of the remote monitor, scrolling may be necessary.

$ ssh -xCf -L 5900:localhost:5900 remote_sys_address -l root \
        'x11vnc -q -auth /var/lib/mdm/:0.Xauth -display :0 -N'

$ vncviewer :0

Remote Login
Note: failure can occur if the Local and Remote ports (5900) (as being requested here) are already in use, some of the following commands can be executed on the Local and Remote systems to help find port collision problem, killing the offending processes will free the port.

$ netstat -ta
$ lsof | grep 5900
$ ps -efl | grep 5900
$ ps -efl | grep vnc

The use of a "virtual" Console would be much better, one that allows you to specify the window size. But alas, it does not work as expected, the default configuration does NOT provide an interactive window manager.

This example does not work as well as it should.

$ ssh -xCf -L 5908:localhost:5908 remote_sys_address \
        'vncserver -geometry 900x600 :8'

$ vncviewer :8

I plan to continue to explore for a usable solution that provides a specified size of window for LinuxMint, Ubuntu and other Debian Derived systems. Currntly only the Raspberry Pi (wheezy) works as expected.

-- Home Page:

No comments:

Post a Comment