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
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
+-- 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
+-- On Wed, 19 Oct 2016, P J P wrote --+ | 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. Finally I got into this Ubuntu VM by copying ssh public key with --ssh-inject. God bless --ssh-inject and rwmjones for providing it. :) Once 'console=ttyS0,9600n8' was added to the kernel parameter list, it is working well with the virsh console. Kernel command line also had two parameters 'splash' and Ubuntu specific 'vt_handoff' -> https://help.ubuntu.com/community/vt.handoff, Maybe guest could do without them. Thank you. -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
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
+-- On Thu, 20 Oct 2016, Richard W.M. Jones wrote --+ | See the workarounds for Debian 8 & Ubuntu 16.04 here: | https://www.redhat.com/archives/libguestfs/2016-October/msg00099.html Great! Thank you so much! | I tested password changing and that's working fine. Working fine without any changes? Strange, it didn't for me for both Debian and Ubuntu images. Thank you. -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
On Fri, Oct 21, 2016 at 12:59:45PM +0530, P J P wrote:
+-- On Thu, 20 Oct 2016, Richard W.M. Jones wrote --+ | See the workarounds for Debian 8 & Ubuntu 16.04 here: | https://www.redhat.com/archives/libguestfs/2016-October/msg00099.html
Great! Thank you so much!
| I tested password changing and that's working fine.
Working fine without any changes? Strange, it didn't for me for both Debian and Ubuntu images.
I added a regression test which tests password changing: https://github.com/libguestfs/libguestfs/commit/2f57eb181f5083c131c59da9c71d... If you have a reproducible case where password changing does not work for you, then let us know. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
+-- On Fri, 21 Oct 2016, Richard W.M. Jones wrote --+ | I added a regression test which tests password changing: | https://github.com/libguestfs/libguestfs/commit/2f57eb181f5083c131c59da9c71d... Okay, cool. | If you have a reproducible case where password changing does not work for | you, then let us know. It was on the beaker machine, not anymore. Thank you. -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
participants (2)
-
P J P -
Richard W.M. Jones