~ubuntu-virt/vmbuilder/trunk

« back to all changes in this revision

Viewing changes to ubuntu-vm-builder.1

  • Committer: Soren Hansen
  • Date: 2008-06-27 12:47:26 UTC
  • Revision ID: soren.hansen@canonical.com-20080627124726-kj690sepircudc3h
Import python rewrite.. It's not quite at a useful point yet (only cli+kvm+hardy is in a usable state), but it's getting there..

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH UBUNTU-VM-BUILDER 1 "May 2008"
2
 
.SH NAME
3
 
ubuntu-vm-builder \- build ubuntu based virtual machines
4
 
.SH SYNOPSIS
5
 
.B ubuntu-vm-builder <vm> <suite>
6
 
[\fIOPTIONS\fR]...
7
 
.SH DESCRIPTION
8
 
This manual page documents the
9
 
.B ubuntu-vm-builder
10
 
command.
11
 
.B ubuntu-vm-builder
12
 
is a program that builds virtual machines based on Ubuntu. You can pass command line options to add extra packages, remove packages, choose which version of Ubuntu, which mirror etc. On recent hardware with plenty of RAM, tmpdir in /dev/shm or using a tmpfs, and a local mirror, you can bootstrap a vm in less than a minute.
13
 
 
14
 
 
15
 
.SH PARAMETERS AND OPTIONS
16
 
.TP
17
 
.B NOTE 
18
 
There may be many more options than this. See ubuntu-vm-builder --help for more information
19
 
.TP
20
 
.B <vm>
21
 
Generate images for the specified virtualisation software
22
 
.TP
23
 
.B <suite>
24
 
Use the specified Ubuntu suite (ie: interpid, hardy, gutsy, etc....)
25
 
 
26
 
 
27
 
.SS Guest definition options
28
 
.TP
29
 
.B \-\-kernel-flavour FLAVOUR
30
 
The kernel image flavour to install from: virtual, server, generic or others availble kernels (default: virtual for versions >= gutsy on i386, server otherwise)
31
 
.TP
32
 
.B \-\-components COMP1,COMP2,...,COMPN
33
 
A comma seperaed list of distro components to include (e.g. main,universe). This defaults to "main"
34
 
.TP
35
 
.B \-\-addpkg PKG
36
 
Install PKG into the guest (can be specfied multiple times)
37
 
.TP
38
 
.B \-\-removepkg PKG
39
 
Remove PKG from the guest (can be specfied multiple times)
40
 
.TP
41
 
.B \-a, \-\-arch ARCH
42
 
Specify the target architecture.
43
 
Valid options: i386 amd64 lpia. Defaults to the same as the running system.
44
 
.TP
45
 
.B \-\-user USERNAME
46
 
Set the name of the user to be added. Default: ubuntu.
47
 
.TP
48
 
.B \-\-name FULLNAME
49
 
Set the full name of the user to be added. Default: Ubuntu.
50
 
.TP
51
 
.B \-\-pass PASSWORD
52
 
Set the password for the user. Default: ubuntu.
53
 
.TP
54
 
.B \-\-hostname NAME
55
 
Set NAME as the hostname of the guest. Default: ubuntu
56
 
.TP
57
 
.B \-\-mem NN
58
 
Assign NN megabytes of memory to the guest vm.  Default: 128
59
 
 
60
 
 
61
 
.SS Guest networking options
62
 
.TP
63
 
.B \-\-domain DOMAIN
64
 
Set DOMAIN as the domain name of the guest. Default: The domain of the machine running this script.
65
 
.TP
66
 
.B \-\-ip ADDRESS
67
 
Ip address in dotted form (defaults to dhcp if not specified)
68
 
.TP
69
 
Options below are discarded if --ip is not specified
70
 
.RS
71
 
.B \-\-mask VALUE
72
 
IP mask in dotted form (default: 255.255.255.0)
73
 
.TP
74
 
.B \-\-net VALUE
75
 
IP net address (default: X.X.X.0)
76
 
