Skip to content

Instantly share code, notes, and snippets.

@raulqf
Last active May 9, 2019 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulqf/7ac15872bb2e3b01c224b3dbdb81195d to your computer and use it in GitHub Desktop.
Save raulqf/7ac15872bb2e3b01c224b3dbdb81195d to your computer and use it in GitHub Desktop.
How to make a dualboot in windows to use a linux distribution.

How to install in windows 10 a linux distribution in dualboot

UEFI mode appearance has made more difficult the dualboot installation of linux in conjunction with windows. This gist is a brief guide to accomplish this goal.

It is assumed that Windows 10 has been installed. First steps before the linux installation is to disable the windows fast start, hibernation mode and hybrid sleep to avoid future problems. Windows fast start must be unchecked from the power options in the control panel under the section 'What power buttons do'. The hibernation must be disabled using a windows command prompt with admin privileges and typing:

*powercfg.exe /h off*

For further information about these configurations visist https://www.pugetsystems.com/labs/support-software/How-to-disable-Sleep-Mode-or-Hibernation-793/

Now, it is time to install linux (by the time of this gist I have used ubuntu 18.04). So, first you have to download ubuntu to create a live usb https://www.ubuntu.com/download/desktop. For the generation of the live usb there are several resources about how to achieve that. I recommend the use of Lili program to create the live usb from windows and the following website shows how to do it: https://linuxhint.com/bootable-linux-usb-linux-live-creator/.

With the live usb, we can proceed with the linux installation. Once connected the usb your pc must boot from the live usb. If it is not the case, you must configure the boot preference options in your bios. Again, there are several resources in the web. If you are able to launch the live usb, continue with the linux installation as always but do not reboot the pc after the installation has been completed and remeber the id of the partition where the linux root folder ('/') has been installed.

Once the linux has been installed do not reboot the pc and open a command prompt. We are going to copy the ubuntu boot loader in the windows partition to be able to launch the ubunut loader from windows. To achieve this you must type the following commands (1):

  $sudo su
  $mkdir /mnt/share
  $mount /dev/sda /mnt/share
  $dd if=/dev/sdb of=/mnt/share/ubuntu.bin bs=512 count=1

The disk partition /dev/sda used in the previous commands refers to the windows partiton that contains C: whereas /dev/sdb refers to the linux partition containing the root folder. You can check this information using sudo fdisk -l.

Now it is time to reboot to windows partition (remember to disconnect the live usb). In windows we must configure the ubuntu boot loader. So, we must open a command prompt with admin privileges and type the following commands(2):

  >bcdedit /d "Ubuntu" /application bootsector
  The entry <e353456352-t423-a343-d122-245kl42j545> was successfully created.
  >bcdedit /set <e353456352-t423-a343-d122-245kl42j545> device partition=c:
  >bcdedit /set <e353456352-t423-a343-d122-245kl42j545> path \ubuntu.bin
  >bcdedit /displayorder <e353456352-t423-a343-d122-245kl42j545> /addlast
  >bcdedit /timeout 10

And that's all. When you reboot a screen with Windows and Ubuntu partitions will appear as it was the grub.

This guide was extracted from XPSTECH youtube video https://www.youtube.com/watch?v=rPUVIc-W13s&t=740s

How to fix dualboot after windows creator update

** Important! Because of windows creator update I have found that windows removes this configuation. So, if some day you cannot boot into linux distribution and you only see a blinking underscore, you must repeat the above steps except from the linux installation. You only have to create the ubuntu.bin and configure windows. Commands block (1) & (2) **

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment