Headless setup and boot/SSH through USB

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Taylor7500
Posts: 3
Joined: Sat Jan 16, 2021 4:16 pm

Headless setup and boot/SSH through USB

Post by Taylor7500 »

Looking to set up my Pi Zero such that I can connect it to my computer via USB and SSH into it in order to use it. Pretty much all tutorials out there suggest putting dtoverlay=dwc2 in config.txt and modules-load=dwc2,g_ether after rootwait in cmdline.txt however these are all meant for Raspbian/RPi OS rather than DietPi.

I have gone through the initial setup of DietPi and finished the software update/install, and if I connect my Pi Zero to my network I can SSH into it. However that requires using the USB port to an ethernet adapter rather than my PC, so I know that the DietPi install worked and the SSH can work.

However when connecting it up via USB the Pi is very clearly powered and running, however I am unable to SSH into it. I have gone through dietpi.txt and stopped it waiting for network before it continues booting so I know it's not stuck on that. I also found the GitHub page linked below and added the config file as it suggests however no luck there.

Is there anything else I can do to get this working? Do you have any recommendations to get my Pi Zero working through USB?

GitHub page: https://github.com/MichaIng/DietPi/issues/3253
User avatar
Joulinar
Posts: 5601
Joined: Sat Nov 16, 2019 12:49 am

Re: Headless setup and boot/SSH through USB

Post by Joulinar »

Hi,

many thanks for your message. Connecting your device directly to your PC doesn't make much sense because to complete initial installation, DietPi need a valid network as well as internet connection.

Furthermore, DietPi is not an own OS. In case of Raspberry Pi devices, the OS used is Raspberry OS. It's an extrem slim/diet version of Raspberry OS where all not needed packages are removed within the default images. Recommendation would be to connect the RPi Zero to WiFi.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Taylor7500
Posts: 3
Joined: Sat Jan 16, 2021 4:16 pm

Re: Headless setup and boot/SSH through USB

Post by Taylor7500 »

Thanks.

I have already completed initial installation separately. Now it is set up I would like to use it in the manner I specified, by connecting it to my PC via USB when I want to use it.

This is not a Pi Zero W so it does not have wifi, and only has one USB port so I can either connect a LAN or a USB through that. Ideally I could share networking with my PC when it is plugged in but that is a problem for a later time.
User avatar
Joulinar
Posts: 5601
Joined: Sat Nov 16, 2019 12:49 am

Re: Headless setup and boot/SSH through USB

Post by Joulinar »

well as the underlying OS is Raspberry OS, you could follow the guides on the web. According our GitHub entry, it's important to setup usb0 interface on your device https://github.com/MichaIng/DietPi/issu ... -562525169
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Taylor7500
Posts: 3
Joined: Sat Jan 16, 2021 4:16 pm

Re: Headless setup and boot/SSH through USB

Post by Taylor7500 »

I have done, and still no luck.
Post Reply