alpine-make-vm-image icon indicating copy to clipboard operation
alpine-make-vm-image copied to clipboard

Image not booting in kvm

Open tuxpeople opened this issue 2 years ago • 1 comments

I tried to build a KVM qemu image, but it's not booting. Most probably, I did something wrong, but I'm unable to find it.

My environment:

[root@lab2 ~]# virsh --version
4.5.0
[root@lab2 ~]# qemu-img --version | head -1
qemu-img version 1.5.3, Copyright (c) 2004-2008 Fabrice Bellard
[root@lab2 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.9 (Maipo)

I use a GitHub workflow to build it, more or less the same as yours: https://github.com/tuxpeople/libvirt-alpine-playground/blob/master/.github/workflows/release.yml

I already tried it with your example files, but I'm also unable to boot it with them. But for the record, this are mine:

  • https://github.com/tuxpeople/libvirt-alpine-playground/blob/master/packages
  • https://github.com/tuxpeople/libvirt-alpine-playground/blob/master/repositories
  • https://github.com/tuxpeople/libvirt-alpine-playground/blob/master/configure.sh

I use this script to deploy it: https://github.com/tuxpeople/libvirt-alpine-playground/blob/master/labdeploy.sh

Basically, what I do is this:

  • download the image
  • make a copy for the vm
  • create the vm
wget ${IMG} -O /data/virt/images/alpine-playground.qcow2
qemu-img create -q -f qcow2 -F qcow2 -b /data/virt/images/alpine-playground.qcow2 $DISK
qemu-img resize $DISK $DISK_SIZE
virsh \
    pool-create-as \
    --name=${VMNAME} \
    --type=dir \
    --target=${VMDIR}/${VMNAME} \

virt-install \
    --import \
    --name=${VMNAME} \
    --memory=2048 \
    --vcpus=1 \
    --cpu=host \
    --disk=${VMNAME}.qcow2,bus=virtio \
    --network=bridge=bridge99,model=virtio \
    --os-variant=auto \
    --noautoconsole \
    --graphics=spice,port=-1,listen=localhost

When I connect to the console, nothing displays. Also no errors anywhere... Do you have an idea?

tuxpeople avatar Oct 03 '21 18:10 tuxpeople

I’d guess that the image boots fine, but the graphic redirection via SPICE protocol doesn’t work. Maybe it needs some support in the guest system? Unfortunately, I don’t have any experience with virt-install or SPICE, so I cannot help here.

jirutka avatar Jul 14 '22 19:07 jirutka