[Lxc-users] Ubuntu sshd template
Daniel Lezcano
daniel.lezcano at free.fr
Tue Feb 1 10:05:26 UTC 2011
On 02/01/2011 12:16 AM, Gary Ballantyne wrote:
> Hi
>
> Would greatly appreciate any help getting the sshd template working on
> my Ubuntu 9.1 host.
>
> I can ssh to and from the container and host when the container is
> generated by:
>
> lxc-execute -n foo2 -f /usr/share/doc/lxc/examples/lxc/lxc-veth-gb.conf
> /bin/bash
>
> Here I have slightly modified the example conf file:
>
> # Container with network virtualized using a pre-configured bridge named
> br0 and
> # veth pair virtual network devices
> lxc.utsname = gb1
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.ipv4 = 10.89.233.15/24
>
> Also, I can create a sshd template using "./lxc-sshd create" (ip =
> 10.89.233.13/24).
What version of lxc are you using ?
> However, the container doesn't appear to start (or, at least, persist)
> with the suggested command:
>
> # lxc-execute -n sshd /usr/sbin/sshd&
> [1] 7612
> # lxc-info -n sshd 'sshd' is STOPPED
> [1]+ Exit 139 lxc-execute -n sshd /usr/sbin/sshd
>
> But, I can start the container with:
>
> # lxc-start -n sshd&
> [1] 7623
> # lxc-info -n sshd
> 'sshd' is RUNNING
>
> And I can ping the container:
>
> root at haulashore1:/usr/share/doc/lxc/examples# ping 10.89.233.13
> PING 10.89.233.13 (10.89.233.13) 56(84) bytes of data.
> 64 bytes from 10.89.233.13: icmp_seq=1 ttl=64 time=9.81 ms
> 64 bytes from 10.89.233.13: icmp_seq=2 ttl=64 time=0.049 ms
>
> But, I can't ssh to the container:
>
> # ssh 10.89.233.13
> ssh: connect to host 10.89.233.13 port 22: Connection refused
What is the output of lxc-ps --lxc ?
> (And, I can't connect with lxc-console)
>
> # lxc-console -n sshd
> lxc-console: failed to connect to the tty service
Yeah, with the sshd template you can't because there is only the sshd
daemon running inside, no mingetty respawned by an init process and the
console configuration is not set for this template.
More information about the lxc-users
mailing list