~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to man/en/virt-install.pod.in

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-01 15:40:11 UTC
  • mfrom: (1.3.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20110201154011-op0nusgc240xajvb
Tags: 0.500.5-1ubuntu1
* Merge from debian experimental. Remaining changes:
  - debian/patches/9001_Ubuntu.patch:
     + Updated to add maverick and natty to OS list and enable virtio
       for them.
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch. (refreshed)
  - debian/control: added acl package to depends.
  - Demote virt-viewer to Suggests, as it's in universe.
  - Recommends libvirt-bin
* Removed patches:
  - debian/patches/9002-libvirt_disk_format.patch: Upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
=head1 DESCRIPTION
12
12
 
13
 
B<virt-install> is a command line tool for provisioning new virtual machines
14
 
using the C<libvirt> hypervisor management library. The tool supports both
15
 
text based & graphical installations, using serial console, SDL graphics
16
 
or a VNC client/server pair. The guest can be configured to use one or more
17
 
virtual disks, network interfaces, audio devices, and physical host devices
18
 
(USB, PCI).
 
13
B<virt-install> is a command line tool for creating new KVM or Xen virtual
 
14
machines using the C<libvirt> hypervisor management library. See the EXAMPLES
 
15
section at the end of this document to quickly get started.
 
16
 
 
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.
19
21
 
20
22
The installation media can be held locally or remotely on NFS, HTTP, FTP
21
23
servers. In the latter case C<virt-install> will fetch the minimal files
91
93
Request a non-native CPU architecture for the guest virtual machine.
92
94
If omitted, the host CPU architecture will be used in the guest.
93
95
 
 
96
=item --machine=MACHINE
 
97
 
 
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 times of more exotic
 
100
architectures.
 
101
 
94
102
=item -u UUID, --uuid=UUID
95
103
 
96
104
UUID for the guest; if none is given a random UUID will be generated. If you
98
106
to be unique across the entire data center, and indeed world. Bear this in
99
107
mind if manually specifying a UUID
100
108
 
101
 
=item --vcpus=VCPUS
102
 
 
103
 
Number of virtual cpus to configure for the guest. Not all hypervisors support
104
 
SMP guests, in which case this argument will be silently ignored
 
109
=item --vcpus=VCPUS[,maxvcpus=MAX][,sockets=#][,cores=#][,threads=#]
 
110
 
 
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.
 
114
 
 
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
 
117
cores over threads.
105
118
 
106
119
=item --cpuset=CPUSET
107
120
 
113
126
If the value 'auto' is passed, virt-install attempts to automatically determine
114
127
an optimal cpu pinning using NUMA data, if available.
115
128
 
 
129
=item --cpu MODEL[,+feature][,-feature][,match=MATCH][,vendor=VENDOR]
 
130
 
 
131
Configure the CPU model and CPU features exposed to the guest. The only
 
132
required value is MODEL, which is a valid CPU model as listed in libvirt's
 
133
cpu_map.xml file.
 
134
 
 
135
Specific CPU features can be specified in a number of ways: using one of
 
136
libvirt's feature policy values force, require, optional, disable, or forbid,
 
137
or with the shorthand '+feature' and '-feature', which equal 'force=feature'
 
138
and 'disable=feature' respectively
 
139
 
 
140
Some examples:
 
141
 
 
142
=over 2
 
143
 
 
144
=item B<--cpu core2duo,+x2apic,disable=vmx>
 
145
 
 
146
Expose the core2duo CPU model, force enable x2apic, but do not expose vmx
 
147
 
 
148
=item B<--cpu host>
 
149
 
 
150
Expose the host CPUs configuration to the guest. This enables the guest to
 
151
take advantage of many of the host CPUs features (better performance), but
 
152
may cause issues if migrating the guest to a host without an identical CPU.
 
153
 
 
154
=back
 
155
 
116
156
=item --description
117
157
 
118
158
Human readable text description of the virtual machine. This will be stored
210
250
=item  -x EXTRA, --extra-args=EXTRA
211
251
 
212
252
Additional kernel command line arguments to pass to the installer when
213
 
performing a guest install from C<--location>.
 
253
performing a guest install from C<--location>. One common usage is specifying
 
254
an anaconda kickstart file for automated installs, such as
 
255
--extra-args "ks=http://myserver/my.ks"
 
256
 
 
257
=item  --initrd-inject=PATH
 
258
 
 
259
Add PATH to the root of the initrd fetched with C<--location>. This can be
 
260
used to run an automated install without requiring a network hosted kickstart
 
261
file:
 
262
 
 
263
--initrd-injections=/path/to/my.ks --extra-args "ks=file:/my.ks"
214
264
 
215
265
=item  --os-type=OS_TYPE
216
266
 
239
289
 
240
290
::VARIANT VALUES::
241
291
 
 
292
=item --boot=BOOTOPTS
 
293
 
 
294
Optionally specify the post-install VM boot configuration. This option allows
 
295
specifying a boot device order, permanently booting off kernel/initrd with
 
296
option kernel arguments, and enabling a BIOS boot menu (requires libvirt
 
297
0.8.3 or later)
 
298
 
 
299
--boot can be specified in addition to other install options
 
300
(such as --location, --cdrom, etc.) or can be specified on it's own. In
 
301
the latter case, behavior is similar to the --import install option: there
 
302
is no 'install' phase, the guest is just created and launched as specified.
 
303
 
 
304
Some examples:
 
305
 
 
306
=over 2
 
307
 
 
308
=item B<--boot cdrom,fd,hd,network,menu=on>
 
309
 
 
310
Set the boot device priority as first cdrom, first floppy, first harddisk,
 
311
network PXE boot. Additionally enable BIOS boot menu prompt.
 
312
 
 
313
=item B<--boot kernel=KERNEL,initrd=INITRD,kernel_args="console=/dev/ttyS0">
 
314
 
 
315
Have guest permanently boot off a local kernel/initrd pair, with the
 
316
specified kernel options.
 
317
 
 
318
=back
 
319
 
242
320
=back
243
321
 
244
322
 
343
421
qcow2 image, you will want to specify format=qcow2, otherwise the hypervisor
344
422
may not be able to read your disk image.
345
423
 
 
424
=item B<driver_name>
 
425
 
 
426
Driver name the hypervisor should use when accessing the specified
 
427
storage. Typically does not need to be set by the user.
 
428
 
 
429
=item B<driver_type>
 
430
 
 
431
Driver format/type the hypervisor should use when accessing the specified
 
432
storage. Typically does not need to be set by the user.
 
433
 
346
434
=back
347
435
 
348
436
See the examples section for some uses. This option deprecates C<--file>,
456
544
 
457
545
=over 2
458
546
 
459
 
=item  --vnc
 
547
=item --graphics TYPE,opt1=arg1,opt2=arg2,...
 
548
 
 
549
Specifies the graphical display configuration. This does not configure any
 
550
virtual hardware, just how the guest's graphical display can be accessed.
 
551
Typically the user does not need to specify this option, virt-install will
 
552
try and choose a useful default, and launch a suitable connection.
 
553
 
 
554
General format of a graphical string is
 
555
 
 
556
    --graphics TYPE,opt1=arg1,opt2=arg2,...
 
557
 
 
558
For example:
 
559
 
 
560
    --graphics vnc,password=foobar
 
561
 
 
562
The supported options are:
 
563
 
 
564
=over 4
 
565
 
 
566
=item B<type>
 
567
 
 
568
The display type. This is one of:
 
569
 
 
570
vnc
460
571
 
461
572
Setup a virtual console in the guest and export it as a VNC server in
462
 
the host. Unless the C<--vncport> parameter is also provided, the VNC
 
573
the host. Unless the C<port> parameter is also provided, the VNC
463
574
server will run on the first free port number at 5900 or above. The
464
575
actual VNC display allocated can be obtained using the C<vncdisplay>
465
576
command to C<virsh> (or L<virt-viewer(1)> can be used which handles this
466
577
detail for the use).
467
578
 
468
 
=item  --vncport=VNCPORT
469
 
 
470
 
Request a permanent, statically assigned port number for the guest VNC
471
 
console. Use of this option is discouraged as other guests may automatically
472
 
choose to run on this port causing a clash.
473
 
 
474
 
=item --vnclisten=VNCLISTEN
475
 
 
476
 
Address to listen on for VNC connections. Default is typically 127.0.0.1
 
579
sdl
 
580
 
 
581
Setup a virtual console in the guest and display an SDL window in the
 
582
host to render the output. If the SDL window is closed the guest may
 
583
be unconditionally terminated.
 
584
 
 
585
spice
 
586
 
 
587
Export the guest's console using the Spice protocol. Spice allows advanced
 
588
features like audio and USB device streaming, as well as improved graphical
 
589
performance.
 
590
 
 
591
none
 
592
 
 
593
No graphical console will be allocated for the guest. Fully virtualized guests
 
594
(Xen FV or QEmu/KVM) will need to have a text console configured on the first
 
595
serial port in the guest (this can be done via the --extra-args option). Xen
 
596
PV will set this up automatically. The command 'virsh console NAME' can be
 
597
used to connect to the serial device.
 
598
 
 
599
=item B<port>
 
600
 
 
601
Request a permanent, statically assigned port number for the guest
 
602
console. This is used by 'vnc' and 'spice'
 
603
 
 
604
=item B<tlsport>
 
605
 
 
606
Specify the spice tlsport.
 
607
 
 
608
=item B<listen>
 
609
 
 
610
Address to listen on for VNC/Spice connections. Default is typically 127.0.0.1
477
611
(localhost only), but some hypervisors allow changing this globally (for
478
612
example, the qemu driver default can be changed in /etc/libvirt/qemu.conf).
479
 
Use 0.0.0.0 to allow access from other machines.
 
613
Use 0.0.0.0 to allow access from other machines. This is use by 'vnc' and
 
614
'spice'
480
615
 
481
 
=item  -k KEYMAP, --keymap=KEYMAP
 
616
=item B<keymap>
482
617
 
483
618
Request that the virtual VNC console be configured to run with a specific
484
619
keyboard layout. If the special value 'local' is specified, virt-install
485
620
will attempt to configure to use the same keymap as the local system. A value
486
621
of 'none' specifically defers to the hypervisor. Default behavior is
487
 
hypervisor specific, but typically is the same as 'local'.
 
622
hypervisor specific, but typically is the same as 'local'. This is used
 
623
by 'vnc'
 
624
 
 
625
=item B<password>
 
626
 
 
627
Request a VNC password, required at connection time. Beware, this info may
 
628
end up in virt-install log files, so don't use an important password. This
 
629
is used by 'vnc' and 'spice'
 
630
 
 
631
=item B<passwordvalidto>
 
632
 
 
633
Set an expiration date for password. After the date/time has passed,
 
634
all new graphical connections are denyed until a new password is set.
 
635
This is used by 'vnc' and 'spice'
 
636
 
 
637
The format for this value is YYYY-MM-DDTHH:MM:SS, for example
 
638
2011-04-01T14:30:15
 
639
 
 
640
=back
 
641
 
 
642
=item  --vnc
 
643
 
 
644
This option is deprecated in favor of C<--graphics vnc,...>
 
645
 
 
646
=item  --vncport=VNCPORT
 
647
 
 
648
This option is deprecated in favor of C<--graphics vnc,port=PORT,...>
 
649
 
 
650
=item --vnclisten=VNCLISTEN
 
651
 
 
652
This option is deprecated in favor of C<--graphics vnc,listen=LISTEN,...>
 
653
 
 
654
=item  -k KEYMAP, --keymap=KEYMAP
 
655
 
 
656
This option is deprecated in favor of C<--graphics vnc,keymap=KEYMAP,...>
488
657
 
489
658
=item  --sdl
490
659
 
491
 
Setup a virtual console in the guest and display an SDL window in the
492
 
host to render the output. If the SDL window is closed the guest may
493
 
be unconditionally terminated.
 
660
This option is deprecated in favor of C<--graphics sdl,...>
494
661
 
495
662
=item  --nographics
496
663
 
497
 
No graphical console will be allocated for the guest. Fully virtualized guests
498
 
(Xen FV or QEmu/KVM) will need to have a text console configured on the first
499
 
serial port in the guest (this can be done via the --extra-args option). Xen
500
 
PV will set this up automatically. The command 'virsh console NAME' can be
501
 
used to connect to the serial device.
 
664
This option is deprecated in favor of C<--graphics none>
502
665
 
503
666
=item  --noautoconsole
504
667
 
715
878
 
716
879
=back
717
880
 
 
881
=item --channel
 
882
 
 
883
Specifies a communication channel device to connect the guest and host
 
884
machine. This option uses the same options as --serial and --parallel
 
885
for specifying the host/source end of the channel. Extra 'target' options
 
886
are used to specify how the guest machine sees the channel.
 
887
 
 
888
Some of the types of character device redirection are:
 
889
 
 
890
=over 4
 
891
 
 
892
=item B<--channel SOURCE,target_type=guestfwd,target_address=HOST:PORT>
 
893
 
 
894
Communication channel using QEMU usermode networking stack. The guest can
 
895
connect to the channel using the specified HOST:PORT combination.
 
896
 
 
897
=item B<--channel SOURCE,target_type=virtio[,name=NAME]>
 
898
 
 
899
Communication channel using virtio serial (requires 2.6.34 or later host and
 
900
guest). Each instance of a virtio --channel line is exposed in the
 
901
guest as /dev/vport0p1, /dev/vport0p2, etc. NAME is optional metadata, and
 
902
can be any string, such as org.linux-kvm.virtioport1.
 
903
If specified, this will be exposed in the guest at
 
904
/sys/class/virtio-ports/vport0p1/NAME
 
905
 
 
906
=back
 
907
 
 
908
=item --console
 
909
 
 
910
Connect a text console between the guest and host. Certain guest and
 
911
hypervisor combinations can automatically set up a getty in the guest, so
 
912
an out of the box text login can be provided (target_type=xen for xen
 
913
paravirt guests, and possibly target_type=virtio in the future).
 
914
 
 
915
Example:
 
916
 
 
917
=over 4
 
918
 
 
919
=item B<--console pty,target_type=virtio>
 
920
 
 
921
Connect a virtio console to the guest, redirected to a PTY on the host.
 
922
For supported guests, this exposes /dev/hvc0 in the guest. See
 
923
http://fedoraproject.org/wiki/Features/VirtioSerial for more info. virtio
 
924
console requires libvirt 0.8.3 or later.
 
925
 
 
926
=back
 
927
 
718
928
=item --video=VIDEO
719
929
 
720
930
Specify what video device model will be attached to the guest. Valid values
736
946
Set the autostart flag for a domain. This causes the domain to be started
737
947
on host boot up.
738
948
 
 
949
=item --print-xml
 
950
 
 
951
If the requested guest has no install phase (--import, --boot), print the
 
952
generated XML instead of defining the guest. By default this WILL do storage
 
953
creation (can be disabled with --dry-run).
 
954
 
 
955
If the guest has an install phase, you will need to use --print-step to
 
956
specify exactly what XML output you want. This option implies --quiet.
 
957
 
 
958
=item --print-step
 
959
 
 
960
Acts similarly to --print-xml, except requires specifying which install step
 
961
to print XML for. Possible values are 1, 2, 3, or all. Stage 1 is typically
 
962
booting from the install media, and stage 2 is typically the final guest
 
963
config booting off hardisk. Stage 3 is only relevant for windows installs,
 
964
which by default have a second install stage. This option implies --quiet.
 
965
 
739
966
=item --noreboot
740
967
 
741
968
Prevent the domain from automatically rebooting after the install has
756
983
Prevent interactive prompts. If the intended prompt was a yes/no prompt, always
757
984
say yes. For any other prompts, the application will exit.
758
985
 
 
986
=item --dry-run
 
987
 
 
988
Proceed through the guest creation process, but do NOT create storage devices,
 
989
change host device configuration, or actually teach libvirt about the guest.
 
990
virt-install may still fetch install media, since this is required to
 
991
properly detect the OS to install.
 
992
 
759
993
=item --prompt
760
994
 
761
995
Specifically enable prompting for required information. Default prompting
766
1000
Check that the number virtual cpus requested does not exceed physical CPUs and
767
1001
warn if they do.
768
1002
 
 
1003
=item -q, --quiet
 
1004
 
 
1005
Only print fatal error messages.
 
1006
 
769
1007
=item  -d, --debug
770
1008
 
771
1009
Print debugging information to the terminal when running the install process.
776
1014
 
777
1015
=head1 EXAMPLES
778
1016
 
779
 
Install a KVM guest (assuming proper host support), creating a new
780
 
storage file, virtual networking, booting from the host CDROM, using
781
 
VNC server/viewer.
 
1017
Install a Fedora 13 KVM guest with virtio accelerated disk/network,
 
1018
creating a new 8GB storage file, installing from media in the hosts
 
1019
CDROM drive, auto launching a graphical VNC viewer
782
1020
 
783
1021
  # virt-install \
784
1022
       --connect qemu:///system \
 
1023
       --virt-type kvm \
785
1024
       --name demo \
786
1025
       --ram 500 \
787
 
       --disk path=/var/lib/libvirt/images/demo.img,size=5 \
788
 
       --network network=default,model=virtio \
789
 
       --vnc \
790
 
       --cdrom /dev/cdrom
 
1026
       --disk path=/var/lib/libvirt/images/demo.img,size=8 \
 
1027
       --graphics vnc \
 
1028
       --cdrom /dev/cdrom \
 
1029
       --os-variant fedora13
791
1030
 
792
1031
Install a Fedora 9 plain QEMU guest, using LVM partition, virtual networking,
793
1032
booting from PXE, using VNC server/viewer
799
1038
       --disk path=/dev/HostVG/DemoVM \
800
1039
       --network network=default \
801
1040
       --virt-type qemu
802
 
       --vnc \
 
1041
       --graphics vnc \
803
1042
       --os-variant fedora9
804
1043
 
805
1044
Install a guest with a real partition, with the default QEMU hypervisor for
813
1052
       --disk path=/dev/hdc \
814
1053
       --network bridge=eth1 \
815
1054
       --arch ppc64 \
816
 
       --sdl \
 
1055
       --graphics sdl \
817
1056
       --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
818
1057
 
819
1058
Run a Live CD image under Xen fullyvirt, in diskless environment
824
1063
       --ram 500 \
825
1064
       --nodisks \
826
1065
       --livecd \
827
 
       --vnc \
 
1066
       --graphics vnc \
828
1067
       --cdrom /root/fedora7live.iso
829
1068
 
830
1069
Install a paravirtualized Xen guest, 500 MB of RAM, a 5 GB of disk, and
837
1076
       --ram 500 \
838
1077
       --file /var/lib/xen/images/demo.img \
839
1078
       --file-size 6 \
840
 
       --nographics \
 
1079
       --graphics none \
841
1080
       --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
842
1081
 
843
1082
Create a guest from an existing disk image 'mydisk.img' using defaults for
849
1088
       --disk /home/user/VMs/mydisk.img
850
1089
       --import
851
1090
 
 
1091
Test a custom kernel/initrd using an existing disk image, manually
 
1092
specifying a serial device hooked to a PTY on the host machine.
 
1093
 
 
1094
  # virt-install \
 
1095
       --name mykernel
 
1096
       --ram 512
 
1097
       --disk /home/user/VMs/mydisk.img
 
1098
       --boot kernel=/tmp/mykernel,initrd=/tmp/myinitrd,kernel_args="console=ttyS0"
 
1099
       --serial pty
 
1100
 
852
1101
=head1 AUTHORS
853
1102
 
854
1103
Written by Daniel P. Berrange, Hugh Brock, Jeremy Katz, Cole Robinson and a