Oh man this took me a while to figure out.
Format micro SD card the normal way.
Put an operating system on there using the Raspberry Pi Imager for Ubuntu.
Change directory into the
bootpartition of the micro SD card:cd /media/johnny/bootCreate a blank
sshfile:touch sshAdd
dtoverlay=dwc2to the end ofconfig.txt:echo "dtoverlay=dwc2" >> config.txtAdd
modules-load=dwc2,g_etherdirectly afterrootwaitwithincmdline.txt:sed -i 's/rootwait/rootwait modules-load=dwc2,g_ether /g' input.txtPlug a micro-usb cable into the port closest to the HDMI port on the Raspberry Pi Zero. Plug the other end of the cable into your computer.
Wait two minutes for the Raspberry Pi Zero to finish doing it’s thing.
Open the Network panel in Settings and click the gear icon to open the settings for the Wired connection. In some Linux distributions, this is called Netchip Ethernet.
Go to the IPv6 tab and set the IPv6 Method to Disable.
Go to the IPv4 tab and set the IPv4 Method to Link-Local Only.
Click Apply.
Toggle the Wired connection off and then on again.
Ping the Raspberry Pi Zero:
ping raspberrypi.local > PING raspberrypi.local (169.254.194.96) 56(84) bytes of data. > 64 bytes from raspberrypi.local (169.254.194.96): icmp_seq=1 ttl=64 time=0.952 ms > 64 bytes from raspberrypi.local (169.254.194.96): icmp_seq=2 ttl=64 time=0.536 msIf you got a response to the
ping, you should be able to connect to your Raspberry Pi Zero over USB. If you didn’t get a response, you might need to reboot your computer.If, after rebooting, you still can’t connect to your Raspberry Pi Zero, try using a different micro USB cable. Some cables are designed to only transfer power and not data.