libvirt: can't install OpenSSH using vmbuilder.

Jarl Friis jarl at gavia.dk
Thu Jun 25 08:07:19 UTC 2009


Nick Barcet <nick.barcet at canonical.com> writes:

> On 06/24/2009 02:57 PM, Jarl Friis wrote:
>> I use Jaunty, and is now trying to build a JeOS virtual server.
>> 
>> I have followed the instructions on:
>> https://help.ubuntu.com/9.04/serverguide/C/jeos-and-vmbuilder.html
>> 
>> and created a boot.sh.
>> 
>> Yet after booting the new VM openSSH is not installed.
>>
>> If I use virt-viewer to see what is happening. There are lots of
>> messages about can't resolve ubuntu.com
>>
>> I have configured brdige networking and th VM gets it's IP from a DHCP
>> server.
>
> It sounds like the IP configuration might be good, but not the domain
> name resolving part.  I would first check this, as well as if your
> /etc/apt/sources.list contains valid information (it might be pointing
> to an invalid mirror as a consequence of using the --mirror option, in
> which case --install-mirror could be better).

Well I forgot to say, that when the system is done booting, and I
log-in everything seems normal, and I can do a apt-get update without
problems, so it seems like after some time (the time it takes me to
ligin) everything is OK.

>> The problem might be that the VM have not yet configured the network
>> at the time the boot.sh script is executed. Any other ideas?
>
> I can confirm that networking is up when boot.sh is invoked, as I have
> used this method previously with success.

I cannot confirm that network is in place when boot.sh is executed:
When create a JeOS with 


I have confirmed that ifconfig actually shows that an IP address is
assigned at the time boot.sh is executed. However when I have a
boot.sh that contains
apt-get update >> /var/aptget_update.out 2>> /var/aptget_update.err

then aptget_update.out contains:
Err http://dk.archive.ubuntu.com jaunty Release.gpg
  Could not resolve 'dk.archive.ubuntu.com'
Err http://dk.archive.ubuntu.com jaunty-updates Release.gpg
  Could not resolve 'dk.archive.ubuntu.com'
Err http://security.ubuntu.com jaunty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Reading package lists...

and aptget_update.err contains:
W: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/jaunty/Release.gpg  Could not resolve 'dk.archive.ubuntu.com'

W: Failed to fetch http://dk.archive.ubuntu.com/ubuntu/dists/jaunty-updates/Release.gpg  Could not resolve 'dk.archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jaunty-security/Release.gpg  Could not resolve 'security.ubuntu.com'

W: Some index files failed to download, they have been ignored, or old ones used instead.
W: You may want to run apt-get update to correct these problems

But If I have a boot.sh that contains:

nslookup dk.archive.ubuntu.com >> /var/nslookup1.out 2>> /var/nslookup1.err
apt-get update >> /var/aptget_update.out 2>> /var/aptget_update.err

No problems are seen in any of the output files.

But using a boot.sh with
ifconfig >> /var/ifconfig.out 2>> /var/ifconfig.err
apt-get update >> /var/aptget_update.out 2>> /var/aptget_update.err
is apparantly not enough for the apt-get to succeed.

Any hints?

I do have a workaround (introducing a sleep 1 in start of boot.sh),
but I would like an explanation and solution. My biggest concern
however is that following the official documentation:
https://help.ubuntu.com/9.04/serverguide/C/jeos-and-vmbuilder.html
does not work out of the box.

For now I have create a bug:
https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/391980

Jarl





More information about the ubuntu-server mailing list