Debain 12, Virtualbox, and UEFI

Published on July 19, 2023 at 6:39 am by LEW

Introduction

I tried to install Debian 12 in Virtualbox in UEFI mode, and ran into a problem. That being I could not install it directly. I thought I must be doing something wrong, because the installer kept going to a gray screen. But after some research I have come to the conclusion that not may people have tried the above combination.

I spent the last several hours watching multiple videos on installing Debian 12 on Virtual box. And every single one I watched showed a legacy install. Which is understandable, as that is basically the default mode for Virtualbox.

The question that comes up in my mind is for how long? I remember when UEFI was almost unheard of. Now it is hard to find a new computer that does not support it. And in some cases new computers and operating systems no longer support legacy boot. In not to many more years, Legacy boot mode will be almost unheard of. So it needs to be addressed and supported in all cases.

An Interesting Problem

What I find unusual is that Debian 11 installed fine in Virtualbox in UEFI mode. Also Debian 12 installed fine in legacy mode. Something changed with the installer between Debian 11 and Debian 12, so Debian 12 will not install in Virtualbox in UEFI mode, but goes to a gray screen when the installer starts.

Let me state up front that this is not strictly a Debian problem. Debian 12 installs just fine on actual hardware that I have tried. Also, I have not tried it on any other hypervisors.

From my observations it seems to be a problem with starting the frame buffer (that is a display issue). It is interesting that the problem does not occur in Debian 11, and it does not seem to occur on actual hardware.

Now I probably would not have dnoticed this, except that I have been messing around with some UEFI configuration stuff so had a reason to try the install. So this is not a main line problem today. But the way thongs are going it could be in a few years

The Workaround

If you want to install Debian 12 on Virtualbox in UEFI mode, you need to start with the old stable, Debian 11.

  1. Install a minimal Debisan 11 system using UEFI in Virtualbox. No extra software at all.
  2. Edit the /etc/apt/sources.list file and replace Bullseye with Bookworm.
  3. Run apt update, followed by apt full-upgrade.
  4. Run apt autoremove.
  5. Finally reboot.

Note: I suggest using full-update when moving between versions, rather than just update. The full-update option causes apt to do some additional cleanup during package replacement. I also suggest running autoremove to de-installl some left over files, like the previous kernel.

Conclusion

I would like to stress again that this is not a main line problem, and unless there is a specific reason to do so, most of us will use legacy install in the Vortualbox hypervisor.

I would also state that I have had some problems with the Virtualbox graphics drivers in the past. And since the issue occurs after the frame buffer starts, this may be a Virtualbox problem.

Regardless it is not something I think anyone has to worry about in Debian 12. Of course that may change by the tiem Debian 13 rolls around.

Add New Comment

Your email address will not be published. Required fields are marked *