Bug ID | 989462 |
---|---|
Summary | Virt-Manager Unable to Create VM |
Classification | openSUSE |
Product | openSUSE Distribution |
Version | Leap 42.1 |
Hardware | aarch64 |
OS | openSUSE 42.1 |
Status | NEW |
Severity | Normal |
Priority | P5 - None |
Component | Virtualization:Tools |
Assignee | virt-bugs@suse.de |
Reporter | alan@softiron.co.uk |
QA Contact | qa-bugs@suse.de |
Found By | --- |
Blocker | --- |
I've had some trouble creating VM's with virt-manager and have identified what I think is the problem. I am able to work around it, but it requires editing the VM xml description manually with "virsh edit". The basic problem is that if you create a VM with virt-manager, it will not get the firmware line correct. What I think it's trying to generate (because I can't really verify it, because it fails) is: <os> <type arch='aarch64' machine='virt'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader> ... <boot dev='hd'/> </os> Note the use of "pflash" as the type. Indeed this is what the libvirt documentation says to do: https://libvirt.org/formatdomain.html#elementsOSBIOS "For instance, if the loader path points to an UEFI image, type should be pflash." However, if pflash is used here, starting the VM will fail with: "virt-manager Initialization of device cfi.pflash01 failed: failed to read the initial flash content" If the type is changed to "rom" (manually), the VM boots up as expected. Steps to reproduce: # Install prerequisites: zypper install virsh virt-install vm-install ca-certificates libvirt-daemon-driver-qemu qemu qemu-tools # Download the firmware Image: wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/1127/QEMU-AARCH64/RELEASE_GCC49/QEMU_EFI.fd # Install the firmware image and space for the variables: mkdir /usr/share/AAVMF cp QEMU_EFI.fd /usr/share/AAVMF/AAVMF_CODE.fd dd if=/dev/zero of=/usr/share/AAVMF/AAVMF_VARS.fd bs=16M count=1 # Download the OS Image wget http://download.opensuse.org/ports/aarch64/distribution/leap/42.1/appliances/openSUSE-Leap42.1-ARM-JeOS-devel-efi.aarch64.raw.xz # Convert the OS Image to qcow2 format for VM use: unxz openSUSE-Leap42.1*.xz qemu-img convert -f raw -O qcow2 openSUSE-Leap42.1*.raw leap.qcow2 qemu-img resize leap.qcow2 40G # Inspect the qcow2 image (see 40G) qemu-img info leap.qcow2 # Install qcow image: cp leap.qcow2 /var/lib/libvirt/images/ # Create and start the VM with virt-manager GUI: virt-manager File->New "Create new Virtual Machine" - Step 1 of 4 Select "Import Existing Disk Image" Archetecture Options: aarch64 virt Click "Forward" "Provide the existing Storage Path:" Click "Browse" Select leap.qcow2 Click "Select Volume" Choose OS Type: "Linux" "SUSE Enterprise 12 SP1" Click "Forward" "Choose Memory and CPU settings" RAM: 2048 (less than this will fail to load initrd!) CPU: 1 Click "Forward" "Ready to begin the Installation" Enter "sles12" as the name Click Finish "Begin Installation" Window click "Begin Installation" This will fail to create a VM, complaining about inability to find pflash, as described above. Click OK which will take you back to the "Begin Installation" Window. Click "Overview" on the left Change "Firmware" to "none" Click "Apply" Click "Begin Installation" This will Create and start a VM. It will not boot. To fix this, from the VM window Select: Virtual Machine -> Shutdown -> Force Off >From the Shell: virsh edit sles12 # sles12 is the name you entered above. Under the <os> tag, add the lines: <loader readonly='yes' type='rom'>/usr/share/AAVMF/AAVMF_CODE.fd</loader> <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/tmp/sles12VARS.fd</nvram> Close the editor (esc :wq) >From virt-manager: Select the VM Press "Open" Virtual Machine -> Run Observe the VM boot SUSE and run. Thanks for having a look at this and sorry about the verbosity, but I think it's all necessary to describe and characterize the problem. Alan.