Man, this has got to be an FAQ.

I'm merrily scripting buildbot setup inside a container, and tried to do
  sudo lxc-start -n foo  sh my-existing-setup-script.sh
where my-existing-setup-script.sh does, among other things,
  sudo apt-get install python-dev
(or, if the guest is running centos, some yum thing).

The first problem: apt-get hangs when it prompts the user for input.
I worked around that by adding -y, but then found that the network
is not up;
  sudo lxc-start -n foo -- ifconfig -a
shows no IP addresses.

So... I guess I have to actually start the system to run my
script inside the container.  I could use ssh to execute the
command... but there's no easy way to find out what IP
address to ssh to.  lxc-start doesn't make the host show up
in dns or the hosts file (should it?).

I see lxc-start-ephemeral has about 70 lines of script to do
just this: get the ip, wait for ssh to come up, and run a command
via ssh.

Is my easiest path to steal that code from lxc-start-ephemeral
and create a command lxc-ssh that ssh's into a container given
its name?  Or does something like this already exist?

I see
http://www.stgraber.org/2012/07/17/easily-ssh-to-your-containers-and-vms-on-ubuntu-12-04-lts/
which claims to make ssh'ing in easy, but it solves a different problem.

https://dev.launchpad.net/Running/LXC seems to indicate that
the way to do this is install avahi-daemon inside the container, but I'd
like to avoid relying on avahi.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to