Ubuntu – Couldn’t find hvm kernel for Ubuntu tree

kvmvirtualization

This command:

virt-install   \
   --name bla  \
   --ram=1024  \
   --disk path=/home/me/libvirt/images/bla.qcow2,bus=virtio,size=10  \
   --location /home/me/Downloads/ubuntu-18.10-desktop-amd64.iso

Reports:

ERROR    Couldn't find hvm kernel for Ubuntu tree.

How can I fix this?

(Since there are many duplicate posts and answers with regard to this issue, I am answering it, too.)

Best Answer

Instead of using

 --location /home/me/Downloads/ubuntu-18.10-desktop-amd64.iso

use

 --cdrom /home/me/Downloads/ubuntu-18.10-desktop-amd64.iso

The difference is (from the man page):

-c CDROM , --cdrom=CDROM
File or device use as a virtual CD-ROM device for fully virtualized guests. It can
be path to an ISO image, or to a CDROM device. It can also be a URL from which to 
fetch/access a minimal boot ISO image. The URLs take the same format as described
for the "--location" argument. If a cdrom has been specified via the "--disk" 
option, and neither "--cdrom" nor any other install option is specified, the 
"--disk" cdrom is used as the install media.

-l LOCATION , --location=LOCATION
Distribution tree installation source. virt-install can recognize certain 
distribution trees and fetches a bootable kernel/initrd pair to launch the 
install. 

So the correct command in this case is:

virt-install   \
   --name bla  \
   --ram=1024  \
   --disk path=/home/me/libvirt/images/bla.qcow2,bus=virtio,size=10  \
   --cdrom /home/me/Downloads/ubuntu-18.10-desktop-amd64.iso
Related Question