2

I am using a kick starter file to install a Centos 7 VM and the progress has nearly stalled without displaying any messages in the terminal. My kickstarter file is placed in /tmp/ks.cfg having the following contents:

install
lang en_GB.UTF-8
keyboard us
timezone Australia/Melbourne
auth --useshadow --enablemd5
selinux --disabled
firewall --disabled
eula --agreed
ignoredisk --only-use=sda
reboot

bootloader --location=mbr
zerombr
clearpart --all --initlabel
part swap --asprimary --fstype="swap" --size=1024
part /boot --fstype xfs --size=200
part pv.01 --size=1 --grow
volgroup rootvg01 pv.01
logvol / --fstype xfs --name=lv01 --vgname=rootvg01 --size=1 --grow
rootpw --iscrypted password

%packages --nobase --ignoremissing
@core
%end

The command that I'm using is as follows:

virt-install --name=centOS --ram=1024 --vcpus=1 --os-variant=rhel7 --disk 
path=/tmp/centOS-VM.img,size=4 --location=/tmp/iso-images-VM/CentOS-7-
x86_64-Minimal-1708.iso --initrd-inject=/tmp/ks.cfg --extra-args 
"ks=file:/tmp/ks.cfg console=ttyS0"

Soon after issuing the above, I get this:

WARNING  Graphics requested but DISPLAY is not set. Not running virt-viewer.
WARNING  No console to launch for the guest, defaulting to --wait -1

Starting install...
Retrieving file .treeinfo... |  354 B
00:00:00
Retrieving file vmlinuz...   | 5.6 MB
00:00:00
Retrieving file initrd.img...|  46 MB
00:00:00  
Domain installation still in progress. Waiting for installation to complete.

Beyond this nothing happens. Any idea what could be happening here?

3 Answers 3

3

Nothing appeared because you ran virt-install on a terminal which didn't have X display information available, thus it could not start virt-viewer to show the console of the virtual machine.

Eventually the VM's installation will finish and the VM will power off. At this point, virt-install will restart the VM and exit itself. You can also hit Ctrl+C to stop virt-install waiting. Since the VM is still running, the installation will continue, but the VM will remain powered off at the end, rather than rebooting into the newly installed system.

You can also use virt-manager on your local system to view the VM's console during installation, if virt-manager has permission to manage the remote hypervisor.

4

Very very very late to the party, but this was an issue for me so others get it now.

You can fix this issue with adding a --wait 0 command.

WARNING  No console to launch for the guest, defaulting to --wait -1 

--wait -1 will mean it will wait indefinitely for the installation to complete, so adding wait 0 it will just continue after the setup has completed

Also see the Manual entry below:

--wait WAIT
           Amount of time to wait (in minutes) for a VM to complete its install.  Without this
           option, virt-install will wait for the console to close (not necessarily indicating the
           guest has shutdown), or in the case of --noautoconsole, simply kick off the install and
           exit. Any negative value will make virt-install wait indefinitely, a value of 0 triggers
           the same results as noautoconsole. If the time limit is exceeded, virt-install simply
           exits, leaving the virtual machine in its current state.
1

As Michael Hampton's answer said, virt-install uses virt-viewer by default, that tries to show a graphical console and may not be always possible. In my case, after using text console as below, I found that it was waiting for some input. So, installation was not progressing.

virt-install --virt-type kvm --name buster-amd64 \
--location http://deb.debian.org/debian/dists/buster/main/installer-amd64/ \
--os-variant debian10 \
--disk size=10 --memory 1000 \
--graphics none \
--console pty,target_type=serial \
--extra-args "console=ttyS0"

Found the text console method in Debian wiki page for KVM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .