Couldn't find hvm kernel for Ubuntu tree
Solution 1:
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
Solution 2:
Technically, you can use --location with an updated virt-install 1.5+ and args explained here from Cole Robinson. I tested it and it was true.
However getting a Ubuntu working with --location
in my opinion is a pain in the a$$. I finally got it working with the following --location
and full command:
virt-install -n ubuntuscrap -r 2048 --os-variant=ubuntu19 --location http://us.archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/ --disk /var/lib/libvirt/images/ubuntu20.img,size=10,device=disk,bus=virtio --graphics none -w bridge=br0,model=virtio --extra-args 'console=ttyS0,115200n8 serial' --force --debug
Make sure you explore the URL in --location
to get the proper release of Ubuntu you want. I'm sure you'll have some trial and error to do...
With a CentOS .iso
image I did not have this problem and used --location
and it worked fine.