9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan 9 on xen 3, part two
@ 2006-12-05  5:45 ron minnich
  0 siblings, 0 replies; only message in thread
From: ron minnich @ 2006-12-05  5:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

OK, things are pretty good. I can drawterm in -- seems enough iterations of
>/adm/keys
and
auth/wrkey
etc. god me there.

I have dns support -- to do this we added one line to the
/etc/xen/vif-nat. It looks like this:
dhcp_up()
{
  claim_lock "vif-nat-dhcp"
  dhcp_remove_entry
  mac=$(xenstore_read "$XENBUS_PATH/mac")
  dns=`grep ^nameserver /etc/resolv.conf | head -1 | sed
s/nameserver// | tr '\n' ' ' | sed 's/.*/option domain-name-servers
&;/'`
  echo >>"$dhcpd_conf_file" \
"host $hostname { hardware ethernet $mac; fixed-address $vif_ip; o
ption routers $router_ip;  option host-name \"$hostname\"; $dns}"
  release_lock "vif-nat-dhcp"
  "$dhcpd_init_file" restart || true
}


note the 'dns=' line which grabs one nameserver from resolv.conf and
adds it to the dhcpd.conf. If anyone wants to improve on my script,
let me know. Uh, that tr piece is for multiple nameservers but that
was too much of a headache; I will probably rip it out.

With this change, you can see this on plan 9 instance on xen
plan9# cat /net/ndb
ip=10.0.2.1 ipmask=255.255.0.0 ipgw=10.0.2.128
        sys=plan9
        dns=192.168.0.1
plan9#
note the dns.

Now, I switch between ath0 and eth0, and here is the kludge. I have to
switch between this script (/etc/xen/xend-config.sxp)
[rminnich@q ~]$ cat /etc/xen/xend-config.sxp
(loglevel NOTICE)
(xend-http-server yes)
(xend-port 3456)
(xend-address '')
(console-limit 2048)
#(network-script network-bridge)
(network-script 'network-nat netdev=ath0') # note ATH0
#(network-script /bin/true)
#(vif-script vif-bridge)
(vif-script 'vif-nat dhcp=yes')
(dom0-min-mem 64)
(dom0-cpus 0)
(vnc-listen 0.0.0.0)

and a version where ath0 changes to eth0. how clumsy, but nat won't
work right if you don't.

I will try to update the wiki and welcome comments, and other testers,
and of course thank Richard Miller for doing this port. This is quite
a big faster than qemu.

ron


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-05  5:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-05  5:45 [9fans] plan 9 on xen 3, part two ron minnich

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).