Problem while attempting use GUI in headless mode

Well, so far I have reached to the step where my jetson nano is booted up and I’m able to connect to it with Putty and jetson nano is connected to wifi (used this method (part 3) but eth0 doesn’t have an IP address and therefore I can’t proceed to the step where I can use the GUI.

I’m using a realtek rtl8812au wireless adapter to connect to wifi…

any suggestions on what should i do?

Update: I think I got the IP address (in wlan0) I needed as when I use that IP to login through putty…it works but I’m not able make this work with tightVNC and Remote desktop connection…

any suggestions…?

Hi,

For IP issue, I am not sure which interface you are trying to use. eth0 is generally for the wired ethernet. And wlan0 should be from wifi card.

In both methods, the other side should provide the dhcp server to provide you the IP.

As for tightVNC, please check if this thread can help.

okay…i will look into it…but since I got tired after many unsuccessful attempts, I’m trying to work it out with the putty…

@Prithviraj
as for tightvncviewer also check this setup, please Jetson Nano vnc/headless connections - #19 by hxn130599

okay…it says to install vncserver and viewer… but i want to confirm that should i install that in my jetson nano?

it depends, you may also just use e.g. nomachine from deb for armv8l
https://download.nomachine.com/download/7.1/Arm/nomachine_7.1.3_1_arm64.deb
did not try the latter in headless though

okay…thanks…but i think i might go with tightvnc and see if it works out…

Hello,

You can also try x11vnc to get the display. Install it on the target system and run vncviewer from the client system.

1 Like

okay…can u give me more info on that?

I think you can run like below:

  1. sudo apt install x11vnc
  2. ps -ef | grep X # get the display number to be used below
  3. x11vnc -usepw -auth guess -display :<display-number>

Generally, this trick works for me. I have not done this on latest JetPacks but it should work with the latest JPs as well.

ps -ef | grep X
root      5346  5265  0 14:06 tty7     00:00:02 /usr/lib/xorg/Xorg -core :0 -sea     t seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
prithvi+ 12648  6189  0 17:07 pts/0    00:00:00 grep --color=auto X

This is the output I’m getting…Which number is the display number?

Please try with 0 or 1.

This is the output for putting 0…it failed…same for 1

 x11vnc -usepw -auth guess -display 0
Enter VNC password:
Verify password:
Write password to /home/prithviraj/.vnc/passwd?  [y]/n y
Password written to: /home/prithviraj/.vnc/passwd
08/02/2021 17:28:56 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 12706
xauth:  file /home/prithviraj/.Xauthority does not exist
08/02/2021 17:28:56 -auth guess: failed for display='0'
prithviraj@jetson:~$ x11vnc -usepw -auth guess -display 1
08/02/2021 17:29:56 -usepw: found /home/prithviraj/.vnc/passwd
08/02/2021 17:29:56 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 12770
xauth:  file /home/prithviraj/.Xauthority does not exist
08/02/2021 17:29:56 -auth guess: failed for display='1'

Try with “:0” or “:1”

x11vnc -usepw -auth guess -display :0

Sometimes, you will have to experiment with the “-auth” option but I think it works well on newer distributions.

still failed…

What about trying this as “-auth” argument as a ‘root’ user:
/var/run/lightdm/root/:0

You may have to export your DISPLAY to either :1 or :0.

Did I execute the command wrong?

 x11vnc -usepw -auth /var/run/lightdm/root:0 -display :0
09/02/2021 22:20:30 -usepw: found /home/prithviraj/.vnc/passwd
09/02/2021 22:20:30 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 7523
No protocol specified
09/02/2021 22:20:30 XOpenDisplay(":0") failed.
09/02/2021 22:20:30 Trying again with XAUTHLOCALHOSTNAME=localhost ...
No protocol specified

09/02/2021 22:20:30 ***************************************
09/02/2021 22:20:30 *** XOpenDisplay failed (:0)

*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
   started: x11vnc does not start the X server.  (however, see the -create
   option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
   environment variable to refer to the display of the desired X server.
 - Usually the display is simply ":0" (in fact x11vnc uses this if you forget
   to specify it), but in some multi-user situations it could be ":1", ":2",
   or even ":137".  Ask your administrator or a guru if you are having
   difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority)
   to connect to the X DISPLAY.   Here are some Tips:

 - Often, you just need to run x11vnc as the user logged into the X session.
   So make sure to be that user when you type x11vnc.
 - Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
   file may be accessed.  The cookie file contains the secret key that
   allows x11vnc to connect to the desired X DISPLAY.
 - You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
   by the -auth option, e.g.:
       x11vnc -auth /home/someuser/.Xauthority -display :0
       x11vnc -auth /tmp/.gdmzndVlR -display :0
   you must have read permission for the auth file.
   See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
   program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
   to find and use the raw display manager MIT-MAGIC-COOKIE file.
   Some examples for various display managers:

     gdm:     -auth /var/gdm/:0.Xauth
              -auth /var/lib/gdm/:0.Xauth
     kdm:     -auth /var/lib/kdm/A:0-crWk72
              -auth /var/run/xauth/A:0-crWk72
     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
     dtlogin: -auth /var/dt/A:0-UgaaXa

   Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

   Starting with x11vnc 0.9.9 you can have it try to guess by using:

              -auth guess

   (see also the x11vnc -findauth option.)

   Only root will have read permission for the file, and so x11vnc must be run
   as root (or copy it).  The random characters in the filenames will of course
   change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html
prithviraj@jetson:~$ x11vnc -usepw -auth /var/run/lightdm/root:0 -display :1
09/02/2021 22:21:06 -usepw: found /home/prithviraj/.vnc/passwd
09/02/2021 22:21:06 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 7527
Client is not authorized to connect to Server09/02/2021 22:21:06 XOpenDisplay(":1") failed.
09/02/2021 22:21:06 Trying again with XAUTHLOCALHOSTNAME=localhost ...
Client is not authorized to connect to Server
09/02/2021 22:21:06 ***************************************
09/02/2021 22:21:06 *** XOpenDisplay failed (:1)

*** x11vnc was unable to open the X DISPLAY: ":1", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
   started: x11vnc does not start the X server.  (however, see the -create
   option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
   environment variable to refer to the display of the desired X server.
 - Usually the display is simply ":0" (in fact x11vnc uses this if you forget
   to specify it), but in some multi-user situations it could be ":1", ":2",
   or even ":137".  Ask your administrator or a guru if you are having
   difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority)
   to connect to the X DISPLAY.   Here are some Tips:

 - Often, you just need to run x11vnc as the user logged into the X session.
   So make sure to be that user when you type x11vnc.
 - Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
   file may be accessed.  The cookie file contains the secret key that
   allows x11vnc to connect to the desired X DISPLAY.
 - You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
   by the -auth option, e.g.:
       x11vnc -auth /home/someuser/.Xauthority -display :0
       x11vnc -auth /tmp/.gdmzndVlR -display :0
   you must have read permission for the auth file.
   See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
   program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
   to find and use the raw display manager MIT-MAGIC-COOKIE file.
   Some examples for various display managers:

     gdm:     -auth /var/gdm/:0.Xauth
              -auth /var/lib/gdm/:0.Xauth
     kdm:     -auth /var/lib/kdm/A:0-crWk72
              -auth /var/run/xauth/A:0-crWk72
     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
     dtlogin: -auth /var/dt/A:0-UgaaXa

   Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

   Starting with x11vnc 0.9.9 you can have it try to guess by using:

              -auth guess

   (see also the x11vnc -findauth option.)

   Only root will have read permission for the file, and so x11vnc must be run
   as root (or copy it).  The random characters in the filenames will of course
   change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html

/var/run/lightdm/root/:0

Also, if it still fails then you will have to either set DISPLAY=:0 (export DISPLAY=:0) or run the command as a root user or both.

@Prithviraj probably you do not have a connected display at all?
@AnishAney probably the method requires a physically connected display?
Typically it is also required to enable autologin/ disable screen lock etc in order to use VNC, as per my experience