enedil
Posts: 80
Joined: Sat Feb 21, 2015 4:22 pm
Location: Toruń, Poland
Contact: Website

Install base image onto SD card without monitor

Sun Aug 16, 2020 1:45 am

Hey, I'm planning on getting a RPI (the latest one specifically) and I thought of not buying microHDMI-HDMI cable. Is there some known method, so that I can build a Linux image (preferably Fedora, but at the end of the day, whatever) so that it

1) doesn't involve any installer, so the stuff I put onto the SD is a part of already installed system (I believe that's standard, but correct me if I'm wrong)
2) has the password for my WIFI network in the config
3) has sshd enabled

I'm a programmer, reverse engineer and overall long time Linux user, so I won't be scared if you tell me to do wizardry on my computer. If you know of any suitable method, please tell me, I'd be grateful. Also, if this isn't deemed as a beginner topic, please move it somewhere it is proper. Thanks :)
- What Can a Thoughtful Man Hope for Mankind on Earth, Given the Experience of the Past Million Years?
- Nothing.

Kurt Vonnegut, Cat's Cradle

dustnbone
Posts: 464
Joined: Tue Nov 05, 2019 2:49 am

Re: Install base image onto SD card without monitor

Sun Aug 16, 2020 2:05 am

You can write an image to an SD card with a PC, configure wifi and ssh with simple text files on it's boot partition, insert that into the Pi and boot it.

From there you can SSH in and install whatever packages/make whatever config changes you need to. If desired you can then create a new image from your install as a backup or to deploy to multiple Pis in future.

I have no idea what the status of Fedora on the Pi is, I personally use the Debian derivative (Raspberry Pi OS) that's developed by the Pi foundation.

User avatar
HawaiianPi
Posts: 6213
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Install base image onto SD card without monitor

Sun Aug 16, 2020 2:11 am

It definitely can be done with the official Raspberry Pi OS.

To enable SSH logins on a headless system you just need to create an empty file named ssh (or ssh.txt) on the small "boot" partition, which has a FAT32 file system (so you can even do that from a Windows or Mac OS PC).

To connect to a wireless network on first boot of a headless system, just create another file named wpa_supplicant.conf on that same boot partition with the following content.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
	ssid="WiFi SSID"
	psk="WPA/WPA2 passphrase"
}
Edit country=, ssid= and psk= with your information.

With those 2 files added to a freshly written RaspiOS card you can run a completely headless system. Further OS configuration can be done with the raspi-config utility (including enabling VNC remote desktop, assuming you are using Raspberry Pi OS with desktop or with desktop and recommended software).

I haven't tried Fedora, so I'm not sure if it has the same functionality.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

enedil
Posts: 80
Joined: Sat Feb 21, 2015 4:22 pm
Location: Toruń, Poland
Contact: Website

Re: Install base image onto SD card without monitor

Sun Aug 16, 2020 3:09 am

Oh, that's actually really easy, I was expecting uncompressing some LZMA images that need to be compressed later on. That means maybe I'll stick to Raspberry Pi OS. Thanks for the helpful info <3
- What Can a Thoughtful Man Hope for Mankind on Earth, Given the Experience of the Past Million Years?
- Nothing.

Kurt Vonnegut, Cat's Cradle

fruitoftheloom
Posts: 25717
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Install base image onto SD card without monitor

Sun Aug 16, 2020 6:42 am

enedil wrote:
Sun Aug 16, 2020 1:45 am
Hey, I'm planning on getting a RPI (the latest one specifically) and I thought of not buying microHDMI-HDMI cable. Is there some known method, so that I can build a Linux image (preferably Fedora, but at the end of the day, whatever) so that it

1) doesn't involve any installer, so the stuff I put onto the SD is a part of already installed system (I believe that's standard, but correct me if I'm wrong)
2) has the password for my WIFI network in the config
3) has sshd enabled

I'm a programmer, reverse engineer and overall long time Linux user, so I won't be scared if you tell me to do wizardry on my computer. If you know of any suitable method, please tell me, I'd be grateful. Also, if this isn't deemed as a beginner topic, please move it somewhere it is proper. Thanks :)

Raspberry Pi Operating System is fully supported by the Raspberry Pi Foundation / Trading:

https://www.raspberrypi.org/help/


Your query is answered in the comprehensive Help Section, which like this Forum is linked on the Raspberry Pi Website:

https://www.raspberrypi.org/documentati ... eadless.md

https://www.raspberrypi.org/documentati ... /README.md
The information is out there....you just have to let it in.

My other Linux machines are a ChromeBox & Intel CoreDuo Desktop

Return to “Beginners”