Dual boot opensuse 12.3 and Windows 8 on a UEFI box

If you search around the Internet, you may find many reports of problems with dual booting Windows and linux in a UEFI environment. There are a number of pitfalls, and I have stumbled over several of those.

The aim of this post is to explain how to do it and avoid the pitfalls. This is based on my own experience, with the UEFI BIOS for a Dell Inspiron 660 (BIOS version A05). Other UEFI systems may behave differently, though the suggestions that I give should work with most of them.

Preliminaries

You can only do this with a 64 bit install. It won’t work with a 32 bit install. You need to be able to boot the install media in UEFI mode. You might have to experiment with that.

For my install, I copied the install DVD iso to an 8G USB stick, using dd_rescue:

# dd_rescue openSUSE-12.3-DVD-x86_64.iso /dev/sdf

Note that when I plug in a USB on this system, it shows up as “/dev/sdf”. You will need to check the device on your system if you are using a USB to install. Other methods are available to copy to the USB - check the wiki. DO NOT run “isohybrid” on the iso file.

I can also boot to UEFI mode with the live 64bit KDE image (again written to USB). The DVD is supposed to boot into UEFI mode without difficulty.

On my system, to boot a USB or DVD, I hit F12 during the early stages of boot. This is typical for a Dell. That brings up a menu. My system is set to allow both UEFI and Legacy MBR boots. The menu lists both. I choose the boot media (the USB) in UEFI mode if I want to boot it for install.

Other computers have different ways of setting the boot device. You will need to experiment with that to find out how to do it on your system.

If Windows 8 fills your entire disk, then you can try shrinking that in the Windows disk management tool (part of Windows 8). In my case, that cut Windows down to about half its original size. Another possibility is to add a second physical disk, and I actually did that. If you add a second physical disk, you should use gpt partitioning on it. You can set that up with “parted” or “gdisk” from the live media.

Installing

For the most part, installing is the same as ever. But there are two places where you have to be careful. One of those in the partitioning, and the other is the boot setup. I’ll discuss those in separate sections below. The software selection (if you use the DVD) is the same as you have done in the past. The post-install steps are also similar to what you have done in the past.

The most important install step, is to be sure that you have booted the install media in UEFI mode. If you booted in MBR mode, you will see the familiar boot screen with various options. If you booted in UEFI mode, the boot screen is a bit simpler with fewer options. If you are using live media, there’s a second way to tell. In the live system, before you start the install, try:

$ su -
# efibootmgr

If you are in MBR mode, that will give an error. If you are in UEFI mode, that should provide information (probably about Windows booting).

Partitioning

The important step in partitioning, is to make sure that there is a partition assigned to be mounted as “/boot/efi”.

Your system will already have an EFI partition, setup for Windows. DO NOT USE the same EFI partition as Windows. If you added a second disk, then use the EFI partition that you should have created on the second disk. Otherwise, have the partitioner create a new EFI partition from free space, and use that. If you have created an EFI partition, then set it to be formatted. DO NOT format the EFI partition that Windows is using.

If you are creating an EFI partition, I suggest a size of 100M. On my box, the EFI partition that I created is using only 5M, but it is wise to allow some space for expansion. I actually allocated 500M for my EFI partition, but 100M should have ample spare space.

The reason for a separate EFI partition, is that Windows seems to have taken ownership of the EFI partition that it uses. If you try to reuse that, there is a risk that Windows will override your boot setup, and the system will only be able to boot Windows. By using a separate EFI partition, you avoid those risks.

Apart from the EFI partition (mounted at “/boot/efi”), the rest of partitioning is about as normal for other installs. If you plan to use an encrypted LVM, then you will need a separate “/boot” partition, and the installer will forget to tell you that.

Boot setup

The other place to be careful is in the boot setup. You get to that by clicking “Boot” on the installer screen.

The main thing to choose is which boot software to use. Make sure that you select “grub2-efi”. That should be the default, but some reports indicate that install from live media gets that wrong.

Once you have selected “grub2-efi”, there should be a second choice to configure for secure boot. I suggest that you check that box. Even if you do not plan to use secure boot, it does no harm to check that box.

Now that you have completed the partitioning and booting setup, you can proceed with the rest of the install.

Using in secure boot mode

If secure boot is enabled on your system, you might find it difficult to boot Windows. There will be an entry to boot Windows in the grub2-efi boot menu, but it probably won’t work. It will instead generate an odd error message. Personally, I think that’s a Microsoft bug, but the Microsoft people probably think it is a feature.

If I want to boot Windows on my box, there are two methods that work:

  1. I can hit the F12 key while booting. That brings up the boot menu from the UEFI BIOS, and there I can choose between Windows and opensuse.
  2. I can first boot to opensuse. Then, in a root command line, I can set the next boot to be from Windows.

For the second of those options, I use

# efibootmgr

which lists the boot options of the system. In my case it lists Windows as selection 0 and opensuse as selection 4.
I then type in

# efibootmgr -n 0

which specifies that the next boot should be from selection 0 which, for my system, will be Windows.

I then reboot the system, and it boots into windows.

Using with secure boot disabled

If secure boot is disabled, everything just works. The grub2-efi menu should have a choice for booting Windows, and it should work.

Learning the hard way

At one stage, I actually tried setting up my box sharing the EFI partition that Windows had created. And at first that seemed to work well. The grub2-efi menu had options to boot into opensuse and into Windows. I mostly used the opensuse entry, since that’s the system that I prefer.

I then tested booting into Windows. It worked very will. The system booted straight into Windows. Windows promptly changed the boot setup, and I lost the ability to boot into opensuse. There are many reports of similar problems that will turn up with a search. And that’s why I am advising that you do not try to share the Windows EFI partition.

Thanks for this information. I went through the steps but this did not work.

The initial install seemed to go smoothly, but on reboot to complete the setup, the system would not boot into linux. It only booted windows. I then deleted the windows efi and os partitions and attempted install again, but now no os is found at all.

My partitions are:

GPT fdisk (gdisk) version 0.8.5

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB

Number Start (sector) End (sector) Size Code Name
1 2048 534527 260.0 MiB FFFF EFI system partition
2 534528 3553279 1.4 GiB 2700 Basic data partition
3 3553280 4085759 260.0 MiB EF00 OpenSuSE EFI Partition
4 4085760 4347903 128.0 MiB 0C01 Microsoft reserved part
5 4347904 8546303 2.0 GiB 0700 OpenSuse Swap Partition
6 454043648 500117503 22.0 GiB 2700 Microsoft Recovery Part
7 8546304 60983295 25.0 GiB 0700 OpenSuSE Root partition
8 60983296 102928383 20.0 GiB 0700 OpenSuSE Home partition
9 102928384 454043647 167.4 GiB 0700 OpenSuSE Srv partition

I then went into rescue boot from install usb and found that the linux partition was not added to the boot list. So I manually added the partition and even set it as the next boot partition.

efibootmgr -c -g -d /dev/sda -p 3 -L “OpenSuSE 12.3” -w -l ‘\EFI\opensuse\grubx86.efi’
efibootmgr -n 6

efibootmgr

BootNext: 0006
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0006,0007
Boot0000* EFI USB Device (hp USB FLASH DRIVE)
Boot0001* EFI Network 0 for IPv6 (54-53-ED-1D-FE-62)
Boot0002* EFI Network 0 for IPv4 (54-53-ED-1D-FE-62)
Boot0003* EFI Network 0 for IPv4 (54-53-ED-1D-FE-62)
Boot0004* EFI Network 0 for IPv6 (54-53-ED-1D-FE-62)
Boot0005* EFI Network 0 for IPv4 (54-53-ED-1D-FE-62)
Boot0006* OpenSuSE 12.3

System does not find Linux OS still and booting into rescue again to check efi settings shows the OpenSuse entry is gone.

I previiously loaded the latest available BOIS update for the system before trying all this, so I think I’m either running into some yet uncovered bug in the bios, or opensuse 12.3 or the uefi is not allowing changes because of verification failures. There are no errors being reported when making the changes so I can’t tell which may be the case.

Have you run across this scenario or can you provide any suggestions.

Thanks

Correction to last post:

Line to add boot entry was actually:

efibootmgr -c -g -d /dev/sda -p 3 -L “OpenSuSE 12.3” -w -l ‘\EFI\opensuse\grubx64.efi’

I keep making the mistake.

Thanks

Work like a charm even for the windows boot.

Bought a new notebook this week :
ASUS R900VJ, 6Go, 1To SATA Drive, Windows 8, Bios American Megatrend ver:320, Bios UEFI, OnBoard intel graphic + card nvidia GT 365M.

