1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
|
=head1 NAME
virt-customize - Customize a virtual machine
=head1 SYNOPSIS
virt-customize
[ -a disk.img [ -a disk.img ... ] | -d domname ]
[--attach ISOFILE] [--attach-format FORMAT]
[ -c URI | --connect URI ] [ -n | --dry-run ]
[ --format FORMAT] [ -m MB | --memsize MB ]
[ --network | --no-network ]
[ -q | --quiet ] [--smp N] [ -v | --verbose ] [-x]
__CUSTOMIZE_SYNOPSIS__
virt-customize [ -V | --version ]
=head1 DESCRIPTION
Virt-customize can customize a virtual machine (disk image) by
installing packages, editing configuration files, and so on.
Virt-customize modifies the guest or disk image I<in place>. The
guest must be shut down. If you want to preserve the existing
contents of the guest, I<you must snapshot, copy or clone the disk first>.
You do I<not> need to run virt-customize as root. In fact we'd
generally recommend that you don't.
Related tools include: L<virt-sysprep(1)> and L<virt-builder(1)>.
=head1 OPTIONS
=over 4
=item B<--help>
Display brief help.
=item B<-a> file
=item B<--add> file
Add I<file> which should be a disk image from a virtual machine.
The format of the disk image is auto-detected. To override this and
force a particular format use the I<--format> option.
=item B<-a> URI
=item B<--add> URI
Add a remote disk. The URI format is compatible with guestfish.
See L<guestfish(1)/ADDING REMOTE STORAGE>.
=item B<--attach> ISOFILE
The given disk is attached to the libguestfs appliance. This is used
to provide extra software repositories or other data for
customization.
You probably want to ensure the volume(s) or filesystems in the
attached disks are labelled (or use an ISO volume name) so that you
can mount them by label in your run-scripts:
mkdir /tmp/mount
mount LABEL=EXTRA /tmp/mount
You can have multiple I<--attach> options, and the format can be any
disk format (not just an ISO).
=item B<--attach-format> FORMAT
Specify the disk format for the next I<--attach> option. The
C<FORMAT> is usually C<raw> or C<qcow2>. Use C<raw> for ISOs.
=item B<--colors>
=item B<--colours>
Use ANSI colour sequences to colourize messages. This is the default
when the output is a tty. If the output of the program is redirected
to a file, ANSI colour sequences are disabled unless you use this
option.
=item B<-c> URI
=item B<--connect> URI
If using libvirt, connect to the given I<URI>. If omitted, then we
connect to the default libvirt hypervisor.
If you specify guest block devices directly (I<-a>), then libvirt is
not used at all.
=item B<-d> guest
=item B<--domain> guest
Add all the disks from the named libvirt guest. Domain UUIDs can be
used instead of names.
=item B<-n>
=item B<--dry-run>
Perform a read-only "dry run" on the guest. This runs the sysprep
operation, but throws away any changes to the disk at the end.
=item B<--echo-keys>
When prompting for keys and passphrases, virt-customize normally turns
echoing off so you cannot see what you are typing. If you are not
worried about Tempest attacks and there is no one else in the room
you can specify this flag to see what you are typing.
=item B<--format> raw|qcow2|..
=item B<--format> auto
The default for the I<-a> option is to auto-detect the format of the
disk image. Using this forces the disk format for I<-a> options which
follow on the command line. Using I<--format auto> switches back to
auto-detection for subsequent I<-a> options.
For example:
virt-customize --format raw -a disk.img
forces raw format (no auto-detection) for F<disk.img>.
virt-customize --format raw -a disk.img --format auto -a another.img
forces raw format (no auto-detection) for F<disk.img> and reverts to
auto-detection for F<another.img>.
If you have untrusted raw-format guest disk images, you should use
this option to specify the disk format. This avoids a possible
security problem with malicious guests (CVE-2010-3851).
__INCLUDE:key-option.pod__
__INCLUDE:keys-from-stdin-option.pod__
=item B<-m> MB
=item B<--memsize> MB
Change the amount of memory allocated to I<--run> scripts. Increase
this if you find that I<--run> scripts or the I<--install> option are
running out of memory.
The default can be found with this command:
guestfish get-memsize
=item B<--network>
=item B<--no-network>
Enable or disable network access from the guest during the installation.
Enabled is the default. Use I<--no-network> to disable access.
The network only allows outgoing connections and has other minor
limitations. See L<virt-rescue(1)/NETWORK>.
If you use I<--no-network> then certain other options such as
I<--install> will not work.
This does not affect whether the guest can access the network once it
has been booted, because that is controlled by your hypervisor or
cloud environment and has nothing to do with virt-customize.
Generally speaking you should I<not> use I<--no-network>. But here
are some reasons why you might want to:
=over 4
=item 1.
Because the libguestfs backend that you are using doesn't support the
network. (See: L<guestfs(3)/BACKEND>).
=item 2.
Any software you need to install comes from an attached ISO, so you
don't need the network.
=item 3.
You don’t want untrusted guest code trying to access your host network
when running virt-customize. This is particularly an issue when you
don't trust the source of the operating system templates. (See
L</SECURITY> below).
=item 4.
You don’t have a host network (eg. in secure/restricted environments).
=back
=item B<-q>
=item B<--quiet>
Don’t print log messages.
To enable detailed logging of individual file operations, use I<-x>.
=item B<--smp> N
Enable N E<ge> 2 virtual CPUs for I<--run> scripts to use.
=item B<-v>
=item B<--verbose>
Enable verbose messages for debugging.
=item B<-V>
=item B<--version>
Display version number and exit.
=item B<--wrap>
Wrap error, warning, and informative messages. This is the default
when the output is a tty. If the output of the program is redirected
to a file, wrapping is disabled unless you use this option.
=item B<-x>
Enable tracing of libguestfs API calls.
=back
=head2 Customization options
__CUSTOMIZE_OPTIONS__
=head1 SELINUX
For guests which make use of SELinux, special handling for them might
be needed when using operations which create new files or alter
existing ones.
For further details, see L<virt-builder(1)/SELINUX>.
=head1 EXIT STATUS
This program returns 0 on success, or 1 if there was an error.
=head1 ENVIRONMENT VARIABLES
=over 4
=item C<VIRT_TOOLS_DATA_DIR>
This can point to the directory containing data files used for Windows
firstboot installation.
Normally you do not need to set this. If not set, a compiled-in
default will be used (something like F</usr/share/virt-tools>).
This directory may contain the following files:
=over 4
=item F<rhsrvany.exe>
This is the RHSrvAny Windows binary, used to install a "firstboot"
script in Windows guests. It is required if you intend to use the
I<--firstboot> or I<--firstboot-command> options with Windows guests.
See also: C<https://github.com/rwmjones/rhsrvany>
=item F<pvvxsvc.exe>
This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot"
script in Windows guests. It is required if you intend to use the
I<--firstboot> or I<--firstboot-command> options with Windows guests.
=back
=back
For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>.
=head1 SEE ALSO
L<guestfs(3)>,
L<guestfish(1)>,
L<virt-builder(1)>,
L<virt-clone(1)>,
L<virt-rescue(1)>,
L<virt-resize(1)>,
L<virt-sparsify(1)>,
L<virt-sysprep(1)>,
L<virsh(1)>,
L<lvcreate(8)>,
L<qemu-img(1)>,
L<scrub(1)>,
L<http://libguestfs.org/>,
L<http://libvirt.org/>.
=head1 AUTHORS
Richard W.M. Jones L<http://people.redhat.com/~rjones/>
=head1 COPYRIGHT
Copyright (C) 2011-2020 Red Hat Inc.
|