.TP
77
 
.B \-\-bcast VALUE
78
 
IP broadcast (default: X.X.X.255)
79
 
.TP
80
 
.B \-\-gw ADDRESS
81
 
Gateway address (default: X.X.X.1)
82
 
.TP
83
 
.B \-\-dns ADDRESS
84
 
Name server address (default: X.X.X.1)
85
 
.RE
86
 
 
87
 
.SS Guest partitioning options
88
 
.TP
89
 
.B \-\-raw PATH
90
 
Specify the path to a raw file or device to install in.  Can be specified multiple time in conjunction with --part, paths will be used in the order presented. Make sure that the raw element(s) specified have enough free space.
91
 
.TP
92
 
.B \-\-part PATH
93
 
Allows to specify a partition table in partfile each line of partfile should specify (root first):
94
 
.RS
95
 
.RS
96
 
mountpoint size
97
 
.RE
98
 
where size is in megabytes. You can have up to 4 virtual disks, a new disk starts on a line with '---'. 
99
 
ie :
100
 
.RS
101
 
 root 1000
102
 
 /opt 1000
103
 
 swap 256
104
 
 ---
105
 
 /var 2000
106
 
 /log 1500
107
 
.RE
108
 
.RE
109
 
.TP
110
 
The following three options are not used if --part is specified:
111
 
.RS
112
 
.B \-\-rootsize SIZE
113
 
The size in MB of the root filesystem (default 1000)
114
 
.TP
115
 
.B \-\-optsize SIZE
116
 
The size in MB of the /opt filesystem (default 4000)
117
 
.TP
118
 
.B \-\-swapsize SIZE
119
 
The size in MB of the swap partition (default 1000)
120
 
.RE
121
 
 
122
 
.SS Environment definitions options
123
 
.TP
124
 
.B \-d, \-\-dest
125
 
Specify the destination directory.  Default: ubuntu-vm-$SUITE-$ARCH
126
 
.TP
127
 
.B \-t, \-\-tmp PATH
128
 
Use PATH as temporary working area for the image generation. 
129
 
Defaults to $TMPDIR or /tmp if $TMPDIR is not defined.  
130
 
If it is set to "-" data the data will go the same directory as -d if specified with a full path or the current directory if not.
131
 
.TP
132
 
.B \-\-tmpfs OPTIONS
133
 
Use a tmpfs as the working directory, specifying its options 
134
 
or "-" to use tmpfs default when no options are passed (different from the 
135
 
defaults below, see tmpfs manual)
136
 
 Defaults: suid,dev,size=1G
137
 
.TP
138
 
.B \-\-iso PATH
139
 
Use an iso image as the source for installation of file. Full path to the iso must be provided. 
140
 
If --mirror is also provided, it will be used in the final sources.list of the vm.
141
 
This requires suite and kernel parameter to match what is available on the iso, obviously.
142
 
.TP
143
 
.B \-\-mirror URL
144
 
Use Ubuntu mirror at URL. Default: http://archive.ubuntu.com/ubuntu for official architectures and http://ports.ubuntu.com/ubuntu-ports otherwise.
145
 
.TP
146
 
.B \-\-security-mirror URL
147
 
Use Ubuntu security mirror at URL instead of the default,
148
 
which is http://security.ubuntu.com/ubuntu for official
149
 
arches and http://ports.ubuntu.com/ubuntu-ports otherwise
150
 
.TP
151
 
.B \-\-ssh-key PATH
152
 
Add the given ssh public key file (absolute path) to the root's authorized keys and install openssh-server (WARNING: this has strong security implications)
153
 
.TP
154
 
.B \-\-ssh-user-key PATH
155
 
Add the given ssh public key file (absolute path) to the user's authorized keys and install openssh-server (WARNING: this has strong security implications)
156
 
.TP
157
 
.B \-\-exec PATH
158
 
Run the given script file specified by PATH. You can use 'chroot root <cmd>' to execute code in the guest. See additional details in the 'EXEC EXPLANATIONS' chapter.
159
 
