<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Great, thank you, Marko. I had read the thread, but first it didn't make sense to me. From Stephanes last reply I found that this is all I need:<br><br>user@host:~$ host guest1 10.0.3.1<br><div><span>Using domain server:<br>Name: 10.0.3.1<br>Address: 10.0.3.1#53<br>Aliases:<br>guest0 has address 10.0.3.123</span></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;"><span><br></span></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;"><span>I have one more question (not urgent, but making this work would be nice-to-have):</span></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;"><span>Connecting using the hostname fails:<br></span></div><div>>user@host:~$ ssh ubuntu@guest1<br>>ssh: Could not resolve hostname guest1: Name or service not known</div><div>Can you suggest what needs to be configured to make this work?</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;">Thank you</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</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="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york,
 times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Marko Anastasov <marko.anastasov@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Alan McDuff <alan.mcduff@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "lxc-users@lists.sourceforge.net" <lxc-users@lists.sourceforge.net> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, January 5, 2013 12:27 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Lxc-users] retrieve guest container's ip address<br> </font> </div> <br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv1972840236"><div dir="ltr"><div class="yiv1972840236gmail_extra">On Sat, Jan 5, 2013 at 12:21 PM, Alan McDuff <span dir="ltr"><<a rel="nofollow" ymailto="mailto:alan.mcduff@yahoo.com" target="_blank" href="mailto:alan.mcduff@yahoo.com">alan.mcduff@yahoo.com</a>></span> wrote:<br><div class="yiv1972840236gmail_quote">

<blockquote class="yiv1972840236gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex;"><div><div style="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="font-style:normal;font-size:16px;background-color:transparent;">

lxc-create -t ubuntu -n guest1</div><div style="font-style:normal;font-size:16px;background-color:transparent;">lxc-start -n guest1 -d</div><div style="font-style:normal;font-size:16px;background-color:transparent;">

<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;">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="font-style:normal;font-size:16px;background-color:transparent;"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;">

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="font-style:normal;font-size:16px;background-color:transparent;">

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="font-style:normal;font-size:16px;background-color:transparent;">

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="font-style:normal;font-size:16px;background-color:transparent;">

<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;">Is there something like an "lxc-ifconfig" command?</div>
<div style="font-style:normal;font-size:16px;background-color:transparent;">
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="font-style:normal;font-size:16px;background-color:transparent;"><br></div></div></div></blockquote><div><br></div><div>Hi Alan,</div><div>

<br></div><div style="">Check out the thread that I've started recently, I had very similar questions.</div><div style=""><br></div><div style="">Marko</div></div></div></div>
</div><meta http-equiv="x-dns-prefetch-control" content="on"><br><br> </div> </div>  </div></body></html>