Subject: Re: XEN 3 on NetBSD 4 as Dom0
To: Sam Fourman Jr. <sfourman@gmail.com>
From: Kuruvai Kuruvai <kuruvai@sbcglobal.net>
List: port-xen
Date: 10/08/2007 11:24:14
--0-974144488-1191867854=:12317
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hi Sam:=0A=0AThe procedure I used is listed below at the end of this email.=
 I tried it on a Toshiba Tecra M5 laptop with an Intel T7200 processor and =
ran into APIC issues. Dom0 will not boot. Its might be a newer ACPI hardwar=
e issue; not sure. If anyone here can help me get the log files I will post=
 them here. I looked under /var/log/xen and could not find any log entries.=
 I was put on a "db>" prompt but I am not sure how I can export the data. =
=0A=0AI am also running NetBSD 4.0 RC2 with Xen 3.03 stuff. Maybe Xen 3.1 m=
ight work better. Not sure but will try. Anyone else have any advice?=0A=0A=
Good luck.=0A=0A-Kuruvai=0A=0APS: Checkout the mail archives. There are som=
e questions regarding Xen HVM performance. I am not sure if the newer Qemu =
changes have been incorporated into NetBSD XEN HVM. Take some basic benchma=
rks with FreeBSD Qemu and keep them for comparison. If someone on the list =
can provide more insight it would be very helpful for those of us trying th=
e NetBSD/Xen platform out.=0A=0A...........................................=
.........................................................................=
=0A=0AHere are the steps I took to get a basic Xen3 /NetBSD 4.0RC2 system w=
orking=0A=0A1. NetBSD RC2 Install=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=0A=0AInstall a basic NetBSD 4.0 RC2 install. Do no=
t install the XFree86 sets. =0AInstall everything but that. Also make sure =
your / partition is about 2GB. =0ABelow is my "df -h"=0A=0AFilesystem    Si=
ze      Used     Avail Capacity  Mounted on=0A/dev/wd0a     2.0G       87M =
     1.8G     4%    /=0A/dev/wd0f     2.0G      8.2M      1.9G     0%    /v=
ar=0A/dev/wd0e      96G      341M       91G     0%    /usr=0A/dev/wd0g     =
9.8G      2.0K      9.4G     0%    /home=0Akernfs        1.0K      1.0K    =
    0B   100%    /kern=0A=0A=0ABoot in to the new install.=0A=0ANow copy al=
l the kernel stuff from the installation CD into a root =0Adirectory (jsu f=
or making things afster later on)=0A=0A    mount_cd9660 /dev/cd0a /mnt=0A  =
  cp -R /mnt/i386/binary/kernel /root=0A    eject cd0=0A=0A2. Install Softw=
are=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0AI had =
already created binaries for Xorg 7.2 and so I used them to install =0Ait. =
Once X is installed, I also installed xen 3.0.3 over the network.=0A=0A    =
setenv PKG_PATH =0Aftp://ftp.netbsd.org/pub/pkgsrc/packages-2007Q2/NetBSD-4=
.0/i386/All=0A=0A    pkg_add grub=0A    pkg_add xentools30=0A    pkg_add xe=
nkernel30=0A    pkg_add e2fsprogs=0A=0A    cd /usr/pkg/share/examples/rc.d/=
=0A    cp * /etc/rc.d=0A=0AAdd the following lines to /etc/rc.conf=0A=0A   =
 nano /etc/rc.conf=0A    xend=3DYES=0A    xenbackendd=3DYES=0A    xendomain=
s=3DYES=0A=0A3. Install the Kernel=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0ABackup old kernel=0A=0A    mv /netbsd /net=
bsd.old=0A=0A    cd /root/kernel=0A=0A    gunzip netbsd-XEN3_DOM0.gz=0A=0A =
   cp netbsd-XEN3_DOM0 /netbsd=0A=0A    cd /usr/pkg/xen-kernel=0A=0A    gun=
zip xen.gz=0A=0A    cp xen /=0A=0A4. Install and Config GRUB=0A=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0A   =
 mkdir /grub=0A=0ABelow is my menu.lst that is stored in /grub=0A=0A=0A....=
..............................................................=0A=0Adefault=
=3D0=0Atimeout=3D10=0A=0Atitle XEN3=0A        root (hd0,0)=0A        kernel=
 (hd0,a)/xen dom0_mem=3D65536=0A        module (hd0,a)/netbsd root=3D/dev/h=
