xen.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. Recipe for getting/building/running Xen/ia64 with pv_ops
  2. --------------------------------------------------------
  3. This recipe describes how to get xen-ia64 source and build it,
  4. and run domU with pv_ops.
  5. ============
  6. Requirements
  7. ============
  8. - python
  9. - mercurial
  10. it (aka "hg") is an open-source source code
  11. management software. See the below.
  12. http://www.selenic.com/mercurial/wiki/
  13. - git
  14. - bridge-utils
  15. =================================
  16. Getting and Building Xen and Dom0
  17. =================================
  18. My environment is;
  19. Machine : Tiger4
  20. Domain0 OS : RHEL5
  21. DomainU OS : RHEL5
  22. 1. Download source
  23. # hg clone http://xenbits.xensource.com/ext/ia64/xen-unstable.hg
  24. # cd xen-unstable.hg
  25. # hg clone http://xenbits.xensource.com/ext/ia64/linux-2.6.18-xen.hg
  26. 2. # make world
  27. 3. # make install-tools
  28. 4. copy kernels and xen
  29. # cp xen/xen.gz /boot/efi/efi/redhat/
  30. # cp build-linux-2.6.18-xen_ia64/vmlinux.gz \
  31. /boot/efi/efi/redhat/vmlinuz-2.6.18.8-xen
  32. 5. make initrd for Dom0/DomU
  33. # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
  34. O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64
  35. # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
  36. 2.6.18.8-xen --builtin mptspi --builtin mptbase \
  37. --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
  38. --builtin ehci-hcd
  39. ================================
  40. Making a disk image for guest OS
  41. ================================
  42. 1. make file
  43. # dd if=/dev/zero of=/root/rhel5.img bs=1M seek=4096 count=0
  44. # mke2fs -F -j /root/rhel5.img
  45. # mount -o loop /root/rhel5.img /mnt
  46. # cp -ax /{dev,var,etc,usr,bin,sbin,lib} /mnt
  47. # mkdir /mnt/{root,proc,sys,home,tmp}
  48. Note: You may miss some device files. If so, please create them
  49. with mknod. Or you can use tar instead of cp.
  50. 2. modify DomU's fstab
  51. # vi /mnt/etc/fstab
  52. /dev/xvda1 / ext3 defaults 1 1
  53. none /dev/pts devpts gid=5,mode=620 0 0
  54. none /dev/shm tmpfs defaults 0 0
  55. none /proc proc defaults 0 0
  56. none /sys sysfs defaults 0 0
  57. 3. modify inittab
  58. set runlevel to 3 to avoid X trying to start
  59. # vi /mnt/etc/inittab
  60. id:3:initdefault:
  61. Start a getty on the hvc0 console
  62. X0:2345:respawn:/sbin/mingetty hvc0
  63. tty1-6 mingetty can be commented out
  64. 4. add hvc0 into /etc/securetty
  65. # vi /mnt/etc/securetty (add hvc0)
  66. 5. umount
  67. # umount /mnt
  68. FYI, virt-manager can also make a disk image for guest OS.
  69. It's GUI tools and easy to make it.
  70. ==================
  71. Boot Xen & Domain0
  72. ==================
  73. 1. replace elilo
  74. elilo of RHEL5 can boot Xen and Dom0.
  75. If you use old elilo (e.g RHEL4), please download from the below
  76. http://elilo.sourceforge.net/cgi-bin/blosxom
  77. and copy into /boot/efi/efi/redhat/
  78. # cp elilo-3.6-ia64.efi /boot/efi/efi/redhat/elilo.efi
  79. 2. modify elilo.conf (like the below)
  80. # vi /boot/efi/efi/redhat/elilo.conf
  81. prompt
  82. timeout=20
  83. default=xen
  84. relocatable
  85. image=vmlinuz-2.6.18.8-xen
  86. label=xen
  87. vmm=xen.gz
  88. initrd=initrd-2.6.18.8-xen.img
  89. read-only
  90. append=" -- rhgb root=/dev/sda2"
  91. The append options before "--" are for xen hypervisor,
  92. the options after "--" are for dom0.
  93. FYI, your machine may need console options like
  94. "com1=19200,8n1 console=vga,com1". For example,
  95. append="com1=19200,8n1 console=vga,com1 -- rhgb console=tty0 \
  96. console=ttyS0 root=/dev/sda2"
  97. =====================================
  98. Getting and Building domU with pv_ops
  99. =====================================
  100. 1. get pv_ops tree
  101. # git clone http://people.valinux.co.jp/~yamahata/xen-ia64/linux-2.6-xen-ia64.git/
  102. 2. git branch (if necessary)
  103. # cd linux-2.6-xen-ia64/
  104. # git checkout -b your_branch origin/xen-ia64-domu-minimal-2008may19
  105. (Note: The current branch is xen-ia64-domu-minimal-2008may19.
  106. But you would find the new branch. You can see with
  107. "git branch -r" to get the branch lists.
  108. http://people.valinux.co.jp/~yamahata/xen-ia64/for_eagl/linux-2.6-ia64-pv-ops.git/
  109. is also available. The tree is based on
  110. git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 test)
  111. 3. copy .config for pv_ops of domU
  112. # cp arch/ia64/configs/xen_domu_wip_defconfig .config
  113. 4. make kernel with pv_ops
  114. # make oldconfig
  115. # make
  116. 5. install the kernel and initrd
  117. # cp vmlinux.gz /boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU
  118. # make modules_install
  119. # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img \
  120. 2.6.26-rc3xen-ia64-08941-g1b12161 --builtin mptspi \
  121. --builtin mptbase --builtin mptscsih --builtin uhci-hcd \
  122. --builtin ohci-hcd --builtin ehci-hcd
  123. ========================
  124. Boot DomainU with pv_ops
  125. ========================
  126. 1. make config of DomU
  127. # vi /etc/xen/rhel5
  128. kernel = "/boot/efi/efi/redhat/vmlinuz-2.6-pv_ops-xenU"
  129. ramdisk = "/boot/efi/efi/redhat/initrd-2.6-pv_ops-xenU.img"
  130. vcpus = 1
  131. memory = 512
  132. name = "rhel5"
  133. disk = [ 'file:/root/rhel5.img,xvda1,w' ]
  134. root = "/dev/xvda1 ro"
  135. extra= "rhgb console=hvc0"
  136. 2. After boot xen and dom0, start xend
  137. # /etc/init.d/xend start
  138. ( In the debugging case, # XEND_DEBUG=1 xend trace_start )
  139. 3. start domU
  140. # xm create -c rhel5
  141. =========
  142. Reference
  143. =========
  144. - Wiki of Xen/IA64 upstream merge
  145. http://wiki.xensource.com/xenwiki/XenIA64/UpstreamMerge
  146. Written by Akio Takebe <takebe_akio@jp.fujitsu.com> on 28 May 2008