<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div>since Ubuntu 12.04 made it very simple to create a lxc guest, I was able to start experimenting with lxc.</div><div>I create and run the container using:</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">lxc-create -t ubuntu -n guest1</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">lxc-start -n guest1 -d</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
background-color: transparent; font-style: normal;">But how do I get the ip address of the guest, which I think is assigned by a dhcp server running on the host? I need to automate this to work in a shell script.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Running "lxc-start -n guest1" without daemon mode and then typing "ifconfig" inside the container is no option, because this works only interactively.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Running "lxc-execute -n guest1 ifconfig" doesn't show the address, because the network seems not to be set up with
lxc-execute, and lxc-execute can only execute in a stopped container.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Scanning the guest network using nmap for open ssh ports works, but is slow and needs trial and error to find the correct guest if more than one are runnign in the scanned range.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Is there something like an "lxc-ifconfig" command?</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Also, instructions would help
that explain how to login using the hostname ("ssh ubuntu@guest1"). But I would need instructions that work specifically with ubuntu 12.04. I found numerous tips for lxc under debian, but I can't figure out how to make them work for ubuntu.<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Thanks</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Alan<br></div></div></body></html>