da1 ro console=3Dtty0=0A=0Atitle NetBSD 4.0=0A        root (hd0,0,a)=0A    =
    kernel /netbsd.old=0A=0Atitle NetBSD (BACK)=0A        root (hd0,0,a)=0A=
        chainloader +1=0A=0A...............................................=
...................=0A=0AThen execute the following:=0A=0A    grub-install =
--no-floppy /dev/rwd0d=0A=0A    grub --nofloppy=0A    > root (hd0,a)=0A    =
> setup (hd0)=0A    > quit=0A=0A=0A5. General Configurations=0A=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0A    cd=
 /dev=0A    sh MAKEDEV all=0A    sh MAKEDEV xen=0A=0A    nano /etc/ifconfig=
.bridge0=0A    =0A        create=0A        !brconfig $int add ex0 up=0A=0A6=
. Reboot=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0ANow reboot into your xen system=
. Good Luck!=0A=0A7. Machines=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0ACons=
ult manuals to create Xen Guest machines.=0A=0A=0A.........................=
...........................................................................=
..........................................................=0A=0A=0A=0A
--0-974144488-1191867854=:12317
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:times new roman, new york, times, serif;=
font-size:12pt"><div style=3D"font-family: times new roman,new york,times,s=
erif; font-size: 12pt;">Hi Sam:<br><br>The procedure I used is listed below=
 at the end of this email. I tried it on a Toshiba Tecra M5 laptop with an =
Intel T7200 processor and ran into APIC issues. Dom0 will not boot. Its mig=
ht be a newer ACPI hardware issue; not sure. If anyone here can help me get=
 the log files I will post them here. I looked under /var/log/xen and could=
 not find any log entries. I was put on a "db&gt;" prompt but I am not sure=
 how I can export the data. <br><br>I am also running NetBSD 4.0 RC2 with X=
en 3.03 stuff. Maybe Xen 3.1 might work better. Not sure but will try. Anyo=
ne else have any advice?<br><br>Good luck.<br><br>-Kuruvai<br><br>PS: Check=
out the mail archives. There are some questions regarding Xen HVM
 performance. I am not sure if the newer Qemu changes have been incorporate=
d into NetBSD XEN HVM. Take some basic benchmarks with FreeBSD Qemu and kee=
p them for comparison. If someone on the list can provide more insight it w=
ould be very helpful for those of us trying the NetBSD/Xen platform out.<br=
><br>......................................................................=
..............................................<br><br>Here are the steps I =
took to get a basic Xen3 /NetBSD 4.0RC2 system working<br><br>1. NetBSD RC2=
 Install<br>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
<br><br>Install a basic NetBSD 4.0 RC2 install. Do not install the XFree86 =
sets. <br>Install everything but that. Also make sure your / partition is a=
bout 2GB. <br>Below is my "df -h"<br><br>Filesystem&nbsp;&nbsp;&nbsp; Size&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Used&nbsp;&nbsp;&nbsp;&nbsp; Avail Capacity&n=
bsp; Mounted on<br>/dev/wd0a&nbsp;&nbsp;&nbsp;&nbsp; 2.0G&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;
 87M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.8G&nbsp;&nbsp;&nbsp;&nbsp; 4%&nbsp;&nb=
sp;&nbsp; /<br>/dev/wd0f&nbsp;&nbsp;&nbsp;&nbsp; 2.0G&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; 8.2M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.9G&nbsp;&nbsp;&nbsp;&nbsp; 0%=
&nbsp;&nbsp;&nbsp; /var<br>/dev/wd0e&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 96G&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; 341M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 91G&nbsp=
;&nbsp;&nbsp;&nbsp; 0%&nbsp;&nbsp;&nbsp; /usr<br>/dev/wd0g&nbsp;&nbsp;&nbsp=
;&nbsp; 9.8G&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.0K&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; 9.4G&nbsp;&nbsp;&nbsp;&nbsp; 0%&nbsp;&nbsp;&nbsp; /home<br>kernfs&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.0K&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.0K=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0B&nbsp;&nbsp; 100%&nbsp;&nbsp;&=
nbsp; /kern<br><br><br>Boot in to the new install.<br><br>Now copy all the =
kernel stuff from the installation CD into a root <br>directory (jsu for ma=
king things afster later on)<br><br>&nbsp;&nbsp;&nbsp; mount_cd9660
 /dev/cd0a /mnt<br>&nbsp;&nbsp;&nbsp; cp -R /mnt/i386/binary/kernel /root<b=
