I am trying to perform a headless setup of a raspberry pi zero W, which involves creating some new files in the boot partition of the SD card before putting it into the pi (wpa_supplicant.conf and ssh). I flashed the card, added the files, and verified that they were saved by ejecting the card then putting it back into my pc to check. However, when I insert the card into the raspberry pi and power it up, it does not connect to Wifi, and when I shut it down and put the card back into my computer, I find that the files that I added are gone.

I followed the same steps as multiple guides on the Internet and none of them seemed to mention how to get around this problem. I am using the latest version of Raspbian stretch lite, a Unirex MicroSDHC 8GB Class 10 card, and a Raspberry Pi zero W. I have tried multiple sd cards, pis and host PCs, but i have not been able to try any different models of anything yet.

Does anybody know what could be the cause of this?

  • Welcome to Raspberry Pi SE. Be sure to take the tour at raspberrypi.stackexchange.com/Tour May I suggest that we need a little more help in trying to give a good answer here. "multiple guides" are mentioned but without knowing how to find them to check your work it is difficult.
    – SDsolar
    Commented Apr 19, 2018 at 1:28
  • Have set the country code in wpa_supplicant.conf? Without it wifi will not start.
    – Ingo
    Commented Apr 19, 2018 at 7:11

2 Answers 2


This is by design.

The files are copied to the default locations on boot, then deleted.

If they don't work there is something else wrong.

See How to set up networking/WiFi


Milliways is correct. The changes made in the boot folder files gets copied to the correct locations. I found it easiest to just edit the wpa_suplicant.conf file directly in the etc/wpa_suplicant directory to get it to connect to WiFi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.