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
- Virt-install version: 1.3.2
- Ubuntu 16.04 4.4.0-24-generic
- Link to the ISO image I downloaded to use (ubuntu mini iso)
@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.)
After reading the
--location
section in the man pages for virt-install, it looks like one should still be able to uselocation
to specify the path to an ISO image, it doesn't work for me. Luckily it gave some examples, of which there was this one listed for Ubuntu:Using that worked for me so to get it to install Ubuntu 14.04 all I did was change the
wily
totrusty
and Bob's your uncle! I wish that I could install from a local mini.iso but in the meantime this should work for me and others.I came across the same issue as of this days, some of the previous answers help me find the way to do it. The solution for me was found in the manual of virt-install about iso install, as I was using a net install iso it needed to specify additional kernel and initrd parameters indicating the path within the iso to find them. Thanks to the
--debug
option I found the code of the installer to understand better what was happening. So finally the provisioning line ended being something like this:The key here is the additional parameters on the location specifying
vmlinuz
as kernel andinitrd.img
. To find the path within the iso I've use it theisoinfo
command as follows:So I found them in the isolinux folder in this case. Additionally I've defined the disk for the cdrom device so I can access it while installing, but as in this case I was using the network repository I've defined the source as one of the mirrors for CentOS 7 through the text based installation menus. I guess that the source could be the full CD/DVD iso if is needed. Using location enables the extra-args so I can access it with text console for the whole installation process. Hope this helps to complete the answer to the original question.
The following worked for me installing Debian 10 from an Ubuntu 16.04 host system: