1
.TH UBUNTU-VM-BUILDER 1 "May 2008"
3
ubuntu-vm-builder \- build ubuntu based virtual machines
5
.B ubuntu-vm-builder <vm> <suite>
8
This manual page documents the
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.
15
.SH PARAMETERS AND OPTIONS
18
There may be many more options than this. See ubuntu-vm-builder --help for more information
21
Generate images for the specified virtualisation software
24
Use the specified Ubuntu suite (ie: interpid, hardy, gutsy, etc....)
27
.SS Guest definition options
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)
32
.B \-\-components COMP1,COMP2,...,COMPN
33
A comma seperaed list of distro components to include (e.g. main,universe). This defaults to "main"
36
Install PKG into the guest (can be specfied multiple times)
39
Remove PKG from the guest (can be specfied multiple times)
42
Specify the target architecture.
43
Valid options: i386 amd64 lpia. Defaults to the same as the running system.
46
Set the name of the user to be added. Default: ubuntu.
49
Set the full name of the user to be added. Default: Ubuntu.
52
Set the password for the user. Default: ubuntu.
55
Set NAME as the hostname of the guest. Default: ubuntu
58
Assign NN megabytes of memory to the guest vm. Default: 128
61
.SS Guest networking options
64
Set DOMAIN as the domain name of the guest. Default: The domain of the machine running this script.
67
Ip address in dotted form (defaults to dhcp if not specified)
69
Options below are discarded if --ip is not specified
72
IP mask in dotted form (default: 255.255.255.0)
75
IP net address (default: X.X.X.0)
78
IP broadcast (default: X.X.X.255)
81
Gateway address (default: X.X.X.1)
84
Name server address (default: X.X.X.1)
87
.SS Guest partitioning options
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.
93
Allows to specify a partition table in partfile each line of partfile should specify (root first):
98
where size is in megabytes. You can have up to 4 virtual disks, a new disk starts on a line with '---'.
110
The following three options are not used if --part is specified:
113
The size in MB of the root filesystem (default 1000)
116
The size in MB of the /opt filesystem (default 4000)
119
The size in MB of the swap partition (default 1000)
122
.SS Environment definitions options
125
Specify the destination directory. Default: ubuntu-vm-$SUITE-$ARCH
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.
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
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.
144
Use Ubuntu mirror at URL. Default: http://archive.ubuntu.com/ubuntu for official architectures and http://ports.ubuntu.com/ubuntu-ports otherwise.
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
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)
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)
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.
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.
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.
168
.B \-o, \-\-overwrite
169
Force overwrite of destination dirctory if it already exists.
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.
178
Causes the display of a lot of information which are mainly interesting while debugging.
181
Specify a file to read the configuration from (defaults to ~/.ubuntu-vm-builder). See CONFIGURATION FILE below.
187
OBSOLETE - /opt partition is not created by default anymore
190
.SS Virtual Machine Specific options
196
Add resulting VM to the libvirt hypervisor at uri.
199
Specify where libvirt.tmpl is stored. Uses /usr/share/ubuntu-vm-builder/templates directory by default.
205
Specify where vmware.tmpl is stored. Uses /usr/share/ubuntu-vm-builder/templates directory by default.
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.
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.
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
230
ubuntu-vm-builder and this man page was written by Soren Hansen <soren@canonical.com> and is copyright 2007-2008 Canonical Ltd.