I had a bare metal Ubuntu Server installation. I created a full disk image with dd and converted to qcow2.
qemu-img convert -O qcow2 full_disk.dd.img full_disk.qcow2
Then I have installed a fresh Ubuntu Server 22.04 on this machine. Later I wanted to import the disk with virt-install:
virt-install --name guest-host --memory 16384 --vcpus 4 --disk path=/var/lib/libvirt/images/full_disk.qcow2,format=qcow2 --os-variant ubuntu22.04 --network network=default --graphics none --import
After this a "console" starts with no output. qemu-system-x86 runs with 100% CPU (on a single core) almost indefinitely. I can connect with:
virsh --connect qemu:///system console guest-host
but still no output. (I can exit with Ctrl+])
virsh edit guest-host
contains:
<serial type='pty'>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
--extra-args="console=ttyS0"
argument is not accepted for imports.
ERROR Kernel arguments are only supported with location or kernel installs.
I tried to edit the grub.cfg
to use the serial output but I do not get any output.
I also tried to import to VirtualBox. There, it is stuck at "Booting from Local Disk...".
It is puzzling that it is using constant 100% of the CPU. At some point the VM should be idle. VirtualBox can't boot. I can't see if the VM is doing anything under KVM (since no output).
In order test on a graphical (virt-manager) environment, I tried the same steps on my notebook. Seems like I can't change the firmware and chipset settings.
Progress: in virt-manager
, there is an option to change configuration after selecting OS and the disk image. This allowed me to change the firmware (boot) to UEFI (there are a few options, among which /usr/share/OVMF/OVMF_CODE_4M.fd
worked and I was able to boot to the graphical output.
However, in virt-install
(in bash, no GUI) or virsh
I was not able to see or access the output. CPU usage isn't 100% anymore. There seems to be some activity. These are all good signs. There is an error:
error: no suitable video mode found.
. OS might still be booting. I am looking into the network modes to see if SSHD is starting.
Another option is to configure grub.cfg
for serial output.
Final: I accepted @algebra's answer. This really solved the booting issue. I was not able to get any output. I decided to install lightdm
and ubuntu-desktop
to get a desktop environment, where I was able to access the imported OSes. It also turns out that the network devices might be named differently. To get access, you can either edit /etc/netplan/...
(permanent) or manually activate the network device (something something up
but not permanent). Then you can discover the VM guests on the virtual network with nmap -sn <subnet>
. This way you can ssh to the VMs.
PS: I have deleted the older question because now I think that it isn't booting at all.