Set Ubuntu boot entry under Windows

Source: Internet
Author: User

The recent configuration of some experimental environments has resulted in multi-system management, not limited to virtual machines, through dual systems. In this way, the Windows8.1 Pro and Windows 10 were successfully installed, in the original text.

On this basis, further installation of Ubuntu16.04. In view of the fact that the optimization of the installation system is now more mature, the installation process is simpler or the data is sufficient, the main problem is to use the Windows-brought boot process to increase the boot to Ubuntu16.04.

Overwhelmed by the variety of debris articles and content on the Web, the information learned in this document, the rationale for initiating boot, and the solution to the problem (the solution is at the end of the article).

Find some useful information: WINDOWS8 stick in an introduction to the Windows boot process , about the Linux boot boot process linux boot process, modify the BCD configuration file bcdedit use guide and other , uefi boot parsing on UEFI issues, top issues in Ubuntu Forum.

  

1. Choice of boot Mode

There are two options for installing the boot:Linux under boot through Grub and booting with the boot from Windows.

  The former is simple and can be set up during Linux installation, the problem is that if Linux is only a secondary operating system under the current system, rather than the main use of systems, the boot process will be slower, and if the subsequent Linux system problems or deleted, Can affect the boot of other Windows systems, there are potential problems (of course, if you use Linux as the primary system, it is cost-effective to use its default boot).

The choice here is to boot the Linux system installed on the new partition through the Windows-brought launcher.

2. Introduction of guiding principle

The system boot mode under Windows varies with the version of the system, and the previously linked data is described in some way. Here the author's setting environment is Win8.1 Chinese version.

There are two main ways to boot your existing windows: Legacy + MBR and UEFI + GPT mode. The Legacy BIOS does not recognize GPT partitioned tabular format, so there is no legacybios+gpt combination, and the UEFI BIOS can recognize both MBR and GPT partitions, so the MBR and GPT disks can be used to start the operating system under UEFI. However, due to Microsoft limitations, using Windows Installer to install the operating system under UEFI can only install the system on GPT disks. The principle of its guidance is now introduced.

  

Noun Explanation:

Mbr:master boot record, master boot recording. The main component is to boot an operating system for loading.

Main boot sector: a sector that contains an MBR, typically referred to as an MBR, typically located in the first sector of a storage device. Contains the master boot record (446bytes), the Disk partition table (16BYTES*4), and the end flag (0X55AA). Quoted from Baidu Encyclopedia.

Active partition: is a computer system partition, boot operating system files are installed in this partition, Windows system is generally the default is the C drive.

  

After the computer is turned on, start the BIOS, start the BIOS self-test, through the self-test, the BIOS find the main boot record on the hard disk MBR.

WinXP:

Read and run the Master boot record (master boot record,mbr)-read into the boot sector of the active partition--NTLDR mount and initialize, convert system real mode to smooth mode, and run a mini file system driver ( Supports FAT and NTFS format)--NTLDR reads the boot. ini file, generates a power-on option based on its content, selects the boot system, and loads the loaded files for the selected system. From Baidu Encyclopedia and blog.

Win7:

Read the hard disk partition table in the MBR DPT--Look for the active partition, locate the boot record in the PBR-to-PBR search activity area of Boot manager bootmgr (equivalent to NTLDR in XP)-- Bootmgr find the BCD file in the Boot folder in the active partition (boot configuration data, equivalent to the boot. ini file in XP), display multiple operating system selections on the display based on the BCD file- According to the selected system to find the corresponding disk Windows\system32\winload.exe file, and give control to Winload.exe

Both systems are traditional legacy+mbr boot mode, the main flow is Legacy BIOS--Read the main boot sector--Find the active partition, and load the bootloader ntldr/bootmgr-- > generates a multi-system boot menu based on the profile BOOT.INI/BCD and loads the corresponding system based on the path stored in the selected system and configuration file. (The so-called chained load, the master boot record is to find the partition where the system resides, i.e. the active partition)

  

For UEFI start-up,the main process for UEFI+GPT is power-on self-test, scanning the storage device according to boot order, reading the FAT format of the EFI System partition--and executing the boot file (author is bootx64.efi)-- In this sector, load the Startup manager and read the configured BCD files--The selection of the operating system and the loading of the corresponding files.