1- Defrag disk and reboot as many times until defrag do nothing more,
2- shrink first windows 8 partition ( windows 8 OS ) to 60Go, remove the second windows partition of 600 Go ( for user data ) and create a 60 Go partition for linux. Temporaly formated NTFS Type
3- From windows 8, enter bios menu
— Boot
----- Disable Fast Boot
----- Enable Launch CSM
— Security
------ Disable Secure Boot
4- Reboot in uefi mode on Opensuse 12.3 install (iso on usb stick with uefi boot partition)
5- Make install
— remove mount point for windows uefi boot partition,
— with gparted
------ create 100 Mo UEFI partition of type FAT for suse with mount point /boot/efi,
------ Reformat existing 60 Go Linux partition to ext4 (which was created at step 2), add swap and other stuff.
------ Format only Linux stuff, leave untouched : windows 8, ASUS recovery windows system (hidden partition), ASUS restore windows image(hidden partition), Microsoft reserved partition (hidden partition).
— In the Boot Loader Settings
------ Verify that boot loader option is “GRUB2-EFI” : Yes it is
------ Select Enable Secure Boot
Finish install.
Reboot automatically in Linux
Automatic config done
Reboot
Login to see if all things are correct.
Reboot
Get the grub boot screen with :

  • Opensuse 12.3
  • Advance options for Opensuse 12.3
  • Windows boot manager (on /dev/sda1)

Return to the bios menu to see what is new :
— Boot option
------ Launch CSM : Enable
------ Boot option priorities
---------Option 1 : opensuse secure boot ( P0: disk 1 )
---------Option 2 : opensuse ( P0: disk 1 )
---------Option 3 : P2 : Slimtype DVD A
---------Option 4 : Windows boot manager ( P0 : disk 1 )
— Security
---------Secure Boot Control : Disable

Before suse install I9 had :
---------Option 1 : P2 : Slimtype DVD A
---------Option 2 : Windows boot manager ( P0 : disk 1

As said booting on windows 8 take a little more time.

[QUOTE=sfbarbee;bt861]Correction to last post:

Line to add boot entry was actually:

efibootmgr -c -g -d /dev/sda -p 3 -L “OpenSuSE 12.3” -w -l ‘\EFI\opensuse\grubx64.efi’

I keep making the mistake.

Thanks[/QUOTE]

Sorry. I didn’t see your comments until now. I was expecting to be notified of comments. I probably set something up wrong on that notification.

Is secure-boot enabled or not?
What kind of computer is this?

This computer is an ASUS notebook configured for europe market : ASUS R900VJ-yz125h.

American Megatrend ver:320, Bios UEFI whose name is : APTIO SETUP UTILITY
In the boot option there only 2 configurations option

  • FAST BOOT ( Normaly enabled by default )
  • Launch CSM ( Normaly disable by default )
    In the Security option
  • Secure Boot Control ( Normaly enabled by default )

So Following your recommendation

  • FAST BOOT is disabled.
  • Launch CSM is enabled.
  • Secure Boot Control is disabled.

Nothing more to say from my post.

I have reinstalled openSuse, but now with a separate efi partition as you wrote, but I still have the same problem: as soon as I start Windows, the next time I boot, I’m in a Windows-only situation :frowning:

the ‘efibootmgr -c -g -d’ etc. fixes this, till I go for another Windows session…

-> how could I fix this?

Windows 8 uefi (no secure boot)
OpenSuse 12.3
Sony Vaio

[QUOTE=franck_d;bt897]
-> how could I fix this?[/QUOTE]

Please start a discussion thread at opensuse forum (the install/boot forum there). In your opening post for the thread, indicate how you installed (the DVD, or with live media).

okay, it’s finally fixed :slight_smile:
I used an “app”… :rolleyes: where I could select the ‘device’ to boot and it keeps behaving well, even after a Windows session

[QUOTE=franck_d;bt902]okay, it’s finally fixed :slight_smile:
I used an “app”… :rolleyes: where I could select the ‘device’ to boot and it keeps behaving well, even after a Windows session[/QUOTE]

Great !
Can you tell us more ? I experienced the same problems on a Vaio laptop. The OpenSuse install succeed, even in secure boot mode, the grub2 bootloader works… until I start a Windows 8 session that erases it.

Which app did you use to select this device ?

Thanks

Cheers

[QUOTE=eaglesly;bt904]Great !
Can you tell us more ? I experienced the same problems on a Vaio laptop. The OpenSuse install succeed, even in secure boot mode, the grub2 bootloader works… until I start a Windows 8 session that erases it.[/QUOTE]

If you can start a forum thread on this problem, then I think we will be able to help. The forum is better for dialog than posting in blog comments.