Can't Install Ubuntu 20.04 KVM Guest

5,151

the --location makes virt-install to do some assumptions on the path of the kernel/initrd under these URLs. Failing to find these is the error you hit.

The easiest way out that I'd like to re-iterate is that for VMs using cloud images is so much faster and easier than ISOs. I see that you use some kickstart files, that (and more) customization would in this scenario be done via cloud-init a great example can be found here at "using cloud-init with multipass". There also is uvtool-libvirt to achieve the same, but multipass is more in focus at the moment.

To stick to virt-install in general you can use the --cdrom parameter instead which will only need the path to the .iso and makes no assumptions on further paths. Unfortunately using --cdrom will boot it as done on the iso and ignore your custom commandline arguments which in your case you need to the kickstart file.

In the meantime the paths in the installer trees are still good (albeit hard to find) and you can run (works the same for bionic and others):

$ virt-install --location http://us.archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/ --extra-args "ks=http://pastebin.com/raw/WxQygWpm"

Although do note that it will tell you the following and you should consider to adapt for the future:

WARNING Using legacy d-i based installer, that has been deprecated and will be removed in the future.

In any case - if the automatism of --cdrom or --location break for you again down the road (aside from the usually better use of cloud-images mentioned above) you can always use --kernel´ and--initrd` instead to point directly to them and it will work.

More discussions around the topic are at this bug

Share:
5,151

Related videos on Youtube

Programster
Author by

Programster

Updated on September 18, 2022

Comments

  • Programster
    Programster over 1 year

    I am trying to install Ubuntu 20.04 in the same manner I install all my other KVM guests, by specifying a web location to install from. It appears that no matter what web address I put in for the location parameter, I will always get the following error:

    ERROR Error validating install location: Could not find an installable distribution at 'http://us.archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ubuntu-installer/amd64/'

    An example of my commands are:

    qemu-img create \
      -f qcow2 \
      -o preallocation=metadata,lazy_refcounts=on \
      /home/stuart/KVM-Command-Generator/vms/ubuntu-20/ubuntu-20.qcow2 15G
    
    virt-install --connect qemu:///system  \
      --nographics \
      --os-type linux \
      --accelerate \
      --hvm \
      --network network=default,model=virtio \
      --name ubuntu-20 \
      --location http://us.archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ubuntu-installer/amd64/ \
      --extra-args "console=ttyS0 ks=http://pastebin.com/raw/WxQygWpm" \
      --disk /home/stuart/KVM-Command-Generator/vms/ubuntu-20/ubuntu-20.qcow2,bus=virtio,format=qcow2 \
      --ram 1024 \
      --vcpus 2
    

    ... but I have tried lots of different paths around the web, and also tried specifying iso images directly. Does anybody have an example that works or know how I can fix this?

    Context

    I tried doing this on both Debian 9 and Debian 10 KVM hosts with the same result.

  • Programster
    Programster almost 4 years
    I must have been living in a cave for a year or more because all of this "cloud images" and multipass was completely new to me. For anybody else out there who this is completely new for, I found this post from the Urban penguin explained and showed me everything I needed from scratch: theurbanpenguin.com/using-cloud-images-in-kvm Yes, this does seem like a much better and faster way to do things.