HOW TO install DirectVNC client

Tested on RBPi2B, OSMC 2015.11-1, OSMC 2016.02-3

Needs:Screen resolution1280x1024(or higher), keyboard and mouse

This is an installer for directvnc, a simple vnc-client.
It asks for IP and Password for connection each time, if you use 5901 insted of 5900 you have to edit the vnc_ip.sh file.

How to install, in shell run these commands in osmc users homedirectory:

wget https://raw.githubusercontent.com/zjoasan/directvnc_install/master/install_vnc.sh
sh ./install_vnc.sh

Attention: Since Krypton you need to enable the addon, Settings->Addon browser-> My addons->Program and functions → vnc-launcher

Contens of install_vnc.sh:

#!/bin/bash
sudo apt-get update 2>&1 | dialog --title "Updating package database..." --infobox "\nPlease wait...\n" 11 70
sudo apt-get --show-progress -y install dialog directvnc  2>&1 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" | dialog --title "Installing dialog and directvnc" --gauge "\nPlease wait...\n" 11 70
wget -O install_vnc.zip https://github.com/zjoasan/directvnc_install/blob/master/install_vnc.zip?raw=true
unzip -q -o install_vnc.zip 
chmod +x /home/osmc/vnc-client/vnc_ip_server.sh 2>&1
chmod +x /home/osmc/vnc-client/vncstart2.sh 2>&1
chmod +x /home/osmc/vnc-client/vnc_watchdog.sh 2>&1
sudo cp -f /home/osmc/root/.directfbrc /root/
rm -r -f /home/osmc/root
rm -f install_vnc.zip 2>&1
dialog --title "Installation finnished!" --msgbox "\nThank you for using my installer\n"  11 70
exit
1 Like

Please post the commands your script runs, rather than a link to a script

Hi Joakim,
just saw your post and it is exactly what i was looking for.
I think a lot of people are looking for a way to mirror their laptop screen on OSMC.
I did not manage to get it work until now but I willl try your approach …

I was wondering why you want to withdraw that post. I think it could be helpful for a lot of people

i posted the content of the script in a seperat post, and then i edited the top post to contain it, therefor i withdraw the second post

My mistake. I thought you were refering to the whole thread …

For me this works great. Just tested ist.
I just haven´t found the correct resolution seetings for my case.
if I change the resolution in .directfbrc it connects to my vnc server but diconnects a few seconds later …
is there any logging capabilty ?

have you change resolution in vnc_ip_server.sh too?

else edit your .directfbrc (sudo nano /root/.directfbrc) and add

log-file=filename

wow. thanks for replying so quickly !
yes. changed it in both files.
logging gave me this:

     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH
   ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2014-10-21 10:21)
