Setting UP RPI to Run Headless

What is Headless?

Headless is the term used when we run our RPI without a monitor or a keyboard. I like to setup and configure my RPI using a monitor at least for the first time only, but if we are hosting a server with no desktop GUI on a RPI, setting up headless is the way to go.

Please, refer to Raspberry Pi Foundation for information on how to setup RPI headless

My RPI does not boot without HDMI connected!

I have been there. We would like to remote into our RPIs headless via vnc or ssh..etc. However, we will face some hiccups along the way.

Modify Config.txt to resolves headless and vnc resolution:

We need to make minor modifications to the configuration file on our RPI to boot up without monitor. Moreover, we will stumble into resolution hiccups after making this modifications. Here is the resolution:

RPI running Raspberry Pi OS :

The following command to access the configuration text file.

sudo nano /boot/config.txt

headless

Let’s make the necessary modifications according to the below image.

To save the file:

  1. hold and click: CTRL-x
  2. type: y
  3. click: enter.

headless

RPI running Ubuntu:

The following command to access the configuration text file.

sudo nano /boot/firmware/config.txt

headless

The above process should allow the RPI to boot up without a monitor or keyboard. The resolution distortion should be resolved as well.

Update (6/8/2021):

I recently provisioned a new RPI-4 to run Ubuntu Desktop 21.04. I also followed the same steps above to run the RPI-4 without a monitor; however, the RPI-4 had not worked without a monitor. Therefore, I have done my research and the work around relies on the Config.txt file.

Let’s start by accessing the configuration text file using the following command on our terminal:

sudo nano /boot/firmware/config.txt

Then, we will perform the following:

1- Comment out dtoverlay=vc4-kms-v3d

2- Add the following:

    A. hdmi_force_hotplug=1
    B. framebuffer_width=1920
    C. framebuffer_height=1080

The Config.txt should like the image below:

headless

Finally, to save the file in the nano text editor:

  1. hold and click: CTRL-x
  2. type: y
  3. click: enter

Conclusion:

Now, we are able to run Ubuntu 20.04 on RPI-4 without a need for a monitor. To access the RPI-4 remotely, refer to my tutorial about RealVNC.