Showing posts with label qemu. Show all posts
Showing posts with label qemu. 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.

Tuesday, May 29, 2012

Booting Fedora using Qemu and EFI


La Locura!
Thanks Harald.
After reading accross Harald's blog post mentioned above, I tried to boot one of the recent Fedora 17 composes. Sadly Qemu refused to find the attached (emulated) CD drive, but passing my primary hda (as a snapshot) worked like a charm: Fedora 16 ran in qemu with an EFI bios (OVMF).

Thursday, February 23, 2012

Fedora 17 Alpha declared GOLD - Try the shell in qemu.

Robyn Bergeron announced: Fedora 17 Alpha release (RC4) was declared GOLD [Source].
This release ships Mesa with llvmpipe (and several other enhancements to allow software rendering), this way gnome-shell can actually be run in a non-accelerated graphics environment - like qemu is.

Just fetch - today or the 28th - an ISO of your flavor (live CDs come in GNOME, KDE, LXDE and XFCE) and run it with qemu:
$ sudo qemu-kvm -smp 2 -m 1024 -net user -net nic \
  -cdrom Fedora-17-Alpha-x86_64-Live-Desktop.iso
Sadly qemu's curl support is still broken, otherwise we could just run:
$ sudo qemu-kvm -smp 2 -m 1024 -net user -net nic \ 
  -cdrom "http://dl.fedoraproject.org/pub/alt/stage/\
17-Alpha.RC4/Live/x86_64/\
Fedora-17-Alpha-x86_64-Live-Desktop.iso"

Monday, September 26, 2011

qemu and backing images.




Cows cows cows

I always wondered but never really looked up how backing files can be used with qemu. I came back to this when stumbling across  the curl backend which brings http and ftp support to qemu and landed in fedora recently.
The idea is basically to use some master image accessed via http, e.g. residing in some object store, as a backing file for the actual image. This is a quite flexible setup. No need for iscsi or so.
Oh yes, the thing about a backing file is that all reads are happening on the backing file, until a block is written (also know as cow [copy on write]).

It turned out that the magic is happening while creating an image, not when running it:

$ qemu-img create -f qed -o backing_file=http://..../amaster.iso instance.qed 20G
$ sudo qemu-kvm -hda instance.qed

Sadly we can't test this on stock Fedora, as curl is enabled but currently broken in qemu. Maybe this ain't a bug at all or the bug is already fixed upstream (there are some fresh changes to curl), so this can be tested at some near point in the future.
It is also to note, that backing files also integrates well with libvirt.

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?