| View previous topic :: View next topic |
| Author |
Message |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 9730 Location: almost Mile High in the USA
|
Posted: Mon Jul 17, 2017 8:09 am Post subject: QEMU-libvirt UEFI VM? [Solved] |
|
|
Is there a Gentoo sanctioned way of using libvirt to setup a QEMU VM that boots UEFI firmware, so I can experiment with efibootmgr on a VM?
My host machine does not support UEFI, though this theoretically shouldn't matter... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Last edited by eccerr0r on Tue Jul 18, 2017 7:05 am; edited 1 time in total |
|
| Back to top |
|
 |
szatox Advocate

Joined: 27 Aug 2013 Posts: 3245
|
Posted: Mon Jul 17, 2017 8:14 pm Post subject: |
|
|
Host machine does not matter. AFAIK you have to patch UEFI mode into qemu though.
It's been this way for a long time. |
|
| Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 9730 Location: almost Mile High in the USA
|
Posted: Mon Jul 17, 2017 11:19 pm Post subject: |
|
|
Is it just a maintainer issue or is this due to licensing issues? Probably the latter? _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
| Back to top |
|
 |
mutiny n00b

Joined: 06 Aug 2014 Posts: 16
|
Posted: Tue Jul 18, 2017 4:45 am Post subject: |
|
|
| Not sure what "Gentoo sanctioned" would imply, but isn't this what you can do with OVMF? It seems OVMF got its own ebuild in gentoo recently so you don't need to build from edk on your own. If you use virsh to edit a domain, you would have the OVMF binary in <loader type='pflash'>OVMF_CODE.fd</loader> under <os> I think. |
|
| Back to top |
|
 |
eccerr0r Watchman

Joined: 01 Jul 2004 Posts: 9730 Location: almost Mile High in the USA
|
Posted: Tue Jul 18, 2017 5:58 am Post subject: |
|
|
Ah, I see a lot of other distros want to install the ovmf firmware separately, did not know that it got added to portage recently. I'll have to try it then... For searchers it's sys-firmware/edk2-ovmf ...
Hopefully now I have a throwaway UEFI "machine" to play with now :D
---
Information for those interested for those using libvirt:
Apparently the UEFI firmware requires that you're using the Q35 emulated chipset instead of the 440FX. However the libvirt config file is kind of detailed so you can't easily switch from from 440FX to Q35, so it's easiest to create a new VM. Anyway:
# emerge sys-firmware/edk2-ovmf
# ln -s /usr/share/edk2-ovmf /usr/share/OVMF
# restart libvirtd
Now using virt-manager you can create a new virtual machine. Customize before install and there should be an option to switch to Q35 chipset, and also specify the uefi firmware.
Then just start the machine. Upon successful firmware start... this is what I'm stoked about: EFI-SHELL is built in the OVMF firmware! I wish more real hardware has it installed in firmware.
(or follow what Portage says):
Run via command line
$ qemu-system-x86_64 -drive file=/usr/share/edk2-ovmf/OVMF.fd,if=pflash,format=raw,unit=0,readonly=on ...
Or using libvirt:
* You can register the firmware for use in libvirt by adding to /etc/libvirt/qemu.conf:
* nvram = [
* "/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd"
* ] _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
| Back to top |
|
 |
Fitap Guru


Joined: 13 Mar 2011 Posts: 445 Location: Rosario, Argentina
|
|
| Back to top |
|
 |
|