5
virt-install - provision new virtual machines
9
B<virt-install> [OPTION]...
13
B<virt-install> is a command line tool for creating new KVM, Xen, or Linux
14
container guests using the C<libvirt> hypervisor management library.
15
See the EXAMPLES section at the end of this document to quickly get started.
17
B<virt-install> tool supports both text based & graphical installations,
18
using VNC or SDL graphics, or a text serial console. The guest can be
19
configured to use one or more virtual disks, network interfaces,
20
audio devices, physical USB or PCI devices, among others.
22
The installation media can be held locally or remotely on NFS, HTTP, FTP
23
servers. In the latter case C<virt-install> will fetch the minimal files
24
necessary to kick off the installation process, allowing the guest
25
to fetch the rest of the OS distribution as needed. PXE booting, and importing
26
an existing disk image (thus skipping the install phase) are also supported.
28
Given suitable command line arguments, C<virt-install> is capable of running
29
completely unattended, with the guest 'kickstarting' itself too. This allows
30
for easy automation of guest installs. An interactive mode is also available
31
with the --prompt option, but this will only ask for the minimum required
36
Most options are not required. Minimum requirements are --name, --ram,
37
guest storage (--disk, --filesystem or --nodisks), and an install option.
43
Show the help message and exit
45
=item --connect=CONNECT
47
Connect to a non-default hypervisor. The default connection is chosen based
48
on the following rules:
54
If running on a host with the Xen kernel (checks against /proc/xen)
58
If running on a bare metal kernel as root (needed for KVM installs)
62
If running on a bare metal kernel as non-root
64
It is only necessary to provide the C<--connect> argument if this default
65
prioritization is incorrect, eg if wanting to use QEMU while on a Xen kernel.
71
=head2 General Options
73
General configuration parameters that apply to all types of guest installs.
77
=item -n NAME, --name=NAME
79
Name of the new guest virtual machine instance. This must be unique amongst
80
all guests known to the hypervisor on the connection, including those not
81
currently active. To re-define an existing guest, use the C<virsh(1)> tool
82
to shut it down ('virsh shutdown') & delete ('virsh undefine') it prior to
83
running C<virt-install>.
85
=item -r MEMORY, --ram=MEMORY
87
Memory to allocate for guest instance in megabytes. If the hypervisor does
88
not have enough free memory, it is usual for it to automatically take memory
89
away from the host operating system to satisfy this allocation.
93
Request a non-native CPU architecture for the guest virtual machine.
94
If omitted, the host CPU architecture will be used in the guest.
96
=item --machine=MACHINE
98
The machine type to emulate. This will typically not need to be specified
99
for Xen or KVM, but is useful for choosing machine types of more exotic
102
=item -u UUID, --uuid=UUID
104
UUID for the guest; if none is given a random UUID will be generated. If you
105
specify UUID, you should use a 32-digit hexadecimal number. UUID are intended
106
to be unique across the entire data center, and indeed world. Bear this in
107
mind if manually specifying a UUID
109
=item --vcpus=VCPUS[,maxvcpus=MAX][,sockets=#][,cores=#][,threads=#]
111
Number of virtual cpus to configure for the guest. If 'maxvcpus' is specified,
112
the guest will be able to hotplug up to MAX vcpus while the guest is running,
113
but will startup with VCPUS.
115
CPU topology can additionally be specified with sockets, cores, and threads.
116
If values are omitted, the rest will be autofilled prefering sockets over
119
=item --cpuset=CPUSET
121
Set which physical cpus the guest can use. C<CPUSET> is a comma separated list of numbers, which can also be specified in ranges or cpus to exclude. Example:
123
0,2,3,5 : Use processors 0,2,3 and 5
124
1-5,^3,8 : Use processors 1,2,4,5 and 8
126
If the value 'auto' is passed, virt-install attempts to automatically determine
127
an optimal cpu pinning using NUMA data, if available.
129
=item --numatune=NODESET,[mode=MODE]
131
Tune NUMA policy for the domain process. Example invocations
134
--numatune \"1-3,5\",mode=preferred
136
Specifies the numa nodes to allocate memory from. This has the same syntax
137
as C<--cpuset> option. mode can be one of 'interleave', 'preferred', or
138
'strict' (the default). See 'man 8 numactl' for information about each
141
The nodeset string must use escaped-quotes if specifying any other option.
143
=item --cpu MODEL[,+feature][,-feature][,match=MATCH][,vendor=VENDOR]
145
Configure the CPU model and CPU features exposed to the guest. The only
146
required value is MODEL, which is a valid CPU model as listed in libvirt's
149
Specific CPU features can be specified in a number of ways: using one of
150
libvirt's feature policy values force, require, optional, disable, or forbid,
151
or with the shorthand '+feature' and '-feature', which equal 'force=feature'
152
and 'disable=feature' respectively
158
=item B<--cpu core2duo,+x2apic,disable=vmx>
160
Expose the core2duo CPU model, force enable x2apic, but do not expose vmx
164
Expose the host CPUs configuration to the guest. This enables the guest to
165
take advantage of many of the host CPUs features (better performance), but
166
may cause issues if migrating the guest to a host without an identical CPU.
172
Human readable text description of the virtual machine. This will be stored
173
in the guests XML configuration for access by other applications.
175
=item --security type=TYPE[,label=LABEL][,relabel=yes|no]
177
Configure domain security driver settings. Type can be either 'static' or
178
'dynamic'. 'static' configuration requires a security LABEL. Specifying
179
LABEL without TYPE implies static configuration. To have libvirt automatically
180
apply your static label, you must specify relabel=yes.
188
=head2 Installation Method options
192
=item -c CDROM, --cdrom=CDROM
194
File or device use as a virtual CD-ROM device for fully virtualized guests.
195
It can be path to an ISO image, or to a CDROM device. It can also be a URL
196
from which to fetch/access a minimal boot ISO image. The URLs take the same
197
format as described for the C<--location> argument. If a cdrom has been
198
specified via the C<--disk> option, and neither C<--cdrom> nor any other
199
install option is specified, the C<--disk> cdrom is used as the install media.
201
=item -l LOCATION, --location=LOCATION
203
Distribution tree installtion source. virt-install can recognize
204
certain distribution trees and fetches a bootable kernel/initrd pair to
207
With libvirt 0.9.4 or later, network URL installs work for remote connections.
208
virt-install will download kernel/initrd to the local machine, and then
209
upload the media to the remote host. This option requires the URL to
210
be accessible by both the local and remote host.
212
The C<LOCATION> can take one of the following forms:
218
Path to a local directory containing an installable distribution image
220
=item nfs:host:/path or nfs://host/path
222
An NFS server location containing an installable distribution image
224
=item http://host/path
226
An HTTP server location containing an installable distribution image
228
=item ftp://host/path
230
An FTP server location containing an installable distribution image
234
Some distro specific url samples:
238
=item Fedora/Red Hat Based
240
http://download.fedoraproject.org/pub/fedora/linux/releases/10/Fedora/i386/os/
244
http://ftp.us.debian.org/debian/dists/etch/main/installer-amd64/
248
http://download.opensuse.org/distribution/11.0/repo/oss/
252
ftp://ftp.uwsg.indiana.edu/linux/mandrake/official/2009.0/i586/
256
ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/1
262
Use the PXE boot protocol to load the initial ramdisk and kernel for starting
263
the guest installation process.
267
Skip the OS installation process, and build a guest around an existing
268
disk image. The device used for booting is the first device specified via
269
C<--disk> or C<--filesystem>.
271
=item --init=INITPATH
273
Path to a binary that the container guest will init. If a root C<--filesystem>
274
is has been specified, virt-install will default to /sbin/init, otherwise
275
will default to /bin/sh.
279
Specify that the installation media is a live CD and thus the guest
280
needs to be configured to boot off the CDROM device permanently. It
281
may be desirable to also use the C<--nodisks> flag in combination.
283
=item -x EXTRA, --extra-args=EXTRA
285
Additional kernel command line arguments to pass to the installer when
286
performing a guest install from C<--location>. One common usage is specifying
287
an anaconda kickstart file for automated installs, such as
288
--extra-args "ks=http://myserver/my.ks"
290
=item --initrd-inject=PATH
292
Add PATH to the root of the initrd fetched with C<--location>. This can be
293
used to run an automated install without requiring a network hosted kickstart
296
--initrd-inject=/path/to/my.ks --extra-args "ks=file:/my.ks"
298
=item --os-type=OS_TYPE
300
Optimize the guest configuration for a type of operating system (ex. 'linux',
301
'windows'). This will attempt to pick the most suitable ACPI & APIC settings,
302
optimally supported mouse drivers, virtio, and generally accommodate other
303
operating system quirks.
305
By default, virt-install will attempt to auto detect this value from
306
the install media (currently only supported for URL installs). Autodetection
307
can be disabled with the special value 'none'
309
See C<--os-variant> for valid options.
311
=item --os-variant=OS_VARIANT
313
Further optimize the guest configuration for a specific operating system
314
variant (ex. 'fedora8', 'winxp'). This parameter is optional, and does not
315
require an C<--os-type> to be specified.
317
By default, virt-install will attempt to auto detect this value from
318
the install media (currently only supported for URL installs). Autodetection
319
can be disabled with the special value 'none'.
321
If the special value 'list' is passed, virt-install will print the full
322
list of variant values and exit. The printed format is not a stable
323
interface, DO NOT PARSE IT.
325
If the special value 'none' is passed, no os variant is recorded and
326
OS autodetection is disabled.
328
Values for some recent OS options are:
332
=item win7 : Microsoft Windows 7
334
=item vista : Microsoft Windows Vista
336
=item winxp64 : Microsoft Windows XP (x86_64)
338
=item winxp : Microsoft Windows XP
340
=item win2k8 : Microsoft Windows Server 2008
342
=item win2k3 : Microsoft Windows Server 2003
344
=item freebsd8 : FreeBSD 8.x
346
=item generic : Generic
348
=item debianwheezy : Debian Wheezy
350
=item debiansqueeze : Debian Squeeze
352
=item debianlenny : Debian Lenny
354
=item fedora16 : Fedora 16
356
=item fedora15 : Fedora 15
358
=item fedora14 : Fedora 14
360
=item mageia1 : Mageia 1 and later
362
=item mes5.1 : Mandriva Enterprise Server 5.1 and later
364
=item mandriva2010 : Mandriva Linux 2010 and later
366
=item rhel6 : Red Hat Enterprise Linux 6
368
=item rhel5.4 : Red Hat Enterprise Linux 5.4 or later
370
=item rhel4 : Red Hat Enterprise Linux 4
372
=item sles11 : Suse Linux Enterprise Server 11
374
=item sles10 : Suse Linux Enterprise Server
376
=item opensuse12 : openSuse 12
378
=item opensuse11 : openSuse 11
380
=item ubuntuoneiric : Ubuntu 11.10 (Oneiric Ocelot)
382
=item ubuntunatty : Ubuntu 11.04 (Natty Narwhal)
384
=item ubuntumaverick : Ubuntu 10.10 (Maverick Meerkat)
386
=item ubuntulucid : Ubuntu 10.04 (Lucid Lynx)
388
=item ubuntuhardy : Ubuntu 8.04 LTS (Hardy Heron)
394
Use '--os-variant list' to see the full OS list
396
=item --boot=BOOTOPTS
398
Optionally specify the post-install VM boot configuration. This option allows
399
specifying a boot device order, permanently booting off kernel/initrd with
400
option kernel arguments, and enabling a BIOS boot menu (requires libvirt
403
--boot can be specified in addition to other install options
404
(such as --location, --cdrom, etc.) or can be specified on it's own. In
405
the latter case, behavior is similar to the --import install option: there
406
is no 'install' phase, the guest is just created and launched as specified.
412
=item B<--boot cdrom,fd,hd,network,menu=on>
414
Set the boot device priority as first cdrom, first floppy, first harddisk,
415
network PXE boot. Additionally enable BIOS boot menu prompt.
417
=item B<--boot kernel=KERNEL,initrd=INITRD,kernel_args="console=/dev/ttyS0">
419
Have guest permanently boot off a local kernel/initrd pair, with the
420
specified kernel options.
430
=head2 Storage Configuration
434
=item --disk=DISKOPTS
436
Specifies media to use as storage for the guest, with various options. The
437
general format of a disk string is
439
--disk opt1=val1,opt2=val2,...
441
To specify media, the command can either be:
443
--disk /some/storage/path,opt1=val1
445
or explicitly specify one of the following arguments:
451
A path to some storage media to use, existing or not. Existing media can be
452
a file or block device. If installing on a remote host, the existing media
453
must be shared as a libvirt storage volume.
455
Specifying a non-existent path implies attempting to create the new storage,
456
and will require specifyng a 'size' value. If the base directory of the path
457
is a libvirt storage pool on the host, the new storage will be created as a
458
libvirt storage volume. For remote hosts, the base directory is required to be
459
a storage pool if using this method.
463
An existing libvirt storage pool name to create new storage on. Requires
464
specifying a 'size' value.
468
An existing libvirt storage volume to use. This is specified as
473
Other available options:
479
Disk device type. Value can be 'cdrom', 'disk', or 'floppy'. Default is
480
'disk'. If a 'cdrom' is specified, and no install method is chosen, the
481
cdrom is used as the install media.
485
Disk bus type. Value can be 'ide', 'sata', 'scsi', 'usb', 'virtio' or 'xen'.
486
The default is hypervisor dependent since not all hypervisors support all
491
Disk permissions. Value can be 'rw' (Read/Write), 'ro' (Readonly),
492
or 'sh' (Shared Read/Write). Default is 'rw'
496
size (in GB) to use if creating new storage
500
whether to skip fully allocating newly created storage. Value is 'true' or
501
'false'. Default is 'true' (do not fully allocate).
503
The initial time taken to fully-allocate the guest virtual disk (sparse=false)
504
will be usually by balanced by faster install times inside the guest. Thus
505
use of this option is recommended to ensure consistently high performance
506
and to avoid I/O errors in the guest should the host filesystem fill up.
510
The cache mode to be used. The host pagecache provides cache memory.
511
The cache value can be 'none', 'writethrough', or 'writeback'.
512
'writethrough' provides read caching. 'writeback' provides
513
read and write caching.
517
Image format to be used if creating managed storage. For file volumes, this
518
can be 'raw', 'qcow2', 'vmdk', etc. See format types in
519
L<http://libvirt.org/storage.html> for possible values. This is often
520
mapped to the B<driver_type> value as well.
522
With libvirt 0.8.3 and later, this option should be specified if reusing
523
and existing disk image, since libvirt does not autodetect storage format
524
as it is a potential security issue. For example, if reusing an existing
525
qcow2 image, you will want to specify format=qcow2, otherwise the hypervisor
526
may not be able to read your disk image.
530
Driver name the hypervisor should use when accessing the specified
531
storage. Typically does not need to be set by the user.
535
Driver format/type the hypervisor should use when accessing the specified
536
storage. Typically does not need to be set by the user.
540
Disk IO backend. Can be either "threads" or "native".
542
=item B<error_policy>
544
How guest should react if a write error is encountered. Can be one of
545
"stop", "ignore", or "enospace"
549
Serial number of the emulated disk device. This is used in linux guests
550
to set /dev/disk/by-id symlinks. An example serial number might be:
555
See the examples section for some uses. This option deprecates C<--file>,
556
C<--file-size>, and C<--nonsparse>.
560
Specifies a directory on the host to export to the guest. The most simple
563
--filesystem /source/on/host,/target/point/in/guest
565
Which will work for recent QEMU and linux guest OS or LXC containers. For
566
QEMU, the target point is just a mounting hint in sysfs, so will not be
567
automatically mounted.
569
The following explicit options can be specified:
575
The type or the source directory. Valid values are 'mount' (the default) or
576
'template' for OpenVZ templates.
580
The access mode for the source directory from the guest OS. Only used with
581
QEMU and type=mount. Valid modes are 'passthrough' (the default), 'mapped',
582
or 'squash'. See libvirt domain XML documentation for more info.
586
The directory on the host to share.
590
The mount location to use in the guest.
596
Request a virtual machine without any local disk storage, typically used for
597
running 'Live CD' images or installing to network storage (iSCSI or NFS root).
599
=item -f DISKFILE, --file=DISKFILE
601
This option is deprecated in favor of C<--disk path=DISKFILE>.
603
=item -s DISKSIZE, --file-size=DISKSIZE
605
This option is deprecated in favor of C<--disk ...,size=DISKSIZE,...>
609
This option is deprecated in favor of C<--disk ...,sparse=false,...>
617
=head2 Networking Configuration
621
=item -w NETWORK, --network=NETWORK,opt1=val1,opt2=val2
623
Connect the guest to the host network. The value for C<NETWORK> can take
630
Connect to a bridge device in the host called C<BRIDGE>. Use this option if
631
the host has static networking config & the guest requires full outbound
632
and inbound connectivity to/from the LAN. Also use this if live migration
633
will be used with this guest.
637
Connect to a virtual network in the host called C<NAME>. Virtual networks
638
can be listed, created, deleted using the C<virsh> command line tool. In
639
an unmodified install of C<libvirt> there is usually a virtual network
640
with a name of C<default>. Use a virtual network if the host has dynamic
641
networking (eg NetworkManager), or using wireless. The guest will be
642
NATed to the LAN by whichever connection is active.
646
Connect to the LAN using SLIRP. Only use this if running a QEMU guest as
647
an unprivileged user. This provides a very limited form of NAT.
651
If this option is omitted a single NIC will be created in the guest. If
652
there is a bridge device in the host with a physical interface enslaved,
653
that will be used for connectivity. Failing that, the virtual network
654
called C<default> will be used. This option can be specified multiple
655
times to setup more than one NIC.
657
Other available options are:
663
Network device model as seen by the guest. Value can be any nic model supported
664
by the hypervisor, e.g.: 'e1000', 'rtl8139', 'virtio', ...
668
Fixed MAC address for the guest; If this parameter is omitted, or the value
669
C<RANDOM> is specified a suitable address will be randomly generated. For
670
Xen virtual machines it is required that the first 3 pairs in the MAC address
671
be the sequence '00:16:3e', while for QEMU or KVM virtual machines it must
678
Request a virtual machine without any network interfaces.
680
=item -b BRIDGE, --bridge=BRIDGE
682
This parameter is deprecated in favour of
683
C<--network bridge=bridge_name>.
685
=item -m MAC, --mac=MAC
687
This parameter is deprecated in favour of C<--network NETWORK,mac=12:34...>
695
=head2 Graphics Configuration
697
If no graphics option is specified, C<virt-install> will default to
698
'--graphics vnc' if the DISPLAY environment variable is set, otherwise
699
'--graphics none' is used.
703
=item --graphics TYPE,opt1=arg1,opt2=arg2,...
705
Specifies the graphical display configuration. This does not configure any
706
virtual hardware, just how the guest's graphical display can be accessed.
707
Typically the user does not need to specify this option, virt-install will
708
try and choose a useful default, and launch a suitable connection.
710
General format of a graphical string is
712
--graphics TYPE,opt1=arg1,opt2=arg2,...
716
--graphics vnc,password=foobar
718
The supported options are:
724
The display type. This is one of:
728
Setup a virtual console in the guest and export it as a VNC server in
729
the host. Unless the C<port> parameter is also provided, the VNC
730
server will run on the first free port number at 5900 or above. The
731
actual VNC display allocated can be obtained using the C<vncdisplay>
732
command to C<virsh> (or L<virt-viewer(1)> can be used which handles this
737
Setup a virtual console in the guest and display an SDL window in the
738
host to render the output. If the SDL window is closed the guest may
739
be unconditionally terminated.
743
Export the guest's console using the Spice protocol. Spice allows advanced
744
features like audio and USB device streaming, as well as improved graphical
747
Using spice graphic type will work as if those arguments were given:
749
--video qxl --channel spicevmc
753
No graphical console will be allocated for the guest. Fully virtualized guests
754
(Xen FV or QEmu/KVM) will need to have a text console configured on the first
755
serial port in the guest (this can be done via the --extra-args option). Xen
756
PV will set this up automatically. The command 'virsh console NAME' can be
757
used to connect to the serial device.
761
Request a permanent, statically assigned port number for the guest
762
console. This is used by 'vnc' and 'spice'
766
Specify the spice tlsport.
770
Address to listen on for VNC/Spice connections. Default is typically 127.0.0.1
771
(localhost only), but some hypervisors allow changing this globally (for
772
example, the qemu driver default can be changed in /etc/libvirt/qemu.conf).
773
Use 0.0.0.0 to allow access from other machines. This is use by 'vnc' and
778
Request that the virtual VNC console be configured to run with a specific
779
keyboard layout. If the special value 'local' is specified, virt-install
780
will attempt to configure to use the same keymap as the local system. A value
781
of 'none' specifically defers to the hypervisor. Default behavior is
782
hypervisor specific, but typically is the same as 'local'. This is used
787
Request a VNC password, required at connection time. Beware, this info may
788
end up in virt-install log files, so don't use an important password. This
789
is used by 'vnc' and 'spice'
791
=item B<passwordvalidto>
793
Set an expiration date for password. After the date/time has passed,
794
all new graphical connections are denyed until a new password is set.
795
This is used by 'vnc' and 'spice'
797
The format for this value is YYYY-MM-DDTHH:MM:SS, for example
804
This option is deprecated in favor of C<--graphics vnc,...>
806
=item --vncport=VNCPORT
808
This option is deprecated in favor of C<--graphics vnc,port=PORT,...>
810
=item --vnclisten=VNCLISTEN
812
This option is deprecated in favor of C<--graphics vnc,listen=LISTEN,...>
814
=item -k KEYMAP, --keymap=KEYMAP
816
This option is deprecated in favor of C<--graphics vnc,keymap=KEYMAP,...>
820
This option is deprecated in favor of C<--graphics sdl,...>
824
This option is deprecated in favor of C<--graphics none>
826
=item --noautoconsole
828
Don't automatically try to connect to the guest console. The default behaviour
829
is to launch a VNC client to display the graphical console, or to run the
830
C<virsh> C<console> command to display the text console. Use of this parameter
831
will disable this behaviour.
838
=head2 Virtualization Type options
840
Options to override the default virtualization type choices.
846
Request the use of full virtualization, if both para & full virtualization are
847
available on the host. This parameter may not be available if connecting to a
848
Xen hypervisor on a machine without hardware virtualization support. This
849
parameter is implied if connecting to a QEMU based hypervisor.
853
This guest should be a paravirtualized guest. If the host supports both
854
para & full virtualization, and neither this parameter nor the C<--hvm>
855
are specified, this will be assumed.
859
This guest should be a container type guest. This option is only required
860
if the hypervisor supports other guest types as well (so for example this
861
option is the default behavior for LXC and OpenVZ, but is provided for
866
The hypervisor to install on. Example choices are kvm, qemu, xen, or kqemu.
867
Available options are listed via 'virsh capabilities' in the <domain> tags.
871
Prefer KVM or KQEMU (in that order) if installing a QEMU guest. This behavior
872
is now the default, and this option is deprecated. To install a plain QEMU
873
guest, use '--virt-type qemu'
877
Force disable APIC for the guest.
881
Force disable ACPI for the guest.
889
=head2 Device Options
893
=item --controller=TYPE[,OPTS]
895
Attach a controller device to the guest. TYPE is one of:
896
B<ide>, B<fdc>, B<scsi>, B<sata>, B<virtio-serial>, or B<usb>.
906
Controller address, current PCI of form 'bus:domain:slot:function'.
910
A decimal integer describing in which order the bus controller is
911
encountered, and to reference the controller bus.
915
Applicable to USB companion controllers, to define the master bus startport.
923
=item B<--controller usb,model=ich9-uhci2,address=0:0:4.7,index=0,master=2>
925
Adds a ICH9 USB companion controller on PCI address 0:0:4.7 with
926
master bus 0 and first port 2.
930
=item --host-device=HOSTDEV
932
Attach a physical host device to the guest. Some example values for HOSTDEV:
936
=item B<--host-device pci_0000_00_1b_0>
938
A node device name via libvirt, as shown by 'virsh nodedev-list'
940
=item B<--host-device 001.003>
942
USB by bus, device (via lsusb).
944
=item B<--host-device 0x1234:0x5678>
946
USB by vendor, product (via lsusb).
948
=item B<--host-device 1f.01.02>
950
PCI device (via lspci).
954
=item --soundhw MODEL
956
Attach a virtual audio device to the guest. MODEL specifies the emulated
957
sound card model. Possible values are ich6, ac97, es1370, sb16, pcspk,
958
or default. 'default' will be AC97 if the hypervisor supports it,
959
otherwise it will be ES1370.
961
This deprecates the old boolean --sound model (which still works the same
962
as a single '--soundhw default')
964
=item --watchdog MODEL[,action=ACTION]
966
Attach a virtual hardware watchdog device to the guest. This requires a
967
daemon and device driver in the guest. The watchdog fires a signal when
968
the virtual machine appears to hung. ACTION specifies what libvirt will do
969
when the watchdog fires. Values are
975
Forcefully reset the guest (the default)
979
Forcefully power off the guest
991
Gracefully shutdown the guest (not recommended, since a hung guest probably
992
won't respond to a graceful shutdown)
996
MODEL is the emulated device model: either i6300esb (the default) or ib700.
999
Use the recommended settings:
1003
Use the i6300esb with the 'poweroff' action
1005
--watchdog i6300esb,action=poweroff
1007
=item --parallel=CHAROPTS
1009
=item --serial=CHAROPTS
1011
Specifies a serial device to attach to the guest, with various options. The
1012
general format of a serial string is
1014
--serial type,opt1=val1,opt2=val2,...
1016
--serial and --parallel devices share all the same options, unless otherwise
1017
noted. Some of the types of character device redirection are:
1021
=item B<--serial pty>
1023
Pseudo TTY. The allocated pty will be listed in the running guests XML
1026
=item B<--serial dev,path=HOSTPATH>
1028
Host device. For serial devices, this could be /dev/ttyS0. For parallel
1029
devices, this could be /dev/parport0.
1031
=item B<--serial file,path=FILENAME>
1033
Write output to FILENAME.
1035
=item B<--serial pipe,path=PIPEPATH>
1037
Named pipe (see pipe(7))
1039
=item B<--serial tcp,host=HOST:PORT,mode=MODE,protocol=PROTOCOL>
1041
TCP net console. MODE is either 'bind' (wait for connections on HOST:PORT)
1042
or 'connect' (send output to HOST:PORT), default is 'bind'. HOST defaults
1043
to '127.0.0.1', but PORT is required. PROTOCOL can be either 'raw' or 'telnet'
1044
(default 'raw'). If 'telnet', the port acts like a telnet server or client.
1047
Wait for connections on any address, port 4567:
1049
--serial tcp,host=0.0.0.0:4567
1051
Connect to localhost, port 1234:
1053
--serial tcp,host=:1234,mode=connect
1055
Wait for telnet connection on localhost, port 2222. The user could then
1056
connect interactively to this console via 'telnet localhost 2222':
1058
--serial tcp,host=:2222,mode=bind,protocol=telnet
1060
=item B<--serial udp,host=CONNECT_HOST:PORT,bind_host=BIND_HOST:BIND_PORT>
1062
UDP net console. HOST:PORT is the destination to send output to (default
1063
HOST is '127.0.0.1', PORT is required). BIND_HOST:BIND_PORT is the optional
1064
local address to bind to (default BIND_HOST is 127.0.0.1, but is only set if
1065
BIND_PORT is specified). Some examples:
1067
Send output to default syslog port (may need to edit /etc/rsyslog.conf
1070
--serial udp,host=:514
1072
Send output to remote host 192.168.10.20, port 4444 (this output can be
1073
read on the remote host using 'nc -u -l 4444'):
1075
--serial udp,host=192.168.10.20:4444
1077
=item B<--serial unix,path=UNIXPATH,mode=MODE>
1079
Unix socket, see unix(7). MODE has similar behavior and defaults as
1080
--serial tcp,mode=MODE
1086
Specifies a communication channel device to connect the guest and host
1087
machine. This option uses the same options as --serial and --parallel
1088
for specifying the host/source end of the channel. Extra 'target' options
1089
are used to specify how the guest machine sees the channel.
1091
Some of the types of character device redirection are:
1095
=item B<--channel SOURCE,target_type=guestfwd,target_address=HOST:PORT>
1097
Communication channel using QEMU usermode networking stack. The guest can
1098
connect to the channel using the specified HOST:PORT combination.
1100
=item B<--channel SOURCE,target_type=virtio[,name=NAME]>
1102
Communication channel using virtio serial (requires 2.6.34 or later host and
1103
guest). Each instance of a virtio --channel line is exposed in the
1104
guest as /dev/vport0p1, /dev/vport0p2, etc. NAME is optional metadata, and
1105
can be any string, such as org.linux-kvm.virtioport1.
1106
If specified, this will be exposed in the guest at
1107
/sys/class/virtio-ports/vport0p1/NAME
1109
=item B<--channel spicevmc,target_type=virtio[,name=NAME]>
1111
Communication channel for QEMU spice agent, using virtio serial
1112
(requires 2.6.34 or later host and guest). NAME is optional metadata,
1113
and can be any string, such as the default com.redhat.spice.0 that
1114
specifies how the guest will see the channel.
1120
Connect a text console between the guest and host. Certain guest and
1121
hypervisor combinations can automatically set up a getty in the guest, so
1122
an out of the box text login can be provided (target_type=xen for xen
1123
paravirt guests, and possibly target_type=virtio in the future).
1129
=item B<--console pty,target_type=virtio>
1131
Connect a virtio console to the guest, redirected to a PTY on the host.
1132
For supported guests, this exposes /dev/hvc0 in the guest. See
1133
http://fedoraproject.org/wiki/Features/VirtioSerial for more info. virtio
1134
console requires libvirt 0.8.3 or later.
1140
Specify what video device model will be attached to the guest. Valid values
1141
for VIDEO are hypervisor specific, but some options for recent kvm are
1142
cirrus, vga, qxl, or vmvga (vmware).
1144
=item --smartcard=MODE[,OPTS]
1146
Configure a virtual smartcard device.
1148
Mode is one of B<host>, B<host-certificates>, or B<passthrough>. Additional
1155
Character device type to connect to on the host. This is only applicable
1156
for B<passthrough> mode.
1160
An example invocation:
1164
=item B<--smartcard passthrough,type=spicevmc>
1166
Use the smartcard channel of a SPICE graphics device to pass smartcard info
1171
See C<http://libvirt.org/formatdomain.html#elementsSmartcard> for complete
1174
=item --redirdev=BUS[,OPTS]
1176
Add a redirected device.
1182
The redirection type, currently supported is B<tcp> or B<spicevmc>.
1186
The TCP server connection details, of the form 'server:port'.
1190
Examples of invocation:
1194
=item B<--redirdev usb,type=tcp,server=localhost:4000>
1196
Add a USB redirected device provided by the TCP server on 'localhost'
1199
=item B<--redirdev usb,type=spicevmc>
1201
Add a USB device redirected via a dedicated Spice channel.
1207
=head2 Miscellaneous Options
1213
Set the autostart flag for a domain. This causes the domain to be started
1218
If the requested guest has no install phase (--import, --boot), print the
1219
generated XML instead of defining the guest. By default this WILL do storage
1220
creation (can be disabled with --dry-run).
1222
If the guest has an install phase, you will need to use --print-step to
1223
specify exactly what XML output you want. This option implies --quiet.
1227
Acts similarly to --print-xml, except requires specifying which install step
1228
to print XML for. Possible values are 1, 2, 3, or all. Stage 1 is typically
1229
booting from the install media, and stage 2 is typically the final guest
1230
config booting off hardisk. Stage 3 is only relevant for windows installs,
1231
which by default have a second install stage. This option implies --quiet.
1235
Prevent the domain from automatically rebooting after the install has
1240
Amount of time to wait (in minutes) for a VM to complete its install.
1241
Without this option, virt-install will wait for the console to close (not
1242
neccessarily indicating the guest has shutdown), or in the case of
1243
--noautoconsole, simply kick off the install and exit. Any negative
1244
value will make virt-install wait indefinitely, a value of 0 triggers the
1245
same results as noautoconsole. If the time limit is exceeded, virt-install
1246
simply exits, leaving the virtual machine in its current state.
1250
Prevent interactive prompts. If the intended prompt was a yes/no prompt, always
1251
say yes. For any other prompts, the application will exit.
1255
Proceed through the guest creation process, but do NOT create storage devices,
1256
change host device configuration, or actually teach libvirt about the guest.
1257
virt-install may still fetch install media, since this is required to
1258
properly detect the OS to install.
1262
Specifically enable prompting for required information. Default prompting
1263
is off (as of virtinst 0.400.0)
1267
Check that the number virtual cpus requested does not exceed physical CPUs and
1272
Only print fatal error messages.
1276
Print debugging information to the terminal when running the install process.
1277
The debugging information is also stored in C<$HOME/.virtinst/virt-install.log>
1278
even if this parameter is omitted.
1284
Install a Fedora 13 KVM guest with virtio accelerated disk/network,
1285
creating a new 8GB storage file, installing from media in the hosts
1286
CDROM drive, auto launching a graphical VNC viewer
1289
--connect qemu:///system \
1293
--disk path=/var/lib/libvirt/images/demo.img,size=8 \
1295
--cdrom /dev/cdrom \
1296
--os-variant fedora13
1298
Install a Fedora 9 plain QEMU guest, using LVM partition, virtual networking,
1299
booting from PXE, using VNC server/viewer
1302
--connect qemu:///system \
1305
--disk path=/dev/HostVG/DemoVM \
1306
--network network=default \
1309
--os-variant fedora9
1311
Install a guest with a real partition, with the default QEMU hypervisor for
1312
a different architecture using SDL graphics, using a remote kernel and initrd
1316
--connect qemu:///system \
1319
--disk path=/dev/hdc \
1320
--network bridge=eth1 \
1323
--location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
1325
Run a Live CD image under Xen fullyvirt, in diskless environment
1334
--cdrom /root/fedora7live.iso
1336
Run /usr/bin/httpd in a linux container guest (LXC). Resource usage is capped
1337
at 512 MB of ram and 2 host cpus:
1341
--name httpd_guest \
1344
--init /usr/bin/httpd
1346
Install a paravirtualized Xen guest, 500 MB of RAM, a 5 GB of disk, and
1347
Fedora Core 6 from a web server, in text-only mode, with old style --file
1354
--file /var/lib/xen/images/demo.img \
1357
--location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
1359
Create a guest from an existing disk image 'mydisk.img' using defaults for
1360
the rest of the options.
1365
--disk /home/user/VMs/mydisk.img
1368
Test a custom kernel/initrd using an existing disk image, manually
1369
specifying a serial device hooked to a PTY on the host machine.
1374
--disk /home/user/VMs/mydisk.img
1375
--boot kernel=/tmp/mykernel,initrd=/tmp/myinitrd,kernel_args="console=ttyS0"
1380
Written by Daniel P. Berrange, Hugh Brock, Jeremy Katz, Cole Robinson and a
1381
team of many other contributors. See the AUTHORS file in the source
1382
distribution for the complete list of credits.
1386
Please see http://virt-manager.org/page/BugReporting
1390
Copyright (C) 2006-2011 Red Hat, Inc, and various contributors.
1391
This is free software. You may redistribute copies of it under the terms of
1392
the GNU General Public License C<http://www.gnu.org/licenses/gpl.html>. There
1393
is NO WARRANTY, to the extent permitted by law.
1397
C<virsh(1)>, C<virt-clone(1)>, C<virt-manager(1)>, the project website C<http://virt-manager.org>