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 [email protected] 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 7890

I was then able to run KRDC (my VNC client) on my laptop, connect to, 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.)

1 Answer 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).

  • "If you want to preconfigure there are options to set user, ssh & networking..." this stopped just short of the answer I need. Setting up with a keyboard and mouse is relatively difficult with my desk setup (can share details but don't think it would be useful to) and would far prefer to preconfigure even if it's more difficult from a technical perspective. If there's some way to just skip the first boot wizard entirely and configure everything by hand, that would be ideal.
    – ArrayBolt3
    Nov 27, 2023 at 6:26
  • I did preconfigure once (with Bullseye) and even then it took a few tries - it has since become harder. I can't explain because I haven't done it with Bookworm. If you really want to do this you will have to search. You asked "what I did wrong" and I explained some of the issues; my advice was to use a keyboard & monitor - which I do for 1st setup even though I don't run my Pi with them.
    – Milliways
    Nov 27, 2023 at 6:49
  • Thanks for your assistance! I ended up just uninstalling piwiz after reading forums.raspberrypi.com/viewtopic.php?t=231557, then I set the autologin user to pi (which I had already configured before first boot). Things seem to be working fine for me now - VNC works great, SSH works great, my camera works great, and nothing on the surface appears to be broken. If I remember I'll post a self-answer if this setup proves to be non-broken after some use.
    – ArrayBolt3
    Nov 27, 2023 at 7:01

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.