On Wed, Oct 19, 2016 at 12:45:19AM +0530, P J P wrote:
>   Hello,
> I created an Ubuntu 16.04 Xenial guest using virt-builder(1) with
>   # virt-builder ubuntu-16.04
>         -o /var/lib/libvirt/images/ubuntu-16.04.qcow2
>         --size 10G --format qcow2
>         --firstboot-command 'dpkg-reconfigure openssh-server'
>         --arch x86_64
> And imported it to libvirt with
>   # virt-install --import --name ubuntu-xenial --ram 2048
>         --disk path=/var/lib/libvirt/images/ubuntu-16.04.qcow2,format=qcow2
>         --os-variant fedora23
>         --graphics none
> These successfully create the Ubuntu guest and import it as well. But
>  - when I tried to access it using 'virsh console', it connects and shows a
>    blank screen. No interaction whatsoever.

Yes, this is a bug.

>  - When I tried to access it via ssh, it did not accept the root password that
>    virt-builder had displayed before exiting.

This might or might not be a bug, see below.

>  - I tried to reset root user password with virt-customize(1), but even that
>    did not help.

This might or might not be a bug, see below.


I was able to reproduce this myself:

  $ virt-builder ubuntu-16.04 --firstboot-command "dpkg-reconfigure 
openssh-server" --root-password password:123456

  $ qemu-system-x86_64 -nodefconfig -display none -machine accel=kvm:tcg -m 
2048 -boot c -drive file=ubuntu-16.04.img,format=raw,if=ide -netdev 
user,id=usernet,hostfwd=tcp: -device rtl8139,netdev=usernet 
-serial stdio

Observe that it boots without any console output.

In another window, try:

  $ ssh -v root@localhost -p 9000

SSH will hang during connection.

If you repeat the same tests as above, but using fedora-24, it works fine.

By looking at the Ubuntu disk image directly, I was able to see that:

- it boots

- it runs the firstboot command, successfully

- the ssh server does not see any connections

- it is unclear if the root password is being set correctly or not,
  because we never actually test that

So this Ubuntu template is all-round buggy, and possibly or possibly
not there is another bug with setting passwords (only affecting

Noted, and I'll try to have a look at this soon.

Also we don't regression test any of this (for any guest), which is
another bug.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.

Libguestfs mailing list

Reply via email to