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:
user@host:~$ host guest1 10.0.3.1
Using domain server:
Name: 10.0.3.1
Address: 10.0.3.1#53
Aliases:
guest0 has address 10.0.3.123
I have one more question (not urgent, but making this work would be
nice-to-have):
Connecting using the hostname fails:
>user@host:~$ ssh ubuntu@guest1
>ssh: Could not resolve hostname guest1: Name or service not known
Can you suggest what needs to be configured to make this work?
Thank you
Alan
________________________________
From: Marko Anastasov <marko.anasta...@gmail.com>
To: Alan McDuff <alan.mcd...@yahoo.com>
Cc: "lxc-users@lists.sourceforge.net" <lxc-users@lists.sourceforge.net>
Sent: Saturday, January 5, 2013 12:27 PM
Subject: Re: [Lxc-users] retrieve guest container's ip address
On Sat, Jan 5, 2013 at 12:21 PM, Alan McDuff <alan.mcd...@yahoo.com> wrote:
Hello,
>since Ubuntu 12.04 made it very simple to create a lxc guest, I was able to
>start experimenting with lxc.
>I create and run the container using:
>
>
>lxc-create -t ubuntu -n guest1
>lxc-start -n guest1 -d
>
>
>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.
>
>
>Running "lxc-start -n guest1" without daemon mode and then typing "ifconfig"
>inside the container is no option, because this works only interactively.
>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.
>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.
>
>
>Is there something like an "lxc-ifconfig" command?
>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.
>
>
>
Hi Alan,
Check out the thread that I've started recently, I had very similar questions.
Marko
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users