Black screen after installing Ubuntu 20.04 on 2010 iMac 21.5"
I followed the guide on lifewire How to Install and Dual-Boot Linux and macOS
to dual-boot a 2010 iMac running High Sierra & ATI Radeon HD4670 and suffered the common 'black screen' issue when first attempting to boot the live USB flash drive into Ubuntu. Wait long enough and the start-up sound happens, so the system is booting - presumably a display issue. I found quite a few questions about this on various forums, one of which got me as far as being able to install Ubuntu but now when I boot, the screen goes black as before.
What I did:
stage 1 - overcome the black screen issue when booting into Ubuntu from the flash memory:
Boot up the iMac into macOS, open the flash drive in 'Finder' and edit boot/grub/grub.cfg to add 'nomodeset' and 'radeon.modeset=0' as follows:
menuentry "Ubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed maybe-ubiquity
quiet splash nomodeset radeon.modeset=0 ---
initrd /casper/initrd
}
menuentry "Ubuntu (safe graphics)" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash nomodeset radeon.modeset=0 ---
initrd /casper/initrd
}
Save the edited file and close it.
Restart the iMac and select the USB flash drive from the rEFInd boot menu (EFI/BOOT/grubx64.efi from your drive name).
This got me running the live USB flash drive Ubuntu session and able to install Ubuntu onto the newly-created partition on my hard drive.
As stated above, booting into this new install gave me the same black screen issue.
Stage 2 - sort out the black screen on installed Ubuntu boot:
- Re-insert the live USB flash drive.
- Boot into Ubuntu from that (rEFInd entry is 'EFI/BOOT/grubx64.efi from your drive name').
- Mount the hard drive Ubuntu partition (via 'files' / '+ Other Locations' and (in my case) '/dev/sda3' - use 'Disks' to identify which HDD partition to mount.
- Open a terminal session
- Type 'df -h' to find where the /dev/sda3 partition is mounted.
- Change the working directory to mountpoint/boot/grub and locate grub.cfg
- Copy the grub.cfg file (just in case): 'sudo cp grub.cfg grub.cfg.old'
- I know the first lines of the grub.cfg file say 'don't edit', but in this case you DO need to do so as you need to be able to boot using the edited grub file so you can do an 'update-grub'. So, edit grub.cfg 'sudo nano grub/cfg' to add 'nomodeset' and 'radeon.modeset=0' after the 'quiet splash' parameter to all lines starting with 'linux' in the 'menu entry' section.
- Save the edit.
- Navigate to mountpoint/etc/default and edit 'grub' so the line 'GRUB_CMDLINE_LINUX_DEFAULT' looks like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset radeon.modeset=0"
- Save the file and reboot.
- Remove the USB stick when prompted.
- Choose the 'EFI/ubuntu/grubx64.efi from EFI' option from the rEFInd menu - you should find the Mac boots into Ubuntu as normal (it did with me).
- The last step is to do a 'sudo update-grub' to update grub.cfg with the changes made above.
- Note - you could probably do the above to the install copy on the USB flash drive and save you the bother of booting the machine several times. I didn't do it that way of course, so I haven't checked whether there are any pitfalls.