Richard W.M. Jones
2016-Jul-09 07:20 UTC
[Libguestfs] IRC question about virt-builder ubuntu-* images
22:06 < adam12> rwmjones: If you're still around, just curious - any reason why the ubuntu14 image doesn't come with `dpkg-reconfigure openssh-server` already configured for firstboot? The reason is because I couldn't work out how to automate this in the preseed script. If you want to have a go, then see: https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.sh https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.preseed Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Guido Günther
2016-Jul-12 17:40 UTC
Re: [Libguestfs] IRC question about virt-builder ubuntu-* images
On Sat, Jul 09, 2016 at 08:20:27AM +0100, Richard W.M. Jones wrote:> > 22:06 < adam12> rwmjones: If you're still around, just curious - any reason why the ubuntu14 image doesn't come with `dpkg-reconfigure openssh-server` > already configured for firstboot? > > The reason is because I couldn't work out how to automate this in the > preseed script. If you want to have a go, then see: > > https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.sh > https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.preseeds.th. like d-i preseed/late_command string \ in-target dpkg-reconfigure openssh-server; If you need special vealues before hand there's debconf-set-selection Cheers, -- Guido> > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > virt-df lists disk usage of guests without needing to install any > software inside the virtual machine. Supports Linux and Windows. > http://people.redhat.com/~rjones/virt-df/ > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs >
Richard W.M. Jones
2016-Jul-12 18:23 UTC
Re: [Libguestfs] IRC question about virt-builder ubuntu-* images
On Tue, Jul 12, 2016 at 07:40:51PM +0200, Guido Günther wrote:> On Sat, Jul 09, 2016 at 08:20:27AM +0100, Richard W.M. Jones wrote: > > > > 22:06 < adam12> rwmjones: If you're still around, just curious - any reason why the ubuntu14 image doesn't come with `dpkg-reconfigure openssh-server` > > already configured for firstboot? > > > > The reason is because I couldn't work out how to automate this in the > > preseed script. If you want to have a go, then see: > > > > https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.sh > > https://github.com/libguestfs/libguestfs/blob/master/builder/website/ubuntu.preseed > > s.th. like > > d-i preseed/late_command string \ > in-target dpkg-reconfigure openssh-server; > > If you need special vealues before hand there's debconf-set-selectionThanks Guido (.. and long time, no see :-) I guess you noticed we are using your example for preseeding Debian images which was very helpful. The above preseed command works to run 'dpkg-reconfigure openssh-server'. I tested this by adding it to the debian.preseed file, recreating the debian-8 image and testing it again. Unfortunately that command creates SSH host keys in the template, which is not a good thing since virt-builder will duplicate the template multiple times and each copy will share the same key. But luckily we also run virt-sysprep on the template after creating it which deletes those host keys: http://libguestfs.org/virt-sysprep.1.html#ssh-hostkeys That resolves the above problem. But unluckily the Debian openssh package doesn't automatically recreate host keys when it starts up, as Fedora does, see the several sshd*.{service,target} files here: http://pkgs.fedoraproject.org/cgit/rpms/openssh.git/tree/ I think this is a bug or missing functionality in the Debian openssh package. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Apparently Analagous Threads
- IRC question about virt-builder ubuntu-* images
- Re: IRC question about virt-builder ubuntu-* images
- [PATCH 1/2] builder/templates/debian.preseed: enable serial console
- Re: preseeding files only on reinstall
- [PATCH] builder: templates: set "unassigned" hostname