Jetson devices are great that you can plug in a HDMI/DisplayPort monitor and use them like a normal desktop. However, many times it's not possible to carry a monitor to where the Jetson device is being used. In such cases, it helps to be able to login using some sort of remote desktop, over Wifi or Ethernet.
In this post, I want to share some simple steps to get your remote desktop access up and running, and hopefully save you some time. I performed this on a Jetson Xavier NX (with Jetpack 4.4) but should work on any Jetson device.
Note that while there are as many ways to accomplish this as the number of oranges on an orange tree, I will only mention the simplest method that worked for me.
PrerequisitesFor this post, I will assume:
- you already have a working Nvidia image on your device's SD card.
- your device is already configured and connected to your home/office network via wifi or ethernet
The Jetson SD card image comes pre-installed with Vino vnc server, which is what we will use.
1. Configure Vino (Vnc Server)
The first problem I encountered is that if you try opening "Desktop Sharing" app/setting on the Jetson, it seemed to crash every time. After much searching, I found the following method to stop these crashes:
First, install text editor "Nano" if you don't have it (or use your preferred editor instead):
sudo apt-get install nano
In a terminal, execute the following, to edit the Vino schema file
sudo nano /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml
Now, insert the following snippet in the xml schema file
<key name=’enabled’ type=’b’>
<summary>Enable remote access to the desktop</summary>
<description>
If true, allows remote access to the desktop via the RFB
protocol. Users on remote machines may then connect to the
desktop using a VNC viewer.
</description>
<default>true</default>
</key>
Save (Ctrl+O) and exit (Ctrl+X).
Now, we need to compile the edited schema
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
Once this executes, we can open the "Desktop Sharing" application (using search box on top-left). Once open, select (Tick) the following options:
"Allow other users to view your desktop""Allow other users to control your desktop"
The other settings can be left as is. You can close this window.
2. Start VNC Server during every Start-up
We want the VNC server to start-up by itself every time the device boots. For this, search "Startup" using search box on top-left of screen.
When the window opens, click "Add", then type "Vino" as name and "/usr/lib/vino/vino-server" in command box. You can add a description if you like. Then click "Save" and close the app.
Next, we need to disable encryption of the VNC connection, for which we will set some Vino settings. Type the following in a terminal:
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino prompt-enabled false
Protip: Note down the IP address of your Jetson device by executing the following command:
ifconfig
5. Set-up auto-login:
The VNC server starts only after you login, which isn't too convenient for when installed remotely, without screen and keyboard/mouse. So we will set-up auto-login so it logs in as soon as it boots up (and consequently starts the VNC server that we can then login into).
In the Search space in top-left corner, type "User Accounts" and click the icon. Once the window appears, click "Unlock" (top right corner in window) and then switch "Automatic Login" to ON position.
Now you can close this window and reboot the device.
reboot
4. Login remotely
To login remotely, you can use one of many VNC applications. I personaly use tightVNC for Windows, and RemoteRipple if using Android. You an use other applications too. (p.s RemoteRipple used to be a free app!)
You only need the IP address and password of your device to login. You also need the remote Jetson device as well as the client app device to be on the same network. (Actually, you can configure your device for access from anywhere in the world also, but that needs more steps. Perhaps in a future post)
Pro Tip: If you didn't note down your device's IP address, or if it changes due to DHCP assigning it a different address after boot-up, you can use the Fing app on your phone to "Scan for devices" on your local network to find the new IP.
5. Set a better Resolution for Remote Desktop
One problem that is immediately visible is that the default (virtual) screen resolution is very low, since without a physical display, it falls back to default of 640x480.
For many use cases, this small area is painful to work with, and so we will fix this now.
We edit the xorg.conf file, using following command:
sudo nano /etc/X11/xorg.conf
Insert the following "Section" at the end of the file. In the folloing snippet, I have used 1280x800 resolution, but you can replace it with one that you desire more. Note that higher the resolution you go for, more data will be needed to be sent per frame, so fps/update rate will drop. Depending on your application you can choose to go for higher resolution(slower update rate, more screen space) or lower resolution(higher update rate, less screen) or perhaps a middlegrounds somewhere in between.
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Default Device"
SubSection "Display"
Depth 24
Virtual 1280 800
EndSubSection
EndSection
Save (Ctrl + O), Exit (Ctrl+X)
Reboot device and login remotely. The screen should have the new resolution now.
Note that if you need to change resolution again, you will have to repeat this step (i.e, you cannot change resolution dynamically as you would for a physical screen)
I want to give credit to the posts/discussions here and here for a lot of the information that I ended up using.
Comments
Please log in or sign up to comment.