I’m listing here a few things that I tend to tweak or do on my dev boards. Most of them are generic Linux configs, some are more Jetson specific.
First step
Flash the latest L4T release with “-S 14GiB” option to get a decent sized root partition.
First Boot
This only valid in releases before 21.1.
Make a copy of the libglx.so as that gets overridden in upgrades:
sudo cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so-19r3
Everytime you run “apt-get upgrade”, do copy the original version back.
Speed up the remote login
It takes a quite a while to login with ssh as Ubuntu checks for updates. To disable that, edit
/etc/update-motd.d/90-updates-available
/etc/update-motd.d/91-release-upgrade
And add the “exit 0” on the second line, right after the “#!/bin/sh”
If you don’t want to provide your password every time you log in to Jetson with ssh, you can copy your public key to Jetson. If you haven’t yet created the keys on your desktop Linux, you can create them with “ssh-keygen”. After that you should have either “$HOME/.ssh/id_dsa.pub” or “$HOME/.ssh/id_rsa.pub”. Copy the public key to Jetson:
ssh-copy-id ubuntu@<jetson's IP or hostname>
If you get “ERROR: No identities found”, add “-i $HOME/.ssh/id_rsa.pub” option.
Now you should be able to login without ssh asking the password:
ssh ubuntu@<jetson's IP or hostname>
Extra repositories
You may want to add the Ubuntu’s Universe and Multiverse repositories as they contain packages that many instructions assume. Universe contains community maintained software and Multiverse contains non-free software (licensing restrictions etc.)
sudo apt-add-repository universe
sudo apt-add-repository multiverse
sudo apt-get update
Some of the packages mentioned below comes from Universe or Multiverse.
Autologin
If you want to login automatically to the graphical environment instead of manually logging in after every boot, do the following:
sudo mkdir -p /etc/lightdm/lightdm.conf.d
sudo vi /etc/lightdm/lightdm.conf.d/autologin.conf
And add the following lines:
[SeatDefaults]
autologin-user=ubuntu
Reboot the Jetson to make LightDM to read the configuration again.
XFCE
If you want to use something else than Unity as the desktop environment, I recommend XFCE. It is quite lightweight and has a lot of options to tweak it.
Install XFCE:
sudo apt-get install xfce4 xfce4-goodies gnome-icon-theme-full
(I’m not sure if the gnome-icon-theme-full package provides anything meaningful…)
You can have multiple desktop environments installed at the same time and when logging in using the graphical login manager, you can choose which one to start.
Or if you want to change the default (works also with the autologin):
sudo mkdir -p /etc/lightdm/lightdm.conf.d
sudo vi /etc/lightdm/lightdm.conf.d/xfce.conf
And add the following lines:
[SeatDefaults]
user-session=xfce
Reboot the Jetson to make LightDM to read the configuration again.
You can check all the available sessions from /usr/share/xsessions/.
I recommend changing the screensaver to “Blank screen only” in Settings → Screensaver.
It seems that from some reason the colors in the XFCE’s default terminal are black on black so I recommend to edit the default profile in the Terminal application and select green on black color mode.
If you are interested to know how much CPU etc. are being used, click right mouse button on the panel and add all the CPU/network/monitor/temperature/etc. plugins to the panel. CPU temperature is not shown on the panel by default but you need to enable it from the plugin’s properties.
CPU performance
rel-21.1 changed governor to interactive by default which seems to work better for many cases than the ondemand that 19.3 defaulted to. For Kodi (XBMC) use, I still recommend setting the performance mode.
On the idle desktop the performance governor seems to increase the power consumption by 0.4W, which I’m fine with. On heavy use cases the difference might be significantly larger though.
Install CPU frequency tools:
sudo apt-get install cpufrequtils
Configure it by editing the default setting (create the file if needed):
sudo vi /etc/default/cpufrequtils
And add the following lines:
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED=0
MIN_SPEED=0
Reboot or restart the service to get the new settings applied:
sudo /etc/init.d/cpufrequtils restart
VNC
I’m rarely using VNC but others might find it a convenient way to do some occasional work on a remote system. VNC allows you to run the whole graphical environment remotely but it doesn’t use any display related accelerated rendering so any OpenGL/CUDA applications you should run locally. These instructions will open a new session, so you can open it even if you already have the graphical desktop environment running there.
Install VNC server:
sudo apt-get install tightvncserver
Configure the login manager to start VNC:
sudo mkdir -p /etc/lightdm/lightdm.conf.d
sudo vi /etc/lightdm/lightdm.conf.d/vnc.conf
And add the following lines:
[VNCServer]
enabled=true
port=5900
width=1280
height=720
depth=24
Reboot the Jetson to make LightDM to read the configuration again.
Now you can connect to Jetson from your desktop computer. The command is for Linux but I think there are applications for Windows as well:
vncviewer <jetson's IP or hostname>
The connection is slowish even in fast local network but I think it’s still usable for many things. It can be even used over slower networks with heavy compression:
vncviewer -compresslevel 9 <jetson's IP or hostname>
Sharing monitor, keyboard and mouse
I don’t have extra monitor to dedicate to Jetson and having extra set of keyboard and mouse is also inconvenient. Yet another way to running graphical applications remotely is to use X forwarding over ssh:
ssh -X ubuntu@<jetson's IP or hostname>
That allows you to run some apps easily without any other setup. Again, that doesn’t support display related accelerated rendering so it’s a bit limited.
Another solution is to run everything locally on Jetson and just forward your mouse and keyboard to that direction. My monitor has DVI and HDMI inputs. My Linux desktop is connected to the DVI and Jetson to the HDMI, so I can switch easily between them by using the source-button in my monitor.
To forward your mouse and keyboard you need to allow X forward on Jetson:
sudo mkdir -p /etc/lightdm/lightdm.conf.d
sudo vi /etc/lightdm/lightdm.conf.d/allow-tcp.conf
And add the following lines:
[SeatDefaults]
xserver-allow-tcp=true
Reboot the Jetson to make LightDM to read the configuration again.
Allow external X connections from any host to Jetson:
ssh ubuntu@<jetson's IP or hostname>
export DISPLAY=:0
xhost +
Now, install x2x on your Linux desktop and run it (assuming Jetson is on your table left from your Linux desktop’s monitor):
sudo apt-get install x2x
x2x -to jetson:0 -west
The x2x command above means that when you move your mouse on your Linux desktop over the left (west) edge, it will be on the Jetson’s display. So switch your monitor’s input to Jetson and you can pretend you are locally on your Jetson board.
Running scripts on boot
The easiest way to run scripts as root on every boot, is to run your script from /etc/rc.local.