Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

QEMU-libvirt UEFI VM? [Solved]

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

QEMU-libvirt UEFI VM? [Solved]

  • Quote

Post by eccerr0r » Mon Jul 17, 2017 8:09 am

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...
Last edited by eccerr0r on Tue Jul 18, 2017 7:05 am, edited 1 time in total.
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Mon Jul 17, 2017 8:14 pm

Host machine does not matter. AFAIK you have to patch UEFI mode into qemu though.
It's been this way for a long time.
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Mon Jul 17, 2017 11:19 pm

Is it just a maintainer issue or is this due to licensing issues? Probably the latter?
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
mutiny
n00b
n00b
Posts: 20
Joined: Wed Aug 06, 2014 9:46 am

  • Quote

Post by mutiny » Tue Jul 18, 2017 4:45 am

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.
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Tue Jul 18, 2017 5:58 am

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 Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
Fitap
Guru
Guru
User avatar
Posts: 502
Joined: Sun Mar 13, 2011 4:20 pm
Location: Rosario, Argentina

  • Quote

Post by Fitap » Sat Jul 07, 2018 3:53 pm

Hi, did you see this link?

https://fedoraproject.org/wiki/Using_UEFI_with_QEMU

Regards.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic