NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Installing and using x11vnc on a 2016 x64 target (remote UI access to a cRIO)

One of the packages that made its way into the 2016 opkg feeds is x11vnc. This is a package that allows you to serve the current UI over a VNC connection to the target (meaning that you can remotely check the status of an embedded UI of a running LabVIEW app from the comfort of your desk).

 

  1. Make sure that your x64-based controller is connected to the internet (this is not strictly required, but prevents you from needing to download all of the separate .ipk files that are needed to a USB drive to install from)
  2. Log into the controller (serial or ssh)
  3. Run the following commands
    1. opkg update
    2. opkg install x11vnc
  4. Enable the UI if it has not already been enabled
  5. Test it out first
    1. From a terminal on the embedded UI, run x11vnc
      --OR--
    2. From a serial or ssh console, run DISPLAY=:0 x11vnc
      --THEN--
    3. Download a vnc client for your OS of choice (I've used realvnc, tightvnc, and ultr@vnc from Windows before).
      1. Here, I'm using ultr@vnc, the non-installer version
    4. Connect to your target

x11vnc_startup_0.jpg

  1. To set the x11vnc server to run on startup, goto Settings Manager[1], Session and Startup[2], and under the Application Autostart tab, add an entry for x11vnc

x11vnc_startup_1.jpg

x11vnc_startup_2.jpg

 

IMPORTANT! READ THIS!

 

Right now, the connection is passwordless and gives complete control to the UI as if you were standing at the controller. You should read up on all of the options to see what makes sense for you, but I would recommend looking at -storepasswd and -usepw for some basic access control, you may wish to look into tunneling over ssh etc. etc.

 

Right now, as configured, the x11vnc server will exit after the first connection is closed, you would want to use -forever or -loop to keep the interface up. Additionally, it currently only accepts a single connection at a time, to share between users, look into the aptly-named -shared option. These would be added to the Command field when adding the startup application.

Message 1 of 8
(4,524 Views)

Hi,

Can someone kindly advise on how to keep the x11vnc running with -forever or -loop. I have just started to know about Linux. Thank you. 

0 Kudos
Message 2 of 8
(1,923 Views)

add the -forever to the command in add application window.

name: x11vnc
Description: X11 VNC server
Command x11vnc -forever

 

Tested on crio 9030 with LV2020

0 Kudos
Message 3 of 8
(920 Views)

I'm trying to use x11vnc on a cRio 9041. It's close to working but...

 

1. I found that I first have to set the display size in the cRio or else the vncviewer will only see a very small portion of the screen.  I do this by sshing into the device and running:
> export DISPLAY=:0

>xrandr -fb 1920x1080

 

then I can start the server with:
> x11vnc -display :0 -forever -geometry 1920x1080

 

Now opening it with a view shows the whole screen.


Is there a way to do this automatically at startup so I don't have ssh in first to set the display properties?

Also, the fonts are wrong in the application when it's running, but maybe that's worth another post.

 

0 Kudos
Message 4 of 8
(788 Views)

I arrived at the same stage. Did you manage to find a solution for automatically setting the screen resolution? Would be great to update this thread so everybody can benefit 🙂

0 Kudos
Message 5 of 8
(484 Views)

Yes, I did find a workable solution.  I had to start another thread to get it though.  Try chipmonk77's solution at...

 

https://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/howto-make-x11vnc-start-on-boot/m-p/4152766

 

 

0 Kudos
Message 6 of 8
(477 Views)

Can the same be used to replicate virtual console display on a Windows host PC? What additional steps do we need to view the VCS data continuously on the host PC? 

0 Kudos
Message 7 of 8
(354 Views)

Propably just installing a VNC server is the easiest way.

This guide is for the linux based RT system.

For windows you can use realvnc

0 Kudos
Message 8 of 8
(312 Views)