Easy way to change a default NANO setup to work in headless mode, ie no GUI services

As we only have ssh access is there a quick tutorial in setting this up in Headless mode.

Yes, here you go.
https://www.jetsonhacks.com/2019/08/21/jetson-nano-headless-setup/

Thanks for this, but I was looking for a solution to disabling all the GUI services as the board is not only accessible from ssh.

Temporary:
sudo systemctl isolate multi-user.target

Persistent:
sudo systemctl set-default multi-user.target

Undo:
sudo systemctl set-default graphical.target

Hi!
for some reason after setting sudo systemctl set-default multi-user.target I wasn’t able to ssh into my jetson nano.

Turns out that avahi-daemon exits after startup when systemd is not using graphical.target

Here’s some debug info:

systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2021-06-03 14:44:05 CEST; 17s ago
  Process: 3868 ExecStart=/usr/sbin/avahi-daemon -s (code=exited, status=0/SUCCESS)
 Main PID: 3868 (code=exited, status=0/SUCCESS)
   Status: "avahi-daemon 0.7 starting up."

Jun 03 14:44:05 nvjet systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::d81b:eaff:fe9f:165f.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface rndis0.IPv6 with address fe80::d81b:eaff:fe9f:165d.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface l4tbr0.IPv6 with address fe80::1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface l4tbr0.IPv4 with address 192.168.55.1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.150.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface lo.IPv6 with address ::1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: avahi-daemon 0.7 exiting.
Jun 03 14:44:05 nvjet systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.

here’s journalctl:

journalctl -u avahi-daemon -f
-- Logs begin at Thu 2021-06-03 14:43:56 CEST. --
Jun 03 14:44:05 nvjet systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::d81b:eaff:fe9f:165f.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface rndis0.IPv6 with address fe80::d81b:eaff:fe9f:165d.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface l4tbr0.IPv6 with address fe80::1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface l4tbr0.IPv4 with address 192.168.55.1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.0.150.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface lo.IPv6 with address ::1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: Leaving mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Jun 03 14:44:05 nvjet avahi-daemon[3868]: avahi-daemon 0.7 exiting.
Jun 03 14:44:05 nvjet systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.

Is it possible that some services depend on graphical.target so they stop working in multi-user.target mode?
Any Idea of what it could be?

sshd should only depend on networking.target, iirc. Most of my Tegra devices are headless running in multi-user and I can ssh in. Suggest problem lies elsewhere. Not sure what’s causing what you describe.

Yes, sshd is working fine for me, it seemed like i wasn’t able to ssh into my nano because i was using ssh user@hostname.local and found out that avahi-daemon “dies”.

Problem is it dies very gracefully, no error whatsoever

after a lot of digging, turns out that there’s a problem with the “.local” dns

after changing /etc/default/avahi-daemon to AVAHI_DAEMON_DETECT_LOCAL=0, the service starts without a problem.

The question is, why is it quitting only with multi-user.target and not in graphical.target as well?

@mdegans do you know how I could see what’s changing when booting in the two different modes?

I also have a raspberry pi running avahi-daemon and it’s been working fine, I checked the configurations and they’re the same with one exception:

in /etc/nsswitch.conf

hosts:          files mdns4_minimal [NOTFOUND=return] dns myhostname

myhostname is missing on the raspberry but i have it on the jetson nano. could it be this?

You can use systemctl to find out what services are running and what they depend on. Usually I just Google or check the --help or systemd documentation. There is probably at least one gui out there for it to get your bearings:

journalctl can be used to inspect the logs of a specific unit (a “service” is a kind of “unit”) with the --unit flag. There’s probably also a gui for that if you Google but the command line interface is pretty simple despite the overly verbose systemd documentation.

I already tried that, both systemctl --list-units, systemd-analyze but there’s little to no difference, except for gdm and other GUI related processes… very weird. I opened an issue on the avahi repo, let’s see where that goes

Thanks!