r>&nbsp;&nbsp;&nbsp; eject cd0<br><br>2. Install Software<br>=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>I had already created =
binaries for Xorg 7.2 and so I used them to install <br>it. Once X is insta=
lled, I also installed xen 3.0.3 over the network.<br><br>&nbsp;&nbsp;&nbsp=
; setenv PKG_PATH <br>ftp://ftp.netbsd.org/pub/pkgsrc/packages-2007Q2/NetBS=
D-4.0/i386/All<br><br>&nbsp;&nbsp;&nbsp; pkg_add grub<br>&nbsp;&nbsp;&nbsp;=
 pkg_add xentools30<br>&nbsp;&nbsp;&nbsp; pkg_add xenkernel30<br>&nbsp;&nbs=
p;&nbsp; pkg_add e2fsprogs<br><br>&nbsp;&nbsp;&nbsp; cd /usr/pkg/share/exam=
ples/rc.d/<br>&nbsp;&nbsp;&nbsp; cp * /etc/rc.d<br><br>Add the following li=
nes to /etc/rc.conf<br><br>&nbsp;&nbsp;&nbsp; nano /etc/rc.conf<br>&nbsp;&n=
bsp;&nbsp; xend=3DYES<br>&nbsp;&nbsp;&nbsp; xenbackendd=3DYES<br>&nbsp;&nbs=
p;&nbsp; xendomains=3DYES<br><br>3. Install the Kernel<br>=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>Backup old
 kernel<br><br>&nbsp;&nbsp;&nbsp; mv /netbsd /netbsd.old<br><br>&nbsp;&nbsp=
;&nbsp; cd /root/kernel<br><br>&nbsp;&nbsp;&nbsp; gunzip netbsd-XEN3_DOM0.g=
z<br><br>&nbsp;&nbsp;&nbsp; cp netbsd-XEN3_DOM0 /netbsd<br><br>&nbsp;&nbsp;=
&nbsp; cd /usr/pkg/xen-kernel<br><br>&nbsp;&nbsp;&nbsp; gunzip xen.gz<br><b=
r>&nbsp;&nbsp;&nbsp; cp xen /<br><br>4. Install and Config GRUB<br>=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br=
><br>&nbsp;&nbsp;&nbsp; mkdir /grub<br><br>Below is my menu.lst that is sto=
red in /grub<br><br><br>...................................................=
...............<br><br>default=3D0<br>timeout=3D10<br><br>title XEN3<br>&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root (hd0,0)<br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp; kernel (hd0,a)/xen dom0_mem=3D65536<br>&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module (hd0,a)/netbsd root=3D/dev/hda1 ro co=
nsole=3Dtty0<br><br>title NetBSD 4.0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; root
 (hd0,0,a)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kernel /netbsd.old=
<br><br>title NetBSD (BACK)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r=
oot (hd0,0,a)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chainloader +1<=
br><br>..................................................................<b=
r><br>Then execute the following:<br><br>&nbsp;&nbsp;&nbsp; grub-install --=
no-floppy /dev/rwd0d<br><br>&nbsp;&nbsp;&nbsp; grub --nofloppy<br>&nbsp;&nb=
sp;&nbsp; &gt; root (hd0,a)<br>&nbsp;&nbsp;&nbsp; &gt; setup (hd0)<br>&nbsp=
;&nbsp;&nbsp; &gt; quit<br><br><br>5. General Configurations<br>=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>&=
nbsp;&nbsp;&nbsp; cd /dev<br>&nbsp;&nbsp;&nbsp; sh MAKEDEV all<br>&nbsp;&nb=
sp;&nbsp; sh MAKEDEV xen<br><br>&nbsp;&nbsp;&nbsp; nano /etc/ifconfig.bridg=
e0<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; create<b=
r>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; !brconfig $int add ex0 up<br><br>6.=
 Reboot<br>=3D=3D=3D=3D=3D=3D=3D=3D=3D<br><br>Now reboot into
 your xen system. Good Luck!<br><br>7. Machines<br>=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<br><br>Consult manuals to create Xen Guest machines.<br><br><br>.=
...........................................................................=
...........................................................................=
.......<br><br><br></div></div></body></html>
--0-974144488-1191867854=:12317--