VirtualBox: Guest suddenly boots only into UEFI Interactive Shell

Plausible fix:

  1. In UEFI Interactive Shell, enter the file system:

    fs0:
    
  2. Following up with creating this file:

    edit startup.nsh
    
  3. Enter this or similar line to it:

    \EFI\debian\grubx64.efi
    
  4. Press CTRL+S to save the file.

  5. Press ENTER to confirm the file name.

  6. Press CTRL+Q to exit the editor.

  7. Restart the Guest:

    reset
    

Important notes:

  1. For some reason you have only a few seconds to edit and save the file. If it takes you longer, then the guest may react with a significant delay. Or it may even freeze.

  2. Replace debian with your system's id, e.g. ubuntu. You may verify this by simply going into the \EFI\ directory and running ls.


Another way:

If you don't succeed, and supposing your guest is Linux type, I myself had to do it:

  1. Boot from live USB with any Linux.

  2. Mount the root file system.

  3. Create this file on the mounted file system, adjust the path to wherever you have mounted it:

    /boot/efi/startup.nsh
    
  4. Enter the above explained line to it.