Skip to content

Instantly share code, notes, and snippets.

@SwaySZ
Last active January 6, 2022 09:50
Show Gist options
  • Save SwaySZ/3ee4d549d779b1cbcad75e0478e75a44 to your computer and use it in GitHub Desktop.
Save SwaySZ/3ee4d549d779b1cbcad75e0478e75a44 to your computer and use it in GitHub Desktop.

Assuming that you already have Windows installed on your desktop, you want to install a Ubuntu from a hard disk (NTFS). Before following the instructions bellow, you have installed the bootloader GRUB2 (Search how to install GRUB2 on Windows).

What you need is to create a menuentry in GRUB2. 0. Check your disk partitions in grub: press c and ls to find your partitions.

  1. (If you have a older version of linux) Append the following menuentry into the file 40_custom at /etc/grub.d/
menuentry "Ubuntu 20.04 install" {
        insmod ntfs
        insmod iso9660
        rmmod tpm #bug for grub2.04, removing module tpm
        set root=(hd0,gpt3) #make sure you have the correct partition
        #set isofile="/opt/ubuntu-20.04.3-desktop-amd64.iso" #if you put the iso file in the linux partition
        set isofile="/Users/setup/Downloads/ubuntu-20.04.3-desktop-amd64.iso" #here we put the iso file at the folder Download
        loopback loop $isofile
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash nomodeset noprompt noeject toram --
        initrd (loop)/casper/initrd

}
  1. (If you have a older version of linux) Update the grub by sudo update-grub
  2. Reboot and then you will see the menuentry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment