Showing posts with label kvm. Show all posts
Showing posts with label kvm. Show all posts

Thursday, April 4, 2013

Getting EFI (OVMF) into libvirt

OMG!

Finally it's working like a charm - booting a VM with EFI (instead of a BIOS).

lersek pointed me to a page describing how to test SecureBoot with Fedora this implies the usage of EFI. And that page contains a link to an rpm carrying the EFI payload. Awesome.

After installing the RPM you only need to tell libvirt to use that bootloader instead of the default one.

All you need to do:
# Install a prerequirement
$ sudo dnf install seavgabios-bin ipxe-roms ipxe-roms-qemu

# Install OVMF
$ sudo rpm -ivh http://fedorapeople.org/~crobinso/\
    secureboot/edk2.manual-0-0.20130221.944c84a6.x86_64.rpm

# Create a VM pointing to OVMF
$ sudo virt-install --name f18-uefi \
                    --ram 2048 \
                    --boot loader=/usr/share/edk2.manual/\
                                  ovmf-x64/OVMF-pure-efi.fd \
                    --disk f18-uefi.qcow,format=qcow2,size=10 \
                    --os-variant fedora18 \
                    --cdrom /path/to/Fedora-18-x86_64-DVD.iso

That's it! I'm truly amazed.

Btw.: oVirt Node can also be tested this way. Sadly it currently crashes under EFI.

Wednesday, May 30, 2012

Using oVirt Node with virt-manager


Untitled


Virtualization is already an ubiquitous technique.
Fedora provides packages for many of the Linux virtualization components through the yum virtualization group.
$ sudo yum groupinstall virtualization

Well, anyway - When doing virtualization you need a host, hosting your virtualized guests. If you don't want to do this on your local machine - because it hasn't got the capabilities, isn't beefy enough, ... - you can use oVirt Node as a hypervisor on a second machine which you can easily manage from Fedora using virt-manager.
This can be useful for a small working group or developers.

oVirt Node is based on Fedora and optimized to quickly get a hypervisor up an running. You actually do not need to care about all the constraints - networking, services, storage, ... - you need to consider if you setup a hypervisor yourself (which can also be done with  Fedora). It is also stripped down (~150MB) to preserve most of the RAM and storage space to the virtualized guests.

Anyhow:
  1. Download oVirt Node
  2. Install it on a machine with a recent Intel or AMD processor
  3. Log into the installed Node using admin and
    1. Configure a network interface
    2. Press F2 to drop to the console and run
    3. /usr/libexec/ovirt-config-password 
      1. set a root password
      2. enable SSH access
  4. Optional: ssh-copy-id your ssh key to node to allow a password-less login
  5. User virt-manager to create a new connection (File -> New Connection) to the installed Node (IP can be found on the Node's Status page)
    URI: qemu+ssh://$OVIRTNODE/system
($OVIRTNODE needs to replaced accordingly)
Actually oVirt Node is intended to be used with oVirt Engine, which can manage from one up to a couple of hundreds (?) of Nodes.
But the Engine setup itself is not as easy as just using virt-manager :)
At least - Engine would be the next step to get used to the oVirt components.

P.s.: You can use virsh vol-upload to get some data onto the node.

Friday, September 9, 2011

EFI + KVM?

To test out the EFI support of some distributions (especially Fedora), I tried to get qemu-kvm to use provide an EFI interface. This can be achieved by calling qemu with the -L switch, to use an alternate EFi bios file (like the one from tianocore: OVMF), instead of the default bios.

To get qemu-kvm up and running, try the following on a recent Fedora 15 setup:

mkdir efiboot

cd efiboot

# Get ovmf, a binary providing the efi interface
mkdir ovmf
cd ovmf
wget "http://downloads.sourceforge.net/project/edk2/OVMF/OVMF-X64-r11337-alpha.zip?r=http%3A%2F%2Fsourceforge.net%2Fapps%2Fmediawiki%2Ftianocore%2Findex.php%3Ftitle%3DOVMF&ts=1315395958&use_mirror=dfn"
unzip OVMF-X64-r11337-alpha.zip

cd ..

# Create a seperate folder with all relevant binaries and replace some of them
mkdir qemu
cd qemu
ln -s /usr/share/qemu/* .
ln -s ../ovmf/OVMF.fd efi.bin
ln -s ../ovmf/CirrusLogic5446.rom vgabios-cirrusefi.bin

cd ..

# Create an image and try the distribution in question ...
qemu-img create -f qed a.img 10G
qemu-kvm -L qemu/ -bios efi.bin -m 1024 -hda a.img \
   -cdrom ../Fedora-16-Alpha-x86_64-DVD.iso
# Expecting this to boot, but after the efi boot manager, the booting after grub (?) stalls ...


It turns out that Fedora won't boot on this qemu-kvm setup, instead Ubuntu worked like a charm - but someone already worked on this a couple of years ago.

The Fedora docs mention that the provided efidisk.img should boot on an EFI based system, but this also did not work as expected. Any hints?