1

I probably did something wrong during initial setup, but I've hit a rather strange problem trying to set up a graphical headless RPi 4B with Raspberry Pi OS Bookworm.

To set up my Pi, I downloaded Raspberry Pi OS Bookworm, and flashed it to an SD card like you usually would. To set a password for the pi user, I chrooted into the newly flashed (not yet booted) SD card's root partition (using the directions at https://unix.stackexchange.com/questions/41889/how-can-i-chroot-into-a-filesystem-with-a-different-architechture to allow me to chroot into the armhf system from my amd64 laptop). Then I ran passwd to set the password. I then dropped an empty file named ssh into the boot partition to enable SSH before first boot, then unmounted everything and booted up the Pi. I was then able to SSH into it shortly thereafter. I'm launching SSH using ssh -C -L 7890:localhost:7890 pi@raspberrypi.local since I want to be able to VNC into the Pi through an SSH tunnel.

From the SSH terminal, I installed OS updates, set a reasonable headless resolution, then rebooted. I also removed all RealVNC components (sudo apt purge realvnc-*) while I was at it since I intended to use wayvnc to get a graphical output.

After a bit of fumbling, I figured out I needed to complete the RPi first boot wizard in order to get to a fully functional graphical environment. After a bit more fumbling, I used the following to start wayvnc:

sudo su -
su rpi-first-boot-wizard
export XDG_RUNTIME_DIR=/run/user/112
WAYLAND_DISPLAY=wayland-1 wayvnc 127.0.0.1 7890

I was then able to run KRDC (my VNC client) on my laptop, connect to 127.0.0.1:7890, and I saw the first boot wizard displayed over VNC. So far, so good. I completed the wizard, and rebooted the Pi when prompted.

This is where things go wrong. After the reboot, I SSH'd back into the Pi, ran loginctl to see which user the display manager was running on (if any)... and rpi-first-boot-wizard was logged in. I did the above trick to VNC into the Pi again, and sure enough the first boot wizard was running again. I completed it a second time, rebooted, SSH'd in again, and once again the first boot wizard was running again.

Evidently something about how I've done things isn't doing what I expect it to. I'm also unable to SSH into the user account I attempted to make in the first boot wizard - only the pi account I set a password for before first boot is usable.

I don't see any interesting log output in journalctl, so I'm not sure what extra info I need to debug this. What exactly did I do wrong, and why is it not allowing the first boot wizard to finish? How can I get past the wizard? Do I need to start from scratch and set up the Pi differently?

(I'd also be interested in how to recover from the sticky situation I'm in now, but for now I'm far more interested in knowing what I did wrong and what the right way to do this is.)

ArrayBolt3
  • 119
  • 1
  • 2

1 Answers1

1

Follow the instructions in https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/.

There is NO default user and you can't ssh until it is created - even if you preconfigure.

If you want to preconfigure there are options to set user, ssh & networking but frankly it is easier to setup with a keyboard & monitor.

From where you are now it would be easier to start fresh. You can't run first-boot-wizard if logged in.


You can't skip the first-boot-wizard because there is no user until it is created (this is how most Linux OS work). You can setup with a serial link (but I have not tried).

Milliways
  • 62,573
  • 32
  • 113
  • 225