A script to add USB Ethernet Gadget configuration as well as other Quality of Life changes to a standard Raspbian SD Card image. This should work with RaspberryPi Zero 2 W, 4 and 5. RaspberryPi Zero (not 2) variants are not currently supported.
Currently only tested on Linux, but should also run on OSx and with Docker Desktop + WSL on Windows 10
Based on the great work of Ben Hardill - https://github.com/hardillb/rpi-gadget-image-creator
- USB-C Power + Ethernet(DNS and DHCP powered) + Serial
- VSCode(Code-Server) via the web(Accessible only on the USB Ethernet interface) :
${HOSTNAME}
.local/code/ - Web-based VNC(Accessible only on the USB Ethernet interface) :
${HOSTNAME}
.local/vnc/ - RealVNC
- PiXEL Desktop
- Windows Automatic Driver Setup
- MTP functionality(consider it experimental): The home folders will appear on your host in a new removable drive.
- Docker
- expect
- curl
- qemu-utils
- parted
- Head over to the Actions page.
- Download the latest successful release.
- Extract the image from the downloaded file.
- Open RaspberryPi Imager
- Click
Choose OS
- Click on the last option in the list
Custom Image
- Select the extracted image in the pop-up file browser.
- Select the Storage Device to write to.
- Click on the Gear button and customise the settings(I highly recommend setting a new hostname and user)
- Go on ahead and write!
Note: If you're getting connection problems in either Windows or Linux during the first image boot, I recommend restarting the Pi, after the driver refresh phase, by unplugging it and replugging it, it should work then, if not, open a Ticket and I will see how I can help. Otherwise, have fun!
Clone the repo
git clone https://github.com/hardillb/rpi-gadget-image-creator.git
Run the script and enter the user details(You won't need to configure it with RaspberryPi Imager if you're building your own image.)
./setup.sh
Once complete you can write the image file to a SD Card with any of the usual tools e.g. dd
or balena-etch
.
You can find instructions on the Raspberry Pi website here