Earlier I have tried to install Ubuntu along side with a pre installed windows 8 under UEFI mode , but after repairing the boots I lost both the windows 8 and Ubuntu ,Now I uninstall pre installed windows and set the UEFI and Legacy and Managed to Install Windows . Is there a special way to install Ubuntu on this way enabling dual boot without much configurations ? Thank you in advance
If you've installed Windows in BIOS/CSM/legacy mode, then you should be able to install Linux in BIOS/CSM/legacy mode just as you would on an older computer. The main caveat is that, if you used Windows to repartition the disk in MBR mode (rather than the GPT that it presumably used before), Windows will not have completely wiped the GPT data, and this will confuse the Ubuntu installer. To fix this problem, run my FixParts program on the disk. It will detect the stray GPT data and offer to wipe it out. You can run either the Windows version of FixParts or the Linux version from a live CD.
OTOH, if you've installed Windows in EFI/UEFI mode, you should read my page on Linux EFI-mode installations and the Ubuntu wiki on EFI. Between the two, you ought to be able to get it running, provided your firmware isn't one of the most badly broken ones.