Build Ubuntu Server for the tk1 for headless operation.

I am thinking of trying to build Ubuntu Server for the tk1, don’t need all the desktop stuff for my application and I think the tk1 would run a bit better headless for this.

I don’t want to take an installed system and then remove things, since I know apt-get it will break the system.

Was wondering if you might have any information as to how to start the process?


An entire book could probably be written on the topic just for Debian-like distributions. I suspect the answer is mostly found via Ubuntu documentation (someone must have done this before on a non-Jetson), and much (but not all) of the answer is independent of whether working on a Jetson versus desktop. You may find an Ubuntu HOWTO on the topic which is already mostly correct, even for Jetson (I’ve never created a distro from scratch, but there is bound to be an example somewhere of Ubuntu flavors from scratch). After that, the nVidia-specific files can be added in. At least for GPU, you will have to have some graphics packages still present if you want CUDA/GPU access (you don’t need to run graphics applications, but the interface to the device is tied to some graphics packages…OpenGLES would generally access a GPU the same way CUDA would do so).

To make experimentation faster, you’ll probably want to create a clone of the root partition for fast re-install and testing:

You can clone and save a reference copy of the unmodified Jetson. You can also clone your current progress, and switch back and forth between the two (although two Jetsons would be far faster…you could check things on the unmodified Jetson and try them out on the test Jetson). Flashing with a re-used clone image is very fast, creating a clone is slow.

On your Jetson, before removing anything, you’ll probably want to add package “apt-file”, and initialize it with “sudo apt-file update”. From then on, you can find out what package owns a file via “apt-file search /path/to/the/file”. You will also want a starting list of packages to refer to, e.g., from Jetson “dpkg -l”.

Second, understand that some files are linked to other file libraries. Executables and most libraries rarely function without some other file (eventually the dependency reaches a kernel feature, and the buck stops there). If the file links to something else (using the linker), then you can use “ldd /path/to/file” and you’ll know the parents to the file which must also stay in place. Between ldd and apt-file search, when something breaks, you’ll probably be able to figure out what must stay in place.

There are many script files which ldd does not work with, you’ll just have to go through those if they break and see what step is missing after you’ve removed something.

Assuming you use the original kernel and boot loader, the specifics for Jetson would include anything related to direct hardware access. There are distributions out there which function on Jetson, e.g., there is a Fedora variant, but unless hardware direct access functions are preserved, you’ve lost many of the performance benefits of Jetson. The flash script file puts those files in place on a sample rootfs. You can use that same script to unpack and place the files in an alternate location, and then browse those files. For example, if you placed a sample rootfs on SD card on your desktop host, then the "-r " option of can populate that SD card instead of the local project directory rootfs. I created a “binaries” subdirectory in my L4T R21.4 project just for browsing, and ran “sudo ./ -r ./binaries”. I mention this because regardless of distribution, these files will need to be installed.

As an example of tracking down packages which might be removed to disable graphics, but must actually stay in place due to nVidia-specific dependencies, note in the unpack of file “usr/lib/arm-linux-gnueabihf/tegra/”. If you want a camera to use hardware accel, this file and what it links to must remain. The command “ldd /usr/lib/arm-linux-gnueabihf/tegra/” reveals this chain of libraries:

root@tk1:/usr/lib/arm-linux-gnueabihf/tegra# ldd => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb6ae9000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb6ace000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb6ab9000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb6aa0000) => /usr/lib/arm-linux-gnueabihf/tegra-egl/ (0xb6a15000) => /usr/lib/arm-linux-gnueabihf/tegra-egl/ (0xb69ff000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb69e3000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb695e000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb6940000) => /usr/lib/arm-linux-gnueabihf/ (0xb6901000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb5dcf000) => /usr/lib/arm-linux-gnueabihf/ (0xb5d24000) => /lib/arm-linux-gnueabihf/ (0xb5d19000) => /lib/arm-linux-gnueabihf/ (0xb5cfe000) => /lib/arm-linux-gnueabihf/ (0xb5cf0000) => /lib/arm-linux-gnueabihf/ (0xb5c84000) => /lib/arm-linux-gnueabihf/ (0xb5b9c000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb5b3e000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb5b32000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb5b23000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb5b10000)
        /lib/ (0xb6f48000) => /lib/arm-linux-gnueabihf/ (0xb5aee000) => /usr/lib/arm-linux-gnueabihf/ (0xb5a08000) => /usr/lib/arm-linux-gnueabihf/ (0xb59f6000) => /usr/lib/arm-linux-gnueabihf/tegra/ (0xb59e4000) => /usr/lib/arm-linux-gnueabihf/ (0xb59c9000) => /usr/lib/arm-linux-gnueabihf/ (0xb59be000) => /usr/lib/arm-linux-gnueabihf/ (0xb59b2000)

Note in that list you may not want to run X11, but you probably want to keep all of those X11 files like and Using apt-file search, you could then take a list of existing packages from an unmodified Jetson and mark those as “keep”. The trick here is you will modify init to not run X11, but you will keep files used for graphics and graphics hardware in order to support those hardware features. Some of those files can actually be removed, as they might be display and not get involved as an API for GPU access.

Once you have everything ready for testing, be brave and see what breaks when you remove package lightdm and anything depending upon it…or list files of lightdm package, and one at a time disable a file to see what happens (non-destructive disable can be accomplished by gzip of the file).