.TP
160
 
.B \-\-firstboot PATH
161
 
Specify a script that will be copied into the guest and executed the first time the machine boots.  This script must not be interactive.
162
 
.TP
163
 
.B \-\-firstlogin PATH
164
 
Specify a script that will be copied into the guest and will be executed the first time the user logs in. This script can be interactive.
165
 
 
166
 
.SS Utilities
167
 
.TP
168
 
.B \-o, \-\-overwrite
169
 
Force overwrite of destination dirctory if it already exists.
170
 
.TP
171
 
.B \-h, \-\-help
172
 
Self-explanatory.
173
 
.TP
174
 
.B \-\-in-place
175
 
Install directly into the filesystem images. This is needed if your $TMPDIR is nodev and/or nosuid, but will result in slightly larger file system images.
176
 
.TP
177
 
.B \-v, \-\-verbose
178
 
Causes the display of a lot of information which are mainly interesting while debugging.
179
 
.TP
180
 
.B \-c PATH
181
 
Specify a file to read the configuration from (defaults to ~/.ubuntu-vm-builder). See CONFIGURATION FILE below.
182
 
 
183
 
 
184
 
.SS Obsolete
185
 
.TP
186
 
.B \-\-no\-opt
187
 
OBSOLETE - /opt partition is not created by default anymore
188
 
 
189
 
 
190
 
.SS Virtual Machine Specific options
191
 
.TP
192
 
.B kvm, qemu:
193
 
.RS
194
 
.TP
195
 
.B \-\-libvirt URI
196
 
Add resulting VM to the libvirt hypervisor at uri.
197
 
.TP
198
 
.B \-\-templates DIR
199
 
Specify where libvirt.tmpl is stored. Uses /usr/share/ubuntu-vm-builder/templates directory by default.
200
 
.RE
201
 
.B vmserver, wmw6:
202
 
.RS
203
 
.TP
204
 
.B \-\-templates DIR
205
 
Specify where vmware.tmpl is stored. Uses /usr/share/ubuntu-vm-builder/templates directory by default.
206
 
.RE
207
 
 
208
 
.SH CONFIGURATION FILE
209
 
 Most parameters can also be defined in the system's  configuration (/etc/ubuntu-vm-builder) or user's configuration (~/.ubuntu-vm-builder), or in a file specified by -c PATH.
210
 
 The files are automatically generated with default values the first time ubuntu-vm-builder is ran. See comments in the config file for more details on possible values, it should be self explanatory.
211
 
 User configuration is read after the system configuration, so it has precedence over it.
212
 
 In most cases, parameters have precedence over the configuration file, with the exception of list type parameters (ie: PKGCMD) which will see parameters added to the list predefined in the configuration file.
213
 
 
214
 
.SH EXEC EXPLANATIONS
215
 
 The --exec parameter allows to specify the full path name of a script that will be executed after the base system is installed (except grub) whose files hierarchy is in a directory named 'root' and has not yet been copied to the target virtual devices.
216
 
 The script is not in a chroot by default, so you can still copy file from the host file system (using full path name) to the destination files hierarchy which is in a subdirectory of the current working directory ($PWD) named 'root'.
217
 
 To execute commands in the target system's environment, you will need to prefix it with 'chroot root'.
218
 
 If the script returns an error, ubuntu-vm-builder will not continue to build the vm. 
219
 
 It is recommended to keep this script non interactive.
220
 
.TP
221
 
.B Sample script
222
 
.RS
223
 
 #Copy some file from the users home to the target user's home 
224
 
 cp -a ~/.gnome root/home/ubuntu/
225
 
 #Execute a command in the target system
226
 
 chroot root touch /var/log/syslog
227
 
 exit 0
228
 
.RE
229
 
.SH AUTHOR
230
 
ubuntu-vm-builder and this man page was written by Soren Hansen <soren@canonical.com> and is copyright 2007-2008 Canonical Ltd.