Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Add guest build manual
[palacios.git] / manual / guest_build / Palacios_Guest_Build.tex
1 \documentclass{article}[11pt]
2
3 \usepackage{amsmath}
4 \usepackage{amssymb}
5 \usepackage{verbatim}
6 \usepackage{epsf}
7 \usepackage{graphicx}
8
9 \def\colfigsize{\epsfxsize=5in}
10
11 \title{Building guest bootable image for the Palacios and Kitten}
12
13 \begin{document}
14 \maketitle
15
16 \section{Getting the stuffs used for building guest image}
17
18 In order to build the bootable guest iso image, we need to build Linux kernel image from its source, 
19 an initial file system containing a set of useful binary files and other necessary directories and files, 
20 which will be specified in the following text.
21
22 We will use a new directory for demonstration, 
23 the root directory for our following examples are all in the \verb+test/+ as root directory.
24
25 \begin{verbatim}
26 mkdir test/
27 cd test/
28 \end{verbatim}
29
30 There are a set of tools and sources that are useful for this building procedure. You can checkout these resources from our git repositories. To checkout them to your local directory, using commands:
31
32 \begin{verbatim}
33 git clone http://hornet.cs.northwestern.edu:9005/busybox
34 git clone http://hornet.cs.northwestern.edu:9005/initrd
35 git clone http://hornet.cs.northwestern.edu:9005/linux-2.6.30.y
36 \end{verbatim}
37
38 \section{Build the ramdisk filesystem}
39
40 Copy needed devices into the \verb+initramfs/dev/+ directory, 
41 for minimal support, you need console, ram, null, tty. 
42 (You probably need root privilege to copy and make the device files)
43
44 There is an already costumed initial ramdisk system made 
45 by Jack which you can leverage. The file is temporarily 
46 in \verb|/home/jarusl/initrd/disks/v3vee_initramfs.tar.gz|
47 in newskysaw machine.
48
49 \section{Configure and Install Busybox tools}
50
51 BusyBox is a software application released as Free software 
52 under the GNU GPL that provides many standard Unix tools. BusyBox 
53 combines tiny versions of many common UNIX utilities into a single 
54 small executable. For more details on Busybox, visiting http://busybox.net.
55
56 To configure BusyBox, in the \verb+busybox/+ directory, type
57
58 \begin{verbatim}
59 make meunconfig 
60 make xconfig (X version)
61 \end{verbatim}
62
63 You can add tools as you needed into the guest image. There are 
64 two specified configurations are required here:
65 First, in the "\verb|Build Options|", check the option 
66 "\verb|Build BusyBox as a static binary (no shared libs)|", 
67 as shown in figure \ref{fig:busyboxcf1}. Second, 
68 in the "\verb|Installation Options|", Change 
69 the "\verb|Busybox installation prefix|" to be the path 
70 of your "\verb|initramfs|" directory, as shown in figure \ref{fig:busyboxcf2}.
71  
72 \begin{figure}\begin{center}\colfigsize\epsffile{busyboxConf1.eps}\end{center}\caption{BusyBox configuartion}\label{fig:busyboxcf1}\end{figure}
73
74 \begin{figure}\begin{center}\colfigsize\epsffile{busyboxConf2.eps}\end{center}\caption{BusyBox configuartion}\label{fig:busyboxcf2}\end{figure}
75  
76 After you finish the configuration, save your configuration
77 and quit the window. Then, to make the Busybox tools, type 
78 \begin{verbatim}
79 make
80 \end{verbatim}
81 And then install the tools to your inital ramdisk directory
82
83 \begin{verbatim}
84 make install
85 \end{verbatim}
86
87 \section{Configure and Compile Linux Kernel}
88
89 Go to \verb|linux-2.6.30.y/| directory (or whatever your 
90 Linux kernel source directory). Type 
91
92 \begin{verbatim}
93 make menuconfig 
94 make xconfig (X version)
95 \end{verbatim}
96
97 To configure the kernel as your need. 
98 There is a customed configuration file "\verb|jrl-default-config|" 
99 which is configured with minimal kernel options (all of 
100 unnecessary stuffs are turned off to keep guest booting process faster).
101
102 For more on configuring and compiling Linux kernel image, check online. Here, one 
103 option for configuring the initial ramdisk file system directory (such 
104 as \verb|initrd/initramfs|) in the option 
105 "\verb|initial RAM filesystem and Ram Disk|" is needed, 
106 as shown in figure \ref{fig:linuxcf}.
107
108 \begin{figure}\begin{center}\colfigsize\epsffile{linuxConf.eps}\end{center}\caption{Linux Kernel configuartion}\label{fig:linuxcf}\end{figure}
109
110 \section{Configure guest devices}
111 Checkout the updated Palacios repository to \verb|palacios/|. 
112 (You can find the instruction of how to get the Palacios and
113 Kitten repository in http://www.v3vee.org/palacios/).
114
115 In the "\verb|palacios/utils/guest_creator|", Type
116 \begin{verbatim}
117 make
118 \end{verbatim}
119 You will get the guest configuration files creator "\verb|build_vm|".
120
121 The guest configuration file is using XML format. There is a sample configuration file: \verb|default.xml|. 
122 You can create your own guest configuration, after creating your file, type
123
124 \begin{verbatim}
125 ./build_vm myconfig.xml -o guest.iso
126 \end{verbatim}
127
128 Where \verb+myconfig.xml+ is your guest configuration file, 
129 and \verb+guest.iso+ is the output image file that can be 
130 feed into kitten¡¯s configuration (see next section).
131
132 \section{Configure and Make Palacios and Kitten}
133 \subsection*{Configure and build Palacios}
134
135 You can find the detail manual of getting and building Palacios and Kitten 
136 from scratch in the Palacios website (http://www.v3vee.org/palacios). 
137 Here we only give the specific requirements related to the booting guest procedure.
138
139 To configure Palacios, in Palacios root directory, such as \verb+palacios/+, type
140
141 \begin{verbatim}
142 make config
143 or
144 make xconfig
145 \end{verbatim}
146
147 To configure the components you want to build into Palacios. And then type 
148
149 \begin{verbatim}
150 make
151 or
152 make all
153 \end{verbatim}
154
155 To build Palacios static library, after build, you can find the Palacios library file \verb+libv3vee.a+ in root directory.
156
157 \subsection*{Configure and build Kitten}
158
159 To build Kitten, first configure it using the similar way as Palacios, go to \verb+kitten/+, type
160
161 \begin{verbatim}
162 make config
163 or
164 make xconfig
165 \end{verbatim}
166
167 Specifically, you have to enable Palacios VMM support in Kitten, 
168 and configure the root directory of Palacios and the 
169 path of the guest image file we just built in previous step, 
170 as show in figure \ref{fig:kittencf} and \ref{fig:kittencf2}.
171
172 \begin{figure}\begin{center}\colfigsize\epsffile{kittenConf1.eps}\end{center}\caption{Kitten configuartion}\label{fig:kittencf}\end{figure}
173
174 \begin{figure}\begin{center}\colfigsize\epsffile{kittenConf2.eps}\end{center}\caption{Kitten configuartion}\label{fig:kittencf2}\end{figure}
175  
176 After configure, to build the Kitten, type
177
178 \begin{verbatim}
179 make isoimage
180 \end{verbatim}
181
182 to make the bootable ISO image file with guest OS, Palacios and Kitten.
183 The ISO file is located in \verb+kitten/arch/x86_64/boot/image.iso+.
184
185 Until here, you have successfully created a guest CD image file that can be 
186 booted on machine. You can boot the file on Qemu using following sample command
187
188 \begin{verbatim}
189 /opt/vmm-tools/qemu/bin/qemu-system-x86_64 \
190         -smp 1 \
191         -m 2047 \
192         -serial file:./serial.out \
193         -cdrom kitten/arch/x86_64/boot/image.iso \
194         < /dev/null
195 \end{verbatim}
196
197 Here, we finally finish the entire procedure to 
198 build costumed guest and boot it on Palacios VMM. 
199 For more updated details, check Palacios 
200 website \verb+http://www.v3vee.org/palacios+ and 
201 Kitten website \verb+https://software.sandia.gov/trac/kitten+ regularly.
202
203
204 \end{document}