Okay I was able to solve it finally. Here are reasons and directions of how to solve it.
The above situation is due to preinstalled Windows 10 in UEFI mode and Ubuntu installed in LEGACY Mode.
SOLUTION TO WHOLE PROCESS:
1.0: Press F2 on boot and change RAID ON to ACHI and in boot menu disable secure mode.
- Make a UEFI only USB by formatting usb as FAT32 and copy paste the contents from Ubuntu.iso to that usb.
- Now press F2 to go to setup and manually add an entry to grub.efi
- Keep the manual entry on top so that the computer boots from this option
- Reboot the computer and you will be on the grub screen.
- Now on install option press e to edit and add the option for nomodeset or the desktop will freeze in Alienware because of NVIDIA graphics card.
- Now press enter and the installation will start.
- When you go to disk partition, select something else option
- Now select the unallocated space and make swap partition double the amount of ram.
- Now assign the remaining partition to /
- At the bottom on the same screen install the boot loader into the same / partition.
- Reboot and after installation select try ubuntu and perform step 5.
- When you get the desktop.
- Open terminal and install boot-repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
- Folow the steps and you will get both windows and ubuntu options in the grub.
Note: If you get the boot-repair is not in UEFI Mode screen in boot-repair app then it means you havent done step 2 properly. Thats the reason we made UEFI only usb to make sure that we are not in ACHI mode but in UEFI mode.
I have written the above steps from memory so let me know if any problem and I will try to help.