Jetson Nano vnc/headless connections

I am currently trying to use a Jetson Nano Ubuntu 18.04 without a monitor by using NoMachine software but it consumes a lot of processing power (approximately 20-30% of each CPU core) and causes my deep learning model predictions to slow down when I want to see the output on the screen. I am trying to use vnc4server on it however vnc4server doesn’t start and gets terminated immediately despite creating xstartup. Another problem is that Jetson requires a HDMI to be plugged in for the NoMachine software to display the screen or else it shows a blank screen.

  • What would be the best alternative for NoMachine which is lightweight as well?
  • How to overcome the HDMI plug condition to display on VNC ?
2 Likes

Please check this document. Not sure if you could see this when nano device mode is on.

=======================================================================
                            README-vnc
                          Linux for Tegra
               Configuring VNC from the command-line
=======================================================================

A VNC server allows access to the graphical display of a Linux for Tegra system
over the network. This allows you to work physically remote from the Linux for
Tegra system, and avoids the need to connect an HDMI display, USB keyboard, or
mouse.

All commands specified below should be executed from a terminal on the Linux
for Tegra system. This could be a serial port, an SSH session, or a graphical
terminal application running on the HDMI display.

----------------------------------------------------------------------
Installing the VNC Server
----------------------------------------------------------------------

It is expected that the VNC server software is pre-installed. Execute the
following commands to ensure that it is:

sudo apt update
sudo apt install vino

----------------------------------------------------------------------
Enabling the VNC Server
----------------------------------------------------------------------

Execute the following commands to enable the VNC server:

# Inform the system which graphic display to interact with
export DISPLAY=:0
# Enable the VNC server
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false
# Reboot the system so that the settings take effect
sudo reboot

----------------------------------------------------------------------
Connecting to the VNC server
----------------------------------------------------------------------

Use any standard VNC client application to connect to the VNC server that is
running on Linux for Tegra. Popular examples for Linux are gvncviewer and
remmina. Use your own favorite client for Windows or MacOS.

To connect, you will need to know the IP address of the Linux for Tegra system.
Execute the following command to determine the IP address:

ifconfig

Search the output for the text "inet addr:" followed by a sequence of four
numbers, for the relevant network interface (e.g. eth0 for wired Ethernet,
wlan0 for WiFi, or l4tbr0 for the USB device mode Ethernet connection).

Once you are connected to the VNC server, execute the following command to
display the VNC server's graphical configuration tool, and then configure a
password for the VNC connection:

vino-preferences
2 Likes

Hi, I got vnc4server running on Jetson Nano. How do I need to change the xstartup file so that I can get the desktop rather than the gray screen? Also, on NoMachine only if a HDMI cable is plugged in the display slot it loads the desktop even without being connected to a monitor.

I create a file name ~/openvino at Jetson Nano

#!/bin/bash
export DISPLAY=:0
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false
/usr/lib/vino/vino-server &
$ chmod +x ~/openvino
$ ~/openvino

Then at my ubuntu host, I activate Remmina

Group = WORKGROUP
Protocol = VNC
Server = 192.168.55.1
Username = suryadi
Password = ***

Now, I can remote desktop to Jetson Nano.
External Media

A litte bit sluggish. It is better than nothing.
Thank you.

Nice! Thanks for sharing!

Mine keeps hanging at “Connecting…” screen. I am running in Headless mode and interacting with it via JupyterLab. What is username and password for the vnc connection? I am using the DLINano Image, and log jupyter shell kernel:

dlinano@jetson-nano:~$ hostname
jetson-nano
dlinano@jetson-nano:~$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:04:4b:e6:26:6d  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 148  base 0xe000

l4tbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.55.1  netmask 255.255.255.0  broadcast 192.168.55.255
        inet6 fe80::1  prefixlen 128  scopeid 0x20<link>
        inet6 fe80::3cc6:92ff:fe96:1cf9  prefixlen 64  scopeid 0x20<link>
        ether e2:e8:03:ec:79:35  txqueuelen 1000  (Ethernet)
        RX packets 1848  bytes 345766 (345.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3358  bytes 1349967 (1.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 1540  bytes 154095 (154.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1540  bytes 154095 (154.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rndis0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::e0e8:3ff:feec:7935  prefixlen 64  scopeid 0x20<link>
        ether e2:e8:03:ec:79:35  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::e0e8:3ff:feec:7937  prefixlen 64  scopeid 0x20<link>
        ether e2:e8:03:ec:79:37  txqueuelen 1000  (Ethernet)
        RX packets 1848  bytes 345766 (345.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3384  bytes 1400209 (1.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 50:3e:aa:ce:c6:29  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

dlinano@jetson-nano:~$ 01/10/2019 01:20:15 PM rfbProcessClientInitMessage: client gone
01/10/2019 01:20:15 PM Client _gateway gone
01/10/2019 01:20:15 PM Statistics:
01/10/2019 01:20:15 PM   framebuffer updates 0, rectangles 0, bytes 0
01/10/2019 01:20:33 PM [IPv4] Got connection from client _gateway
01/10/2019 01:20:33 PM   other clients:
01/10/2019 01:20:33 PM Client Protocol Version 3.3
Error while displaying notification bubble: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files

And server start log:

dlinano@jetson-nano:~$ /usr/lib/vino/vino-server &
[1] 7983
dlinano@jetson-nano:~$
** (vino-server:7983): WARNING **: 02:09:46.469: Your XServer does not support the XTest extension - remote desktop access will be view-only

02/10/2019 02:09:46 AM Autoprobing TCP port in (all) network interface
02/10/2019 02:09:46 AM Listening IPv6://[::]:5900
02/10/2019 02:09:46 AM Listening IPv4://0.0.0.0:5900
02/10/2019 02:09:46 AM Autoprobing selected port 5900
02/10/2019 02:09:46 AM Advertising security type: 'TLS' (18)
02/10/2019 02:09:46 AM Re-binding socket to listen for VNC connections on TCP port 5900 in (all) interface
02/10/2019 02:09:46 AM Listening IPv6://[::]:5900
02/10/2019 02:09:46 AM Listening IPv4://0.0.0.0:5900
02/10/2019 02:09:46 AM Clearing securityTypes
02/10/2019 02:09:46 AM Advertising security type: 'TLS' (18)
02/10/2019 02:09:46 AM Clearing securityTypes
02/10/2019 02:09:46 AM Advertising security type: 'TLS' (18)
02/10/2019 02:09:46 AM Advertising authentication type: 'No Authentication' (1)
02/10/2019 02:09:46 AM Re-binding socket to listen for VNC connections on TCP port 5900 in (all) interface
02/10/2019 02:09:46 AM Listening IPv6://[::]:5900
02/10/2019 02:09:46 AM Listening IPv4://0.0.0.0:5900
02/10/2019 02:09:46 AM Clearing securityTypes
02/10/2019 02:09:46 AM Clearing authTypes
02/10/2019 02:09:46 AM Advertising security type: 'TLS' (18)
02/10/2019 02:09:46 AM Advertising authentication type: 'No Authentication' (1)
02/10/2019 02:09:46 AM Advertising security type: 'No Authentication' (1)
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password $(echo -n 'dlinano'|base64)
gsettings set org.gnome.settings-daemon.plugins.sharing active true

This seems to work, but I got black screen when I logged on. Probably due to incorrect setting of $DISPLAY variable. I reboot and start the server with this command:

/usr/lib/vino/vino-server --display=:0 &

It works but the screen is too small. I followed this guide to make the screen to usable size:

Conclusion

Guide for VNC on the DLINANO image is very inaccurate and needs to be updated.

There might be problem ,when you turn on screen share option in Nvidia ,which can be fixed by following the instruction in this link: GitHub - Aravindseenu/Nvidia-jetson-VNC-remote-access: steps to control NVIDIA jeson through remote control.

1 Like

I followed the commands that WayneWWW posted above (2nd post). I installed the VNC to Jetson Nano, but when I try to connect through VNC from my laptop, it refuses. What should I do?

Any idea???

@suryadi @kayccc @
Don’t you face the problem of the zoomed screen when you take remote from vnc viewer on the very first time jetson start?

My workaround:
I have set up the remote access for vnc, but when I take remote without attaching HDMI to jetson, the remote gets zoom and when I attach the HDMI display it gets required resolution. If you know why is this happening, then please let me know. I don’t want to attach HDMI at every time jetson boot.

Please help to open a new topic for your issue. Thanks

Hi! This access is still within the same network, right? It is not from geographically location remote access

You should configure your resolution in the VNC and change default resolution, It will help.

@vle Link to the guide does not work.

Moreover, when I add these lines to the openvino script, it throws authentication errors

gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password "<my_pswd>"
gsettings set org.gnome.settings-daemon.plugins.sharing active true

On using @suryadi 's solution, I get an error that it cannot connect the the display when my HDMI port is open (no screen connected). I tried to fix it with XVFB which is a virtual display buffer. Now, it shows a black screen.

My Openvino script is as follows:

#!/bin/bash
export DISPLAY=:1
Xvfb :1 -screen 0 1024x768x16

gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false

gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password "<my_pswd>"
gsettings set org.gnome.settings-daemon.plugins.sharing active true

/usr/lib/vino/vino-server &

typically vnc won’t work unless hdmi display/ emulator is connected

Thanks for the response Andrey, is there a way to make it work without connecting a screen to the HDMI?

Can we emulate the connection with something else other than XVFB. Because XVFB does the same but it did not work for me.

1 Like

I connect my jetsonNano to ubuntu laptop using just ethernet cable with IP 10.42.0.x and have successfully used vncserver for desktop sharing: Screenshot-from-2021-01-31-22-36-26 — ImgBB
I used vncserver instead of vino-server following the step:

  1. Connect JN to laptop using ethernet cable and use putty to enter SSH
  2. in SSH, install vncserver as well as viewer:
    sudo apt install tightvncserver && sudo apt instsall xtightvncviewer
    then run cmd “vncserver” to enter password
  3. edit file xstartup:
    sudo nano ~/.vnc/xstartup
    then add 3 lines and save:
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    startlxde &
  4. reboot JN and enter SSH again, then start vncserver and viewer:
    vncserver
    xtightvncviewer (enter hostname:x and pwd)
    Then enjoy using remote desktop of JN with only ethernet cable :))
5 Likes

@hxn130599
Thank you for sharing!
However, your implementation probably also requires a display conencted to the jetson nano, so it would not run if the display is disconencted by the time the jetson nano boots?
otherwise?

I do not need display now, I just have JN, source 5V-3A and ethernet cable. That’s all I use for remote desktop, I have used raspi in the same way.

1 Like

I’ve tried use @suryadi 's solution but I’m still stuck…

When I launch openvino, this is what appears:

No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:
Run ‘vino-server --help’ to see a full list of available command line options

Any clue on what could be happening?

2 Likes