P J P
2016-Oct-18 19:15 UTC
[Libguestfs] virt-builder and Ubuntu 16.04 Xenial no access issue
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. - When I tried to access it via ssh, it did not accept the root password that virt-builder had displayed before exiting. - I tried to reset root user password with virt-customize(1), but even that did not help. In short, we have an Ubuntu guest that is not accessible anyhow. I've reserved a beaker machine and have installed Ubuntu guest as above. $ ssh root@ibm-x3550m4-7.gsslab.rdu2.redhat.com + r3dhatd0tc0m Please feel free to have a look at it. Thank you. -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
Richard W.M. Jones
2016-Oct-18 21:30 UTC
Re: [Libguestfs] virt-builder and Ubuntu 16.04 Xenial no access issue
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:127.0.0.1:9000-:22 -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 Ubuntu). 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. Rich. -- 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. http://libguestfs.org/virt-v2v
P J P
2016-Oct-19 06:40 UTC
Re: [Libguestfs] virt-builder and Ubuntu 16.04 Xenial no access issue
+-- On Tue, 18 Oct 2016, Richard W.M. Jones wrote --+ | 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:127.0.0.1:9000-:22 -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 | Ubuntu). I see. Thank you so much for these details. To follow-up on it, today I created a 'debian-8' guest on the same Beaker machine. It too had the same issue of not booting with a 'console' parameter. But saving grace was, it at least shows the grub screen. So I was able to add the 'console=ttyS0,9600n8' kernel parameter and after that it worked well with the console. Thank you so much! -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
Richard W.M. Jones
2016-Oct-20 13:11 UTC
Re: [Libguestfs] virt-builder and Ubuntu 16.04 Xenial no access issue
See the workarounds for Debian 8 & Ubuntu 16.04 here: https://www.redhat.com/archives/libguestfs/2016-October/msg00099.html I tested password changing and that's working fine. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Possibly Parallel Threads
- Re: virt-builder and Ubuntu 16.04 Xenial no access issue
- Re: virt-builder and Ubuntu 16.04 Xenial no access issue
- virt-builder and Ubuntu 16.04 Xenial no access issue
- Re: virt-builder and Ubuntu 16.04 Xenial no access issue
- Re: issue when building/making package from git