VM Boots to UEFI Shell? Here's the Real Fix
Your VM keeps booting into a blue UEFI shell screen instead of Windows or Linux. Let me show you how to fix that in under 5 minutes.
I know that feeling. You power on a VM, walk away for coffee, come back, and there's a blue screen with Shell> staring at you. Your OS didn't load. The VM booted straight into the UEFI shell. Don't panic. This is fixable, and usually takes less than two minutes.
The Most Common Fix: Change the Boot Order
Nine times out of ten, the VM's firmware is set to boot from the wrong device. It's trying the UEFI shell first, instead of the hard disk where your OS lives. Here's how to fix that.
For Hyper-V (Windows Server 2016, 2019, 2022, or Windows 10/11 Pro)
- Shut down the VM if it's running. Right-click it in Hyper-V Manager and choose Settings.
- Go to Security on the left panel. You'll see a checkbox that says Enable Secure Boot. Uncheck it. Then click Apply.
After you apply, you'll see the Secure Boot option turn grey. - Now go to Firmware (or BIOS, depending on your Hyper-V version). You'll see a list of boot devices. The one at the top is the first boot device. Look for File entries like
EFI\BOOT\BOOTX64.EFIor\EFI\Microsoft\Boot\bootmgfw.efion the top. That's the UEFI shell. You need to move your hard drive (it says something like SCSI Disk Drive or IDE Drive) to the top of the list. - Click the hard drive entry, then use the Move Up button to put it first. Click Apply and then OK.
- Start the VM. It should now boot directly to the OS.
For VMware Workstation or vSphere
- Shut down the VM. Open the VM settings (right-click > Settings).
- Go to Options tab, then Boot Options.
- Look for Firmware type. If it says UEFI, change it to BIOS for older OS versions. For newer ones, keep UEFI but check Boot order.
- In Boot order, move the hard drive (like SCSI 0:0) above any CD/DVD drive or network boot.
- Click Save. Restart the VM.
For VirtualBox
- Shut down the VM. Select it, then click Settings.
- Go to System > Motherboard tab. Uncheck Enable EFI (special OSes only) if you don't need UEFI. Or leave it checked if you do, but then go to the Processor tab and make sure boot order has the hard disk first.
- Click OK. Start the VM.
Why Did This Happen?
The UEFI shell is basically a tiny command-line environment built into the VM's firmware. When the VM can't find a bootable OS on any of the devices it checks, it falls back to the shell. It's like a safety net. The shell just means "I don't know what else to boot."
Most common reasons your VM ended up in the shell:
- You created the VM with UEFI firmware but the OS was installed in legacy BIOS mode. The boot files don't match the firmware type.
- Someone (or a script) changed the boot order accidentally.
- The VM's virtual hard disk got detached or corrupted. Check that the VHDX or VMDK file still exists and is attached to the VM.
Less Common Variations
Missing Boot Partition
If you fixed the boot order and it still goes to the shell, the boot partition might be missing or corrupt. This happens a lot with cloned VMs or after a failed update. You'll need to rebuild the BCD (Boot Configuration Data).
From the UEFI shell, you can't really do much. You need a Windows installation ISO or a Linux live CD. Mount that ISO to the VM and boot from it. Then, at the repair screen, open Command Prompt (Shift+F10) and run:
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
This rebuilds the boot records. For Linux VMs, you'd chroot into the installed system and reinstall GRUB. That's more advanced, but the idea is the same.
Firmware Type Mismatch
Some hypervisors let you switch between UEFI and BIOS after the OS is installed. Don't do that. If you installed Windows with UEFI, keep UEFI. If you installed with BIOS, keep BIOS. Switching breaks the boot. The fix is to either reinstall the OS or convert the disk partition table from GPT to MBR (or vice versa) — that's advanced.
Prevention
Here's how to keep this from happening again:
- When you create a new VM, match the firmware type to the OS you plan to install. Windows 10/11 and Server 2016+ all want UEFI. Older Windows (7, Server 2008) want BIOS.
- After installing the OS, check the boot order once. Move the hard disk to the top. Make sure CD/DVD is disabled or below the hard disk.
- If you clone a VM, always verify the boot configuration afterward. Cloning can mess up the disk signatures or BCD.
- Keep a backup of the VM's configuration file (.vmx for VMware, .vmc or XML for Hyper-V). If something breaks, you can compare settings.
That's it. You should be back in business. If you tried all this and it still boots to the shell, the disk itself might be dead. Detach the virtual disk, attach it to another VM as a secondary drive, and see if you can access the files from there. If not, you're looking at a data recovery scenario.
Was this solution helpful?