Main Features:

1. No MBR read

2. Boot programs and configuration files required by the system boot are placed on the additional partition of the FAT-formatted disk.

3. The device imports the BCD file through the Bootmgfw.efi file in the above partition, the user selects the system, and the BCD file loads the system boot file Winload.efi (for Windows) according to its own configuration content.

  

With Linux's powerful file system operation, you can easily view the structure of your system's EFI partition. You can view it by mounting the EFI system partition to the specified folder.

Illustrated as the author Asus Notebook Win8.1 Chinese version of the EFI partition (or ESP partition, that is, EFI System Partition) file structure diagram

  

Analysis:

1.bootx64.efi is the default startup mode of the computer (specified in the BIOS). That is, the computer is always booting through the bootx64.efi. The bootx64.efi here is just a filename, and any valid EFI file can be changed to this name and used as a boot;

2.bootmgr.efi is the default startup mode for Windows. That is, Windows always boots through the bootmgr.efi. When Bootx64.efi points to bootmgr.efi (or in this case, the Bootx64.efi file is actually renamed by Bootmgr.efi), it launches the boot process for Windows and generates a boot Options menu from the BCD file;

3. Solution

For the above-mentioned boot process records, you can know whether the traditional legacy+mbr or UEFI+GPT format, the main process is to read the configuration file through a specific boot manager to generate a system selection interface, and after the selection of the system to the specific system files to load.

The solutions available online are:

1. Use Ubuntu Boot-repair to launch the repair, specifically visible ubuntu help. However, this method uses grub to boot the system.

2. Boot to Linux using the boot program that comes with Windows, and the associated boot information for Ubuntu is added to the configuration file stored in the EFI partition to boot through the Windows boot program. There are two main problems to be solved: Modifying the BCD configuration file under Win8.1 and obtaining the corresponding boot file path. after Windows NT, Windows provides its own tool bcdedit for boot-start Setup, and some of the instructions are described in the link to the beginning of the article. Or you can configure it directly from the graphical interface tool EASYBCD.

If you manually configure, you need to create a new boot boot entry, the corresponding boot file is located in the partition and path, boot description, etc. to set. This is the information of the author's dual system Win10.

  

For Linux, whether using EASYBCD or bcdedit, you need to establish a startup entry for the real-mode boot sector and give the appropriate boot file path. If you use EASYBCD, you can automatically generate a boot from the graphical interface. If you use Bcdedit, you will need to generate your own configuration file. With a USB flash drive installed with the Linux installer, choose to try Linux, find the device name that installs the Linux boot module, such as/DEV/SDA8, and use the DD command to get the required files.

DD If=/dev/sdax of=ubuntu.mbr bs=512 count=1//instruction reads data from the specified file/dev/sdax, reads 512 bytes, and outputs it to the Ubuntu.mbr file, resulting in a Linux-enabled MBR

Then place the file in the active partition of the default boot Windows system and use Bcdedit to set up the relevant information.

The above EASYBCD or Bcdedit way, the author has tried but did not succeed. personally think this should be the most in line with their own needs, but the reasons for failure is unknown, hope to get guidance.

3.ubuntu12.04 and subsequent versions introduce support for EFI mode, so you can install Ubuntu Boot program grub in the EFI partition of your device (the original system Win8.1 will be partitioned during installation and can be located in Disk Management). This will generate an Ubuntu-guided file in the EFI partition, allowing you to boot Ubuntu, the original post.

After I installed Ubuntu into the EFI partition, the contents of the directory changed, and the Ubuntu boot program was added under the EFI folder.

  

The problem with this approach is that Ubuntu and Windows use two different boot systems, which is actually equivalent to setting the default boot Bootx64.efi/grubx64.efi to boot the appropriate operating system. So that the two systems can not be mutually guided, can only set the boot sequence in the BIOS, select a system. This method is equivalent to installing the Linux boot boot in the EFI partition, which will result in a more boot file grubx64.efi. The different systems are booted by selecting the Grubx64.efi/bootx64.efi.

After the second method fails, the author chooses the third method and installs it successfully .

  

  

  

Set Ubuntu boot entry under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.