Ubuntu – virt-install using location with iso image no longer working

kvmvirtualization

I have upgraded my OS to Ubuntu 16.04 and am trying to install an ubuntu 14.04 guest from scratch using my KVM management tool that I have been using successfully on Ubuntu 14.04 for some time now. Unfortunately, it looks like virt-install has changed and no longer accepts the --location parameter with an ISO image as it will output the following error:

Starting install...
ERROR    Could not find an installable distribution at '/home/programster/apps/KVM-Command-Generator/installation_media/Ubuntu_14.04.iso'

The location must be the root directory of an install tree.

However, if I nwo use the --cdrom parameter in place of --location it no longer likes the fact that I have an --extra-args parameter specifying the location of the kickstart/preseed file and that the console is to use ttyS0.

--extra-args "console=ttyS0 ks=http://pastebin.com/raw.php?i=SrTvbt6Z"

At this point, I tried going with just deleting the –extra-args parameter to install from the CD, but if you do this, you can't see any output in the CLI for the installation. I am guessing it wants you to connect via VNC or something which is not ideal.

For reference, the original installation commands were:

qemu-img create -f qcow2 -o preallocation=metadata,lazy_refcounts=on /home/programster/apps/KVM-Command-Generator/vms/ubuntu14.04.img 20G
virt-install --connect qemu:///system  \
--nographics \
--os-type linux \
--accelerate \
--hvm \
--network network=default,model=virtio \
--name ubuntu14.04 \
--os-variant=ubuntu14.04 \
--location /home/programster/apps/KVM-Command-Generator/installation_media/Ubuntu_14.04.iso \
--extra-args "console=ttyS0 ks=http://pastebin.com/raw.php?i=SrTvbt6Z" \
--disk /home/programster/apps/KVM-Command-Generator/vms/ubuntu14.04.img,bus=virtio,format=qcow2 \
--ram 512 \
--vcpus 2

And the new commands are:

qemu-img create -f qcow2 -o preallocation=metadata,lazy_refcounts=on /home/programster/apps/KVM-Command-Generator/vms/ubuntu14.04.img 20G
virt-install --connect qemu:///system  \
--nographics \
--os-type linux \
--accelerate \
--hvm \
--network network=default,model=virtio \
--name ubuntu14.04 \
--os-variant=ubuntu14.04 \
--cdrom /home/programster/apps/KVM-Command-Generator/installation_media/Ubuntu_14.04.iso \
--disk /home/programster/apps/KVM-Command-Generator/vms/ubuntu14.04.img,bus=virtio,format=qcow2 \
--ram 512 \
--vcpus 2

Question

How can I get virt-install to install from a local ISO image with the extra arguments to specify the location of the kickstart/preseed file, and allow me to see the progress and possibly choose options through the CLI rather than using VNC?

Perhaps I have to specify a web url instead of an ISO image to --location, but I would prefer it if I could pass a local location in case the internet is not that great.

Extra Info

Best Answer

@Programster - I reported this issue to the virt-manager maintainers on their mailing list. See http://www.redhat.com/archives/virt-tools-list/2016-August/msg00009.html. You can follow that thread for more details. Knowing that this worked in Ubuntu 14.04 and not in Ubuntu 16.04 was key to resolving the problem.

Bottom line, this is fixed now in the master branch of https://github.com/virt-manager/virt-manager.

The commit that fixed it is: https://github.com/virt-manager/virt-manager/commit/3f15a489cda87f8028828d567848193dd2640a43

I'm not sure when this will make it into the various virt-manager packages. But you can grab the source and run virt-install from there. (Note: you'll need to add some packages, and probably should create a Python virtual environment, so you might want to experiment on a VM before messing about with extra packages on a system you need to remain stable and clean.)

Related Question