You bought a Raspberry Pi 5. You did not buy another monitor.
Why? Because you’re smart, cheap, or both. Now you want to VNC into it from your Mac.
Here’s the story. Short like Hemingway. Funny like Baratunde.


Step 1 – Turn on SSH

The Pi is shy. Give it a voice:

sudo raspi-config

Enable Interfacing Options → SSH. Now you can whisper commands from your Mac.


Step 2 – Install VNC

The Pi needs VNC glasses. Without them, it’s blind.

sudo apt update
sudo apt install realvnc-vnc-server realvnc-vnc-viewer -y

Step 3 – Enable VNC

Still blind. Time to put the glasses on.

sudo raspi-config

Enable Interfacing Options → VNC.


Step 4 – Create a Virtual Monitor

Without HDMI, your Pi sulks like a teenager.
We’ll give it an imaginary friend: a fake monitor.

sudo nano /etc/X11/xorg.conf.d/20-virtual.conf

Paste this in:

# Virtual display using Xorg dummy driver

Section "Device"
    Identifier "virtual"
    Driver "modesetting"
    Option "IgnoreEDID" "true"
EndSection

Section "Monitor"
    Identifier "virtual-monitor"
    HorizSync 28.0-80.0
    VertRefresh 48.0-75.0
EndSection

Section "Screen"
    Identifier "virtual-screen"
    Device "virtual"
    Monitor "virtual-monitor"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080"
    EndSubSection
EndSection

Now your Pi believes it’s got a screen. Imagination is powerful.


Step 5 – Restart the X Server

Check permissions first:

ls -l /dev/tty0

Then CPR for pixels:

sudo systemctl restart display-manager

If still cranky:

sudo service lightdm restart

Step 6 – Auto-Start X Server on Boot

You don’t want to type startx every morning. That’s for peasants.
Edit ~/.bash_profile or ~/.bashrc and add:

# Start X server if on tty1 and no DISPLAY set
if [ -z "$DISPLAY" ] && [ "$(tty)" == "/dev/tty1" ]; then
    startx
fi

Now your Pi wakes up ready to party.


Step 7 – Connect from macOS

On your Mac:

  1. Press Cmd + K in Finder.
  2. Enter:
    vnc://raspberrypi.local
    
    (or use the Pi’s IP).
  3. Log in with your Pi username + password.

You’re in. The Pi obeys. You rule.


Troubleshooting

Virtual Display Issues

Logs don’t lie:

cat /var/log/Xorg.1.log
cat ~/.local/share/xorg/Xorg.0.log

TTY0 Permission Issues

ls -l /dev/tty0
sudo systemctl restart display-manager

X Server Issues

If it’s extra grumpy:

sudo systemctl restart display-manager.service

Done

No extra monitor. No drama. Just VNC magic.
Your Raspberry Pi 5 now thinks it’s a desktop, but you know the truth.
Headless. Lean. Mean. SaaS machine.