9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul+plan9@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Re: booting a terminal in qemu
Date: Wed, 28 Feb 2007 12:13:19 -0800	[thread overview]
Message-ID: <20070228201319.A141B5B51@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Tue, 27 Feb 2007 18:24:01 EST." <ee9e417a0702271524x69e35c16ndfe765323452fad8@mail.gmail.com>

> This should work as far as Plan 9 is concerned.
> It's qemu that is troublesome.  One possible approach
> to debugging is to boot the live (install) CD and then
> run ip/ipconfig -g 10.0.2.2 ether /net/ether0 10.0.2.15 255.255.255.0
> and see if that's enough to get a working network (i.e.,
> can you ping or telnet to port 567 or 9fs the remote machine).

In "qemu -net user" mode there are all sorts of restrictions
as qemu emulates the network layer + some userful services.
In particular all connections must be initiated from the VM
and ping won't work except to the port emulated by qemu.
Though, telnet from the VM should should work.  if a p9
terminal needs to `listen' on a port, -net user won't work.

> I have this script as my /etc/qemu-ifup, though I can't
> remember exactly why it is needed:
> 
> #!/bin/sh
> sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1

When you use -net tap, this script sets IP address for the
host side of the tap interface.  Packets pushed on this
interface pop up in corresponding /dev/tapN device (to be
read by qemu) and vice versa.

A more useful thing to do is to bridge the tap interface to
host's physical interface (or the host has to be a router and
provide other necessary things in your enviroments, such as
dhcp daemon or relay etc.).  Under FreeBSD-6 or later you can
have qemu-ifup do something like

#!/bin/sh
sudo sh -c "/sbin/ifconfig $1 up; /sbin/ifconfig bridge0 addm $1"

You don't need to give either bridge0 or the tap device any
IP address.  Prior to invoking qemu run the following and
also add these lines to /etc/rc.local.

/sbin/ifconfig bridge0 create
/sbin/ifconfig bridge0 addm em0 up

Replace em0 with your machine's real ethernet interface name.
If you want to run more than one qemu instance on the same
machine, you will need to specify mac addresses for
additional instances.

I imagine similar instructions exist for a linux/windows/mac hosts.


      parent reply	other threads:[~2007-02-28 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 19:30 [9fans] " John Floren
2007-02-27 21:12 ` Steve Simon
2007-02-27 21:09   ` William Josephson
2007-02-27 22:40 ` [9fans] " John Floren
2007-02-27 23:24   ` Russ Cox
2007-02-28 19:10     ` ron minnich
2007-02-28 19:34     ` Armando Camarero
2007-02-28 19:51       ` Gabriel Diaz
2007-03-01  3:11       ` erik quanstrom
2007-03-01 13:15         ` Armando Camarero
2007-02-28 20:13     ` Bakul Shah [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070228201319.A141B5B51@mail.bitblocks.com \
    --to=bakul+plan9@bitblocks.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).