View previous topic :: View next topic |
Author |
Message |
Bladesy Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/685704479552073b512e78.jpg)
Joined: 04 Apr 2015 Posts: 113
|
Posted: Sat Oct 29, 2016 1:05 pm Post subject: QEMU and UEFI partition booting |
|
|
Hello all, I'm not sure if this is the right section for this, but I'm having trouble finding information about QEMU and UEFI.
I currently have a dual boot scenario with gentoo, windows and the efi partition on the same drive - both operating systems are booting UEFI.
The problem is, that I don't know how to boot windows from qemu when it boots as UEFI.
I believe that OVMF is needed to boot, and I'm able to use it for image files containing windows systems - but whenever I replace the image file with the location of my windows partition, it won't boot and returns to the yellow shell.
This is what I'm using at the minute to try and boot my windows partition:
Code: | #!/bin/bash
cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd /tmp/my_vars.fd
qemu-system-x86_64 \
-enable-kvm \
-m 2048 \
-cpu host,kvm=off \
-vga none \
-usb -usbdevice host:1017:0002 \
-device vfio-pci,host=01:00.0,multifunction=on \
-device vfio-pci,host=01:00.1 \
-drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
-drive if=pflash,format=raw,file=/tmp/my_vars.fd \
-device virtio-scsi-pci,id=scsi \
-drive file=/mnt/virt.iso,id=virtiocd,if=none,format=raw -device ide-cd,bus=ide.1,drive=virtiocd \
/dev/sda4
|
Note that /dev/sda4 is my windows partition, and /dev/sda1 is the efi parition, and /dev/sda5 is a 16M system reserved microsoft partition - but I'm not sure what it does.
What I'm thinking is that it isn't enough to just add the windows main partition, but I should add the efi and sys-reserved as well - but I'm not sure how to add them to QEMU. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
szatox Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 27 Aug 2013 Posts: 3493
|
Posted: Sun Oct 30, 2016 8:50 pm Post subject: |
|
|
I'm not quite sure whether qemu supports EFI mode mode by default or not. I know there is a patch for it, but it may not be included.
Also, since you seem to have windows installed in bare-metal fashion on that drive, you should provide the full drive to qemu. Let qemu look for a way to boot it, and then the OS installed on that drive to handle partitions. Being smart and providing only "necessary" partitions will strip some metadata (like partition table) making the whole thing unbootable - try this first, as it's much easier and faster to do than looking for patches ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|