From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EYxc1-0000w7-Sf for qemu-devel@nongnu.org; Sun, 06 Nov 2005 22:24:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EYxbz-0000u0-Ci for qemu-devel@nongnu.org; Sun, 06 Nov 2005 22:24:01 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYxbz-0000tx-9y for qemu-devel@nongnu.org; Sun, 06 Nov 2005 22:23:59 -0500 Received: from [221.122.43.98] (helo=fw.exoweb.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EYxbx-0000Sz-HE for qemu-devel@nongnu.org; Sun, 06 Nov 2005 22:23:59 -0500 Received: from [192.168.0.126] (helo=exo126.exoweb.net ident=shunwen) by fw.exoweb.net with esmtp (Exim 3.36 #1 (Debian)) id 1EYxbo-0004Hn-00 for ; Mon, 07 Nov 2005 11:23:48 +0800 Subject: Re: [Qemu-devel] How to get a guest IP From: shunwen In-Reply-To: References: Content-Type: text/plain; charset=gb2312 Date: Mon, 07 Nov 2005 11:24:08 +0800 Message-Id: <1131333848.3567.18.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: shunwen@exoweb.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On =CE=E5, 2005-11-04 at 15:52 +0100, Henrik Nordstrom wrote: > On Fri, 4 Nov 2005, zheng sw wrote: >=20 > > Host want to get the guest's IP when the host start the guest? >=20 > Why? Beause I want to login the guest with ssh in another computer, and do some test in it. >=20 > > My setting is: debian(2.6.8), qemu, bridge-utils, TUN/TAP. The > > guest get a IP from a DHCP server which is in the same subnet whit > > host. >=20 > Ok. >=20 > > My purpose is use bash to run ssh connect to the host, then run > > qemu, After the guest is started, the host want to get the guest's > > IP and send to me, but nobody will control the guest. Now I am > > puzzle in how the host get the guest IP. >=20 > The most obvious way would be to use dynamic DNS updates, supported by=20 > most DHCP servers, automatically registering the guest host name in DNS. I think it's difficult to do such actions in program or script. >=20 > Another way is to have a init script in the guest to somehow tell the hos= t=20 > what IP address it has. In this way, the guest don't know the host IP except I send a message to guest when qemu run, Beause I may run qemu in different computer. When read the document, I can't find any way to send a message to guest in the command line or script. The best way I think is get the output of guest when it booting. I only find the option of redirect the guest output use -serial dev. But I can't read the output when use -serial pty. Is any other ways? thank you! Best Regards Zheng SW >=20 > Regards > Henrik