Install Ubuntu Dual Window
Install Ubuntu Dual Window
First of all, I appreciate everyone's help in attempting to solve this issue. None of the answers worked
directly but they all helped me in finding a solution to the problem, so thank you.
Installing GRUB directly into the MBR of /dev/sda did not work because I believe Windows and Sony
did a very good job disguising how Windows actually boots on my machine. In the end I had to copy
the "grubx64.efi" file over the boot manager file for Windows. Here are the steps I took in order to do
this safely and efficiently. I will go through every step I took in installing Ubuntu incase anyone with
a similar issue needs a thorough answer.
If you feel like having a quicker install then don't check these boxes as you can always do these
steps later.
5. IMPORTANT: When you reach the menu that says "Allocate Drive Space" you want to click
the option that says "Something Else" because this is where we set up your partitions that you
prepared for in Step 1.
6. Create Partitions:
Create partition for the swap. Select the free space partition then click the plus button to the
lower left. Make the size equivalent to your RAM size, in my case it was 16GB (16384MB).
Select "Primary" for type of partition, "Beginning of space" for location and "swap" for use
as section. Note: The mount point option should disappear on selection of "swap". Click
"OK"
Create partition for all your files and root. This is the main partition where all your files and
programs will be located. Select the free space, click the plus button to the lower left. Make
the size equivalent to the remaining free space you have (the editor should do this
automatically). Select "Primary" for the partition type, "Beginning of this space" for the
location, "Ext4 journaling file system" for use as and lastly select "/" (root) for the mount
point. Click "OK"
NOTE: There should be no more "free space" remaining. If you have some left over make
sure that all of your partition sizes add up to the total number of MB you shrunk windows by
in Step 1.
IMPORTANT: When selecting the option for "Device for boot loader installation" you want
to select the same location as your "/boot" directory. Since this is an install on an ESP system,
your boot directory will be in the same location as the Windows Boot Manager.
In my case this was "/dev/sda3" but there should be a description saying "Windows Boot
Manager" or something of that sort so you know which device your ESP is on.
If there is no description in the installer, then open GParted and look in the Label section for
something describing a Windows Boot Manager, this is location you are looking for. Select
that device in the "Device for boot loader installation"
Now Click the "Install Now" button in the bottom right. THIS IS THE POINT OF NO
RETURN. ONLY CONTINUE IF YOU ARE SURE YOU HAVE SET EVERYTHING
CORRECTLY
When the installation is finished DO NOT CLICK RESTART. Please click the "Continue Trying
Ubuntu" link and continue to Step 7.
7. Close all open programs and windows.
NOTE: In this section replace "/dev/sda3" with the device you chose for boot loader
installation at the end of Step 6.
Open the Terminal and do the following while making sure to read carefully and TAKE YOUR
TIME.
We need to determine where your Windows Boot Manager file is located. It is most likely going
to be in the path of "/EFI/Microsoft/Boot/bootmgfw.efi", as was mine, but we need to make sure.
The only way I know how to do this is by updating grub and letting it tell us where it found the
boot manager. Do this by typing the following, remembering to replace "/dev/sda3" with the
device you installed your boot loader into:
cd EFI/Microsoft/Boot
Copy the normal Windows boot file to a backup and a new file we are calling "bootwin.efi" that
we will set Windows 7 to boot to inside GRUB:
cd /mnt/EFI
sudo cp ubuntu/grubx64.efi Microsoft/Boot/bootmgfw.efi
Change back to the main directory, unmount your boot loader device and reboot the computer.
Note that the command to unmount is called umount NOT unmount:
cd
sudo umount /dev/sda3
sudo reboot
8. After the the computer reboots it SHOULD boot into the GRUB menu.
NOTE: We are no longer using the Live CD or USB so make sure those are removed. If it does
not boot to GRUB then you have likely made a mistake somewhere along the road, or the file we
copied over ("bootmgfw.efi") is not actually the file called when Windows Boot Manager starts
up.
If you encounter this error I recommend downloading rEFInd to a bootable CD. Insert the
bootable CD and start your computer. rEFInd should be able to see all boot files and give
you options to boot. I recommend going through these options until you find one that boots
Windows normally. Note: The file being called on boot is under the option selection in
rEFInd. Use this as the file in which to copy over with "grubx64.efi"
9. Once you have loaded the GRUB menu please boot into Ubuntu.
Note: If all steps were performed correctly, selecting the Windows Boot Manager option should
bring you back to the GRUB menu. This is because we copied over the file to boot Windows Boot
Manager with the file to boot GRUB.
10. Now that we are back in Ubuntu, open the Terminal and type the following commands:
sudo -s
This allows us to make root level commands without having to type sudo every time. Now type
the following to find the file in which to add a Windows entry to:
cd /etc/grub.d
ls
This should give you a list of files. Look for one that looks like "XX_custom" where XX is a
number, probably a multiple of ten. In my case it was "40_custom". This is what the file should
look like:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
Type the following commands to add a menu entry for Windows (replacing "40_custom" with
your appropriate file name):
nano 40_custom
Add a menu entry below all the comments (represented with a #).
NOTE: Replace 'hd0,gpt3' with the appropriate hard drive and device that your boot loader
is on (this is the same location as where you installed your boot loader on during installation
where gpt3 represents sda3 for example). Also replace the line after "chainloader" with the
same location you determined your Windows boot file to be in.
Now type the following, making sure the filename at the end is the filename we created earlier by
copying "bootmgfw.efi". I named mine "bootwin.efi":