(*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting desktop resolution to 1920x1080 failed!
  -> Using default resolution.
(!) DirectFB/DirectFBCreate: Setting desktop format failed!
  -> Using default format.
(!) DirectFB/DirectFBCreate: Setting desktop buffer mode failed!
  -> No virtual resolution support or not enough memory?
     Falling back to system back buffer.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting system memory desktop back buffer failed!
  -> Using front buffer only mode.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/core/layers: Could not set primary region config!
 --> Not supported!
(!) InitLayers: Could not get primary region of layer 0!
 --> Not supported!
(#) DirectFBError [DirectFBCreate( &dfb )]: Not supported!

try to add this, last in file:

sudo nano /etc/fb.modes

 #
 #   1920x1080, 60 Hz, Non-Interlaced (172.798 MHz dotclock)
 #
     mode "1920x1080-60"
 #      D: 74.481 MHz, H: 67.080 kHz, V: 60.00 Hz
         geometry 1920 1080 1920 1080 16 
         timings 5787 328 120 34 1 208 3 
     endmode

and change the mode in .directfbrc to “1920x1080-60”

this worked for me.

Hey,
did not really work for me.
but I managed to change to 1280x1024…

anyway… when the vnc client comes up I only see 66% of my laptop screen.
I thought this would be issue with the resolution but it did not work out for me.
the picture of vnc is not even using the full size of my tv (connected to my osmc).

any ideas on that ?
sorry … I am not really into graphic stuff …

What kind of Pi are you using? Read in the first logfile about memory wasn’t enough for virtual display of 1980x1080?

Would be great if you could show the logfile from when you used the new mode-setting.

Without the log file I could only guess that it could be timing settings in /etc/fb.modes

timings 6734 148 88 36 4 44 5
hsync high
vsync high

Else try to set vxres and vyres to 1920x1080 in vnc_ip_server.sh when you use 1280x1024, that makes you enable to scroll the resolution of your laptop.

And the bit with using only a bit of your actual TV screen, has to do with the resolution of your TV still showing 1920x1080, and Directvnc only using 1280x1024. I’m not to familuar with HDMI/TV, but my guess is that 1280X1024 is a resolution that the tv needs to use 1920x1080 to display properly.

Hope this helps.

Hi,

I am using a RPI 2 B with OSMC 2016.02-4.

This are the config and Logs of failed attempts:

.directfbrc:

system=fbdev
mode=1920x1080-60
autoflip-window
desktop-buffer-mode=auto
no-vt-switching
no-graphics-vt
no-deinit-check
no-motion-compression
no-translucent-windows
memcpy=arm
depth=16
dma
hardware
cursor
log-file=/home/osmc/vnc-client/vnc.log

/etc/fb.modes:

mode "1920x1080-60"
    geometry 1920 1080 1920 1080 16

timings 6734 148 88 36 4 44 5
hsync high
vsync high
endmode

top gave me:

top - 13:23:53 up 20 min, 2 users, load average: 0.71, 0.54, 0.41
Tasks: 131 total, 1 running, 130 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.4 us, 8.2 sy, 0.0 ni, 91.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 686108 total, 344132 used, 341976 free, 27572 buffers
KiB Swap: 0 total, 0 used, 0 free. 250936 cached Mem

Log:

     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH
   ----------------------------------------------------------------

() DirectFB/Core: Single Application Core. (2014-10-21 10:21)
(
) Direct/Thread: Started ‘PS/2 Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(
) Direct/Thread: Started ‘Keyboard Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: Keyboard 0.9 (directfb.org)
(
) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting desktop resolution to 1920x1080 failed!
→ Using default resolution.
(!) DirectFB/DirectFBCreate: Setting desktop format failed!
→ Using default format.
(!) DirectFB/DirectFBCreate: Setting desktop buffer mode failed!
→ No virtual resolution support or not enough memory?
Falling back to system back buffer.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting system memory desktop back buffer failed!
→ Using front buffer only mode.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/core/layers: Could not set primary region config!
→ Not supported!
(!) InitLayers: Could not get primary region of layer 0!
→ Not supported!
(#) DirectFBError [DirectFBCreate( &dfb )]: Not supported!

changing to original timings:

mode "1920x1080-60"
    geometry 1920 1080 1920 1080 16
    timings 5787 328 120 34 1 208 3
endmode

gave me the same result:

     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH
   ----------------------------------------------------------------

() DirectFB/Core: Single Application Core. (2014-10-21 10:21)
(
) Direct/Thread: Started ‘PS/2 Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(
) Direct/Thread: Started ‘Keyboard Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: Keyboard 0.9 (directfb.org)
(
) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting desktop resolution to 1920x1080 failed!
→ Using default resolution.
(!) DirectFB/DirectFBCreate: Setting desktop format failed!
→ Using default format.
(!) DirectFB/DirectFBCreate: Setting desktop buffer mode failed!
→ No virtual resolution support or not enough memory?
Falling back to system back buffer.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/DirectFBCreate: Setting system memory desktop back buffer failed!
→ Using front buffer only mode.
(!) FBDev/Mode: No mode found for 1920x1080!
(!) DirectFB/core/layers: Could not set primary region config!
→ Not supported!
(!) InitLayers: Could not get primary region of layer 0!
→ Not supported!
(#) DirectFBError [DirectFBCreate( &dfb )]: Not supported!

workig config and log:

Fb.modes:

mode “1280x1024-60”
# D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz
geometry 1280 1024 1280 1024 8
timings 9260 248 48 38 1 112 3
hsync high
vsync high
endmode

directfbrs:
system=fbdev
mode=1280x1024-60
autoflip-window
desktop-buffer-mode=auto
no-vt-switching
no-graphics-vt
no-deinit-check
no-motion-compression
no-translucent-windows
memcpy=arm
depth=16
dma
hardware
cursor
log-file=/home/osmc/vnc-client/vnc.log

Log:

     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH
   ----------------------------------------------------------------

() DirectFB/Core: Single Application Core. (2014-10-21 10:21)
(
) Direct/Thread: Started ‘PS/2 Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(
) Direct/Thread: Started ‘Keyboard Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: Keyboard 0.9 (directfb.org)
(
) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
() DirectFB/Core/WM: Default 0.3 (directfb.org)
(
) FBDev/Surface: Allocated 1280x1024 16 bit RGB16 buffer (index 0) at offset 0 and pitch 3840.
() FBDev/Mode: Setting 1280x1024 RGB16
(
) FBDev/Mode: Switched to 1280x1024 (virtual 1280x1024) at 16 bit (RGB16), pitch 3840
() FBDev/Mode: Setting 1280x1024 RGB16
(
) FBDev/Mode: Switched to 1280x1024 (virtual 1280x1024) at 16 bit (RGB16), pitch 3840
(*) FBDev/Surface: Allocated 1280x1024 16 bit RGB16 buffer (index 0) at offset 0 and pitch 3840.
(!) [ 1930: 0.000] → Caught signal 15 (sent by pid 1935, uid 0) ←
(!!!) *** WARNING [still objects in ‘Layer Region Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in ‘Layer Context Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in ‘Surface Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]

Result:

My laptop:

My TV:

My TV and resulting log after setting vxres and vyres to 1920x1080 (same as before):

Log:

     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH
   ----------------------------------------------------------------

() DirectFB/Core: Single Application Core. (2014-10-21 10:21)
(
) Direct/Thread: Started ‘PS/2 Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(
) Direct/Thread: Started ‘Keyboard Input’ (-1) [INPUT OTHER/OTHER 0/0] <8388608>…
() DirectFB/Input: Keyboard 0.9 (directfb.org)
(
) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
() DirectFB/Core/WM: Default 0.3 (directfb.org)
(
) FBDev/Surface: Allocated 1280x1024 16 bit RGB16 buffer (index 0) at offset 0 and pitch 3840.
() FBDev/Mode: Setting 1280x1024 RGB16
(
) FBDev/Mode: Switched to 1280x1024 (virtual 1280x1024) at 16 bit (RGB16), pitch 3840
() FBDev/Mode: Setting 1280x1024 RGB16
(
) FBDev/Mode: Switched to 1280x1024 (virtual 1280x1024) at 16 bit (RGB16), pitch 3840
(*) FBDev/Surface: Allocated 1280x1024 16 bit RGB16 buffer (index 0) at offset 0 and pitch 3840.
(!) [ 3207: 0.000] → Caught signal 15 (sent by pid 3217, uid 0) ←
(!!!) *** WARNING [still objects in ‘Layer Region Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in ‘Layer Context Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in ‘Surface Pool’] *** […/…/…/lib/fusion/object.c:241 in fusion_object_pool_destroy()]

I changed the resolution of KODI to 1280x1024@60 and my TV did not have any problems displaying that.
So I guess it is not the TV ?

When i use 1280x1024 i get the same issue. working on solveing it.

Lets try to take the timmings out of the question:

sudo nano /etc/fb.modes

#
#   1920x1080, 60 Hz, Non-Interlaced (172.798 MHz dotclock)
#
#mode "1920x1080-60"
#     D: 74.481 MHz, H: 67.080 kHz, V: 60.00 Hz
#     geometry 1920 1080 1920 1080 16
#     timings 5787 328 120 34 1 208 3
#endmode

mode "1920x1080"
     # D: 74.481 MHz, H: 67.080 kHz, V: 60.00 Hz
     geometry 1920 1080 1920 1080 16
     timings 0 0 0 0 0 0 0
endmode

And change the modes line in /root/.directfbrc

mode=1920x1080

I got both these modes working on my TV on my Samsung 42"

And log file please :smile:

When you run the vnc-client in 1280x1024, and vxres=1920 and vyres=1080 in vnc_ip_server.sh. That should make it possible to scroll so you can see the whole screen, just like scroll list in your webbrowser.

1 Like

Hi,
taking out the timings did the trick for me.
now it runs smooth and stable.

great work and thanks again !!!

if you need me to test anything else I will be happy to help.

Great, glad to hear that, will let you know if there will be any further development or testing.

I followed the guide step by step but it doesn’t work for me. The screen goes black, and after few seconds start the OSMC interface. I’m sure the server is working. anybody help me?

Try to increase the sleep time in the vncstart2.sh script. it depends on how quick you can close kodi, addons, speed of sd card etc etc.

Whcih resolution are you running on your TV?

Updated the scripts, to ask for IP and password each time you use the addon and Lowered the sleep times to match Kryptons faster shutdown time.

OK I got it to work after a few false starts.
First off, I chose to put install install_vnc.sh in my scripts folder. That was a mistake. None of the files were in the correct place.
Then I had to dig around the scripts to work out how to start the vnc client.
It seems to be ./vncstart2.sh [serverIP] [password], which starts the client and displays the remote desktop.
This all requires a remote login via SSH to start the client, which is a bit awkward.
Can I start the client from the OSMC media centre by some method ?
Assuming I’ve got a remote desktop running, how do I quit ?

Hi @Inept-Get

It’s been awhile since I used this script, pre Krypton, but it should give you a VNC-launcher. Problem i think is that you haven’t enabled the addon. I did update the script to ask for ip and password on each launch instead of having to edit a file for the client to connect to an ip/password, but i’m unsure if i uploaded the changes.

Will test this myself, in a few hours and get back to you. But the script is expecting to be in osmc home directory when run.Should update the first post with those instructions.