virt-install_man手冊

virt-install 命令說明

1舶赔、命令作用

建立(provision)新虛擬機(jī)

2、語法

virt-install [選項]...

3俩莽、說明(DESCRIPTION)

virt-install是一個使用“l(fā)ibvirt” hypervisor 管理庫構(gòu)建新虛擬機(jī)的命令行工具息裸,此工具使用串行控制臺,SDL(Simple DirectMedia Layer)圖形或者VNC客戶端/服務(wù)器幽崩,
支持基于命令行和圖形安裝。所建立的客戶機(jī)(在虛擬化中冈欢,把運行運行虛擬機(jī)服務(wù)器稱為host歉铝,把虛擬機(jī)稱為guest)能夠配置使用一個或多個虛擬磁盤、網(wǎng)卡凑耻、音頻設(shè)備和物理
主機(jī)設(shè)備(USB、PCI)
virt-install is a command line tool for provisioning new virtual machines using the "libvirt" hypervisor management library. The tool supports
both text based & graphical installations, using serial console, SDL graphics or a VNC client/server pair. The guest can be configured to use
one or more virtual disks, network interfaces, audio devices, and physical host devices (USB, PCI).

安裝媒介可以本地或基于NFS柠贤、HTTP香浩、FTP服務(wù)器遠(yuǎn)程連接,基于后者臼勉,virt-install將提取必要的最小限度的文件開始安裝過程邻吭,在安裝過程中,允許客戶機(jī)根據(jù)需要提取其他的
文件宴霸,也支持PXE引導(dǎo)和導(dǎo)入已有的磁盤映像(此操作跳過安裝階段)囱晴。
The installation media can be held locally or remotely on NFS, HTTP, FTP servers. In the latter case "virt-install" will fetch the minimal
files necessary to kick off the installation process, allowing the guest to fetch the rest of the OS distribution as needed. PXE booting, and
importing an existing disk image (thus skipping the install phase) are also supported.

給予適合的命令行變量膏蚓,“virt-install”具有完全無人值守安裝的能力,這允許更容易的客戶機(jī)自動化安裝畸写。本工具也支持交互模式通過提供 --prompt選項驮瞧,但是這種方式只要求
最小的必要選項。
Given suitable command line arguments, "virt-install" is capable of running completely unattended, with the guest ’kickstarting’ itself too.
This allows for easy automation of guest installs. An interactive mode is also available with the --prompt option, but this will only ask for
the minimum required options.

4枯芬、選項(OPTIONS)

大部分選項不是必須的论笔。
最小的需求是: --name  --ram ,存儲選項(--disk --nodisk)以及一個安裝選項。
Most options are not required. Minimum requirements are --name, --ram, guest storage (--disk or --nodisks), and an install option.

   -h, --help
     顯示幫助信息并退出
     Show the help message and exit

   --connect=CONNECT
     連接到一個非默認(rèn)hypervisor千所,選擇默認(rèn)鏈接基于以下規(guī)則:
     Connect to a non-default hypervisor. The default connection is chosen based on the following rules:

     xen If running on a host with the Xen kernel (checks against /proc/xen)

     qemu:///system
         If running on a bare metal kernel as root (needed for KVM installs)

     qemu:///session
         If running on a bare metal kernel as non-root

         只有在上述默認(rèn)優(yōu)先級不正確時才有必要提供“--connect”參數(shù)狂魔,例如如果想要在Xen內(nèi)核上使用qemu。
         It is only necessary to provide the "--connect" argument if this default prioritization is incorrect, eg if wanting to use QEMU while on
         a Xen kernel.

5淫痰、通用選項(General Options)

   通用配置參數(shù)適用于所有類型客戶機(jī)安裝最楷。
   General configuration parameters that apply to all types of guest installs.

   -n NAME, --name=NAME
     新客戶虛擬機(jī)實例名字,在連接的hypervisor已知的所有虛擬機(jī)中必須唯一待错,包括那些當(dāng)前未活動的虛擬機(jī)管嬉。想要重新定義一個已存在的虛擬機(jī),在運行‘virt-install’之前
     使用virsh工具關(guān)閉(‘virsh shutdown’)和刪除(‘virsh undefine’)此虛擬機(jī)朗鸠。
     Name of the new guest virtual machine instance. This must be unique amongst all guests known to the hypervisor on the connection, including
     those not currently active. To re-define an existing guest, use the virsh(1) tool to shut it down (’virsh shutdown’) & delete (’virsh
     undefine’) it prior to running "virt-install".

   -r MEMORY, --ram=MEMORY
     以M為單位指定分配給虛擬機(jī)的內(nèi)存大小蚯撩,如果hypervisor沒有足夠的可用內(nèi)存,它通常自動從主機(jī)操作系統(tǒng)使用的內(nèi)存中獲取烛占,以滿足此操作分配需要胎挎。
     Memory to allocate for guest instance in megabytes. If the hypervisor does not have enough free memory, it is usual for it to automatically
     take memory away from the host operating system to satisfy this allocation.

   --arch=ARCH
     為虛擬機(jī)請求一個非本地CPU架構(gòu),這個選項當(dāng)前只對qemu客戶機(jī)有效忆家,但是不能夠使用加速機(jī)制犹菇。如果忽略,在虛擬機(jī)中將使用主機(jī)CPU架構(gòu)芽卿。
     Request a non-native CPU architecture for the guest virtual machine.  The option is only currently available with QEMU guests, and will not
     enable use of acceleration. If omitted, the host CPU architecture will be used in the guest.

   -u UUID, --uuid=UUID
     虛擬機(jī)的唯一編號揭芍;如果沒有指定,將生成一個隨機(jī)UUID卸例。如果指定称杨,應(yīng)當(dāng)使用一個32為的十六進(jìn)制數(shù)字。UUID保證跨整個數(shù)據(jù)中心甚至世界的唯一性筷转,在手工指定
     UUID時這一點要記住姑原。
     UUID for the guest; if none is given a random UUID will be generated. If you specify UUID, you should use a 32-digit hexadecimal number. UUID
     are intended to be unique across the entire data center, and indeed world. Bear this in mind if manually specifying a UUID

   --vcpus=VCPUS
     虛擬機(jī)的虛擬CPU數(shù)。不是所有hypervisor都支持SMP虛擬機(jī)呜舒,在這種情況下這個變量將被忽略锭汛。
     Number of virtual cpus to configure for the guest. Not all hypervisors support SMP guests, in which case this argument will be silently
     ignored

   --check-cpu
     檢查指定的虛擬CPU數(shù)不要超過無論CPU,如果超過將返回警告信息。
     Check that the number virtual cpus requested does not exceed physical CPUs and warn if they do.

   --cpuset=CPUSET
     設(shè)置哪個物理CPU能夠被虛擬機(jī)使用唤殴“闫牛“CPUSET”是一個逗號分隔數(shù)字列表,也可以指定范圍朵逝,例如:
     Set which physical cpus the guest can use. "CPUSET" is a comma separated list of numbers, which can also be specified in ranges. Example:

         0,2,3,5     : Use processors 0,2,3 and 5  --使用0蔚袍,2,3 和5 處理器
         1-3,5,6-8   : Use processors 1,2,3,5,6,7 and 8  --使用1廉侧,2页响,3,5段誊,6闰蚕,7,8處理器

     如果此參數(shù)值為‘a(chǎn)uto’连舍,virt-install將使用NUMA(非一致性內(nèi)存訪問)數(shù)據(jù)試圖自動確定一個優(yōu)化的CPU定位没陡。
     If the value ’auto’ is passed, virt-install attempts to automatically determine an optimal cpu pinning using NUMA data, if available.

   --os-type=OS_TYPE
     針對一類操作系統(tǒng)優(yōu)化虛擬機(jī)配置(例如:‘Linux’,‘windows’)索赏,這將試圖選擇最適合的ACPI與APIC設(shè)置盼玄,支持優(yōu)化鼠標(biāo)驅(qū)動,virtio以及通常適應(yīng)其他操作系統(tǒng)特性潜腻。
     參見"--os-variant" 選項
     Optimize the guest configuration for a type of operating system (ex. ’linux’, ’windows’). This will attempt to pick the most suitable ACPI &
     APIC settings, optimally supported mouse drivers, virtio, and generally accommodate other operating system quirks. See "--os-variant" for
     valid options.

   --os-variant=OS_VARIANT
     針對特定操作系統(tǒng)變體(例如’fedora8’, ’winxp’)進(jìn)一步優(yōu)化虛擬機(jī)配置埃儿,這個參數(shù)是可選的并且不需要與 "--os-type"選項并用,有效值包括:
     Further optimize the guest configuration for a specific operating system variant (ex. ’fedora8’, ’winxp’). This parameter is optional, and
     does not require an "--os-type" to be specified. Valid values are:

     linux
         debianetch
             Debian Etch

         debianlenny
             Debian Lenny

         fedora5
             Fedora Core 5

         fedora6
             Fedora Core 6

         fedora7
             Fedora 7

         fedora8
             Fedora 8

         fedora9
             Fedora 9

         fedora10
             Fedora 10

         fedora11
             Fedora 11

         fedora12
             Fedora 12

         generic24
             Generic 2.4.x kernel

         generic26
             Generic 2.6.x kernel

         virtio26
             Generic 2.6.25 or later kernel with virtio

         rhel2.1
             Red Hat Enterprise Linux 2.1

         rhel3
             Red Hat Enterprise Linux 3

         rhel4
             Red Hat Enterprise Linux 4

         rhel5
             Red Hat Enterprise Linux 5

         rhel5.4
             Red Hat Enterprise Linux 5.4 or later

         rhel6
             Red Hat Enterprise Linux 6

         sles10
             Suse Linux Enterprise Server

         ubuntuhardy
             Ubuntu 8.04 LTS (Hardy Heron)

         ubuntuintrepid
             Ubuntu 8.10 (Intrepid Ibex)

         ubuntujaunty
             Ubuntu 9.04 (Jaunty Jackalope)

     other
         generic
             Generic

         msdos
             MS-DOS

         netware4
             Novell Netware 4

         netware5
             Novell Netware 5

         netware6
             Novell Netware 6

     solaris
         opensolaris
             Sun OpenSolaris

         solaris10
             Sun Solaris 10

         solaris9
             Sun Solaris 9

     unix
         freebsd6
             Free BSD 6.x

         freebsd7
             Free BSD 7.x

         openbsd4
             Open BSD 4.x

     windows
         vista
             Microsoft Windows Vista

         win2k
             Microsoft Windows 2000

         win2k3
             Microsoft Windows 2003

         win2k8
             Microsoft Windows 2008

         winxp
             Microsoft Windows XP (x86)

         winxp64
             Microsoft Windows XP (x86_64)

   --host-device=HOSTDEV
     附加一個物理主機(jī)設(shè)備到客戶機(jī)融涣。HOSTDEV是隨著libvirt使用的一個節(jié)點設(shè)備名(具體設(shè)備如’virsh nodedev-list’的顯示的結(jié)果)
     Attach a physical host device to the guest. HOSTDEV is a node device name as used by libvirt (as shown by ’virsh nodedev-list’).

6童番、完全虛擬化特定選項(Full Virtualization specific options)

   在完全虛擬化客戶機(jī)安裝時的特定參數(shù)。
   Parameters specific only to fully virtualized guest installs.

   --sound
     附加一個虛擬音頻設(shè)備到客戶機(jī)
     Attach a virtual audio device to the guest.

   --noapic

     覆蓋操作系統(tǒng)類型/變體使APIC(Advanced Programmable Interrupt Controller)設(shè)置對全虛擬化無效威鹿。
     Override the OS type / variant to disables the APIC setting for fully virtualized guest.

   --noacpi
     覆蓋操作系統(tǒng)類型/變體使ACPI(Advanced Configuration and Power Interface)設(shè)置對全虛擬化無效剃斧。
     Override the OS type / variant to disables the ACPI setting for fully virtualized guest.

7、虛擬化類型選項(Virtualization Type options)

   這些選項覆蓋默認(rèn)虛擬化類型選擇忽你。      
   Options to override the default virtualization type choices.

   -v, --hvm
     如果在主機(jī)上全虛擬化和para 虛擬化(para-irtualization如何解釋還沒有定論幼东,有人稱之為半虛擬化),請求使用全虛擬化(full virtualization)科雳。如果在
     一個沒有硬件虛擬化支持的機(jī)器上連接Xen hypervisor根蟹,這個參數(shù)不可用,這個參數(shù)意指連接到一個基于qemu的hypervisor炸渡。
     Request the use of full virtualization, if both para & full virtualization are available on the host. This parameter may not be available if
     connecting to a Xen hypervisor on a machine without hardware virtualization support. This parameter is implied if connecting to a QEMU based
     hypervisor.

   -p, --paravirt
     這個參數(shù)意指構(gòu)建一個paravirtualized客戶機(jī)娜亿。如何主機(jī)既支持para又支持 full虛擬化,并且既沒有指定本選項也沒有指定"--hvm"選項蚌堵,這個選項是假定選項。
     This guest should be a paravirtualized guest. If the host supports both para & full virtualization, and neither this parameter nor the "--hvm"
     are specified, this will be assumed.

   --accelerate
     當(dāng)安裝QEMU客戶機(jī)時,如果支持可用KVM或KQEMU內(nèi)核加速能力吼畏。除非一個客戶機(jī)操作系統(tǒng)不兼容加速督赤,這個選項是推薦最好加上。如果KVM和KQEMU都支持泻蚊,KVM加速
     器優(yōu)先使用躲舌。
     When installing a QEMU guest, make use of the KVM or KQEMU kernel acceleration capabilities if available. Use of this option is recommended
     unless a guest OS is known to be incompatible with the accelerators. The KVM accelerator is preferred over KQEMU if both are available.

8、安裝方法選項(Installation Method options)

   -c CDROM, --cdrom=CDROM
     對應(yīng)全虛擬化客戶機(jī)性雄,文件或設(shè)備作為一個虛擬化CD-ROM設(shè)備使用没卸,可以是ISO映像路徑或者一個CDROM設(shè)備,它也可以是一個能夠提取/訪問最小引導(dǎo)ISO映像的URL秒旋,
     URL使用與在 "--location" 選項中說明的相同的格式约计。如果一個CDROM已經(jīng)通過 "--disk"選項指定,并且 "--cdrom"和其他任何選項都沒有指定迁筛,"--disk" cdrom
     將作為安裝媒介使用煤蚌。
     File or device use as a virtual CD-ROM device for fully virtualized guests.  It can be path to an ISO image, or to a CDROM device. It can also
     be a URL from which to fetch/access a minimal boot ISO image. The URLs take the same format as described for the "--location" argument. If a
     cdrom has been specified via the "--disk" option, and neither "--cdrom" nor any other install option is specified, the "--disk" cdrom is used
     as the install media.

   -l LOCATION, --location=LOCATION
     客戶虛擬機(jī)kernel+initrd 安裝源。LOCATION使用以下格式:
     Installation source for guest virtual machine kernel+initrd pair.  The "LOCATION" can take one of the following forms:

     DIRECTORY
         指向一個包含可安裝發(fā)行版映像的目錄细卧。
         Path to a local directory containing an installable distribution image

     nfs:host:/path or nfs://host/path
         指向包含可安裝發(fā)行版映像的NFS服務(wù)器位置尉桩。
         An NFS server location containing an installable distribution image

     http://host/path
         指向包含可安裝發(fā)行版映像的http服務(wù)器位置。
         An HTTP server location containing an installable distribution image

     ftp://host/path
         指向包含可安裝發(fā)行版映像的FTP服務(wù)器位置贪庙。
         An FTP server location containing an installable distribution image

     下面是指定幾個特定發(fā)行版url的例子:
     Some distro specific url samples:

     Fedora/Red Hat Based
         http://download.fedoraproject.org/pub/fedora/linux/releases/10/Fedora/i386/os/

     Debian/Ubuntu
         http://ftp.us.debian.org/debian/dists/etch/main/installer-amd64/

     Suse
         http://download.opensuse.org/distribution/11.0/repo/oss/

     Mandriva
         ftp://ftp.uwsg.indiana.edu/linux/mandrake/official/2009.0/i586/

   --pxe
     使用PXE(preboot execute environment)加載初始ramdisk 和 kernel蜘犁,從而起動客戶機(jī)安裝過程。
     Use the PXE boot protocol to load the initial ramdisk and kernel for starting the guest installation process.

   --import
     跳過操作系統(tǒng)安裝過程止邮,圍繞一個存在的磁盤映像建立客戶機(jī)这橙。引導(dǎo)使用的設(shè)備是通過"--disk" or "--file"指定的第一個設(shè)備。
     Skip the OS installation process, and build a guest around an existing disk image. The device used for booting is the first device specified
     via "--disk" or "--file".

   --livecd
     指定安裝媒介是一個可引導(dǎo)操作系統(tǒng)CD(A live CD, live DVD, or live disc is a CD or DVD containing a bootable computer operating system)农尖,因此需要
     將虛擬機(jī)配置成永不從CDROM引導(dǎo)析恋。這也許需要與"--nodisks" 標(biāo)準(zhǔn)組合使用。
     Specify that the installation media is a live CD and thus the guest needs to be configured to boot off the CDROM device permanently. It may be
     desirable to also use the "--nodisks" flag in combination.

   -x EXTRA, --extra-args=EXTRA
     當(dāng)執(zhí)行從"--location"選項指定位置的客戶機(jī)安裝時盛卡,附加內(nèi)核命令行參數(shù)到安裝程序助隧。
     Additional kernel command line arguments to pass to the installer when performing a guest install from "--location".

9、存儲配置選項(Storage Configuration)

   --disk=DISKOPTS
     用不同的選項滑沧,指定作為客戶機(jī)存儲的媒介并村。通常的磁盤串格式是:
     Specifies media to use as storage for the guest, with various options. The general format of a disk string is

         --disk opt1=val1,opt2=val2,...

     要知道媒介,必須提供下面選項其中之一:
     To specify media, one of the following options is required:

     path
         要使用的一個指向某些存在后不存在存儲媒介的路徑滓技。存在的媒介可以是文件或塊設(shè)備哩牍。如在遠(yuǎn)程主機(jī)安裝,存在的媒介必須被共享為一個libvirt存儲卷令漂。
         A path to some storage media to use, existing or not. Existing media can be a file or block device. If installing on a remote host, the
         existing media must be shared as a libvirt storage volume.

         指定一個不存在的路徑意指試圖建立一個新的存儲膝昆,并且需要知道一個‘size’值丸边。如果路徑的基目錄是一個在主機(jī)上的libvirt存儲池,新存儲將被建立為一個
         libvirt存儲卷荚孵。對于遠(yuǎn)程主機(jī)妹窖,如果使用此方法,基目錄需要是一個存儲池收叶。
         Specifying a non-existent path implies attempting to create the new storage, and will require specifyng a ’size’ value. If the base
         directory of the path is a libvirt storage pool on the host, the new storage will be created as a libvirt storage volume. For remote
         hosts, the base directory is required to be a storage pool if using this method.

     pool
         一個要在其上建立新存儲的已有的libvirt存儲池名骄呼,需要指定一個‘size’值。
         An existing libvirt storage pool name to create new storage on. Requires specifying a ’size’ value.

     vol
         要使用的一個已有的libvirt存儲卷判没,指定格式類似’poolname/volname’
         An existing libvirt storage volume to use. This is specified as ’poolname/volname’.

10蜓萄、其他可用選項(Other available options)

     device
         磁盤設(shè)備類型。取值是’cdrom’, ’disk’, or ’floppy’澄峰,默認(rèn)為 ’disk’嫉沽。如果’cdrom’作為指定值并且沒有選擇安裝方法,cdrom將被作為安裝媒介摊阀。
         Disk device type. Value can be ’cdrom’, ’disk’, or ’floppy’. Default is ’disk’. If a ’cdrom’ is specified, and no install method is
         chosen, the cdrom is used as the install media.

     bus
         磁盤總線類型耻蛇,取值是’ide’, ’scsi’,’usb’, ’virtio’ 或 ’xen’,由于不是所有的hypervisor對所有總線類型都支持胞此,因此默認(rèn)值為依賴于所使用的hypervisor臣咖。
         Disk bus type. Value can be ’ide’, ’scsi’, ’usb’, ’virtio’ or ’xen’.  The default is hypervisor dependent since not all hypervisors
         support all bus types.

     perms
         磁盤權(quán)限,取值為’rw’ (讀/寫), ’ro’ (只讀), or ’sh’ (共享 讀/寫)漱牵,默認(rèn)值為’rw'
         Disk permissions. Value can be ’rw’ (Read/Write), ’ro’ (Readonly), or ’sh’ (Shared Read/Write). Default is ’rw’

    size
         以GB為單位的新建存儲大小夺蛇。
         size (in GB) to use if creating new storage

     sparse
         指定建立的存儲是否跳過完全分配。取值為 ’true’ 或 ’false’酣胀。
         whether to skip fully allocating newly created storage. Value is ’true’ or ’false’. Default is ’true’ (do not fully allocate).
         --所謂的完全分配是指在建立文件后即分配給其規(guī)定的所有空間刁赦,所謂的sparse是指根據(jù)使用情況逐漸增加空間。

         初始時對客戶機(jī)虛擬磁盤采用全分配策略(sparse=false)通常在客戶機(jī)內(nèi)部通過提供更快的安裝時間獲得平衡闻镶。因此在主機(jī)文件系統(tǒng)可能被填滿時推薦使用
         此選項以確保高性能和避免I/O錯誤甚脉。
         The initial time taken to fully-allocate the guest virtual disk (spare=false) will be usually by balanced by faster install times inside
         the guest. Thus use of this option is recommended to ensure consistently high performance and to avoid I/O errors in the guest should the
         host filesystem fill up.

     cache
         使用緩存模式,铆农,主機(jī)頁面緩存提供內(nèi)存緩存牺氨。此選項取值包括’none’, ’writethrough’, 或 ’writeback’, ’writethrough’提供讀緩存墩剖,’writeback’提供
         讀和寫緩存猴凹。
         The cache mode to be used. The host pagecache provides cache memory.  The cache value can be ’none’, ’writethrough’, or ’writeback’.
         ’writethrough’ provides read caching. ’writeback’ provides read and write caching.

     參加例子一節(jié)中的一些使用。這個選項屏蔽 "--file", "--file-size"和 "--nonsparse"選項岭皂。
     See the examples section for some uses. This option deprecates "--file", "--file-size", and "--nonsparse".

   -f DISKFILE, --file=DISKFILE
     指向作為客戶機(jī)虛擬磁盤后臺存儲的文件郊霎、磁盤分區(qū)或邏輯卷。這個選項與"--disk"選項指定一個即可爷绘。
     Path to the file, disk partition, or logical volume to use as the backing store for the guest’s virtual disk. This option is deprecated in
     favor of "--disk".

   -s DISKSIZE, --file-size=DISKSIZE
     作為客戶機(jī)虛擬磁盤的文件大小书劝。這個選項不能與"--disk"選項同時使用进倍。
     Size of the file to create for the guest virtual disk. This is deprecated in favor of "--disk".

   --nonsparse
     指定在建立存儲時機(jī)分配全部空間。這個選項不能與"--disk"選項同時使用庄撮。
     Fully allocate the storage when creating. This is deprecated in favort of "--disk"

   --nodisks
     請求一個沒有任何本地磁盤存儲的虛擬機(jī)背捌,典型應(yīng)用在運行’Live CD’映像或安裝到網(wǎng)絡(luò)存儲(iSCSI或NFS root)時毙籽。
     Request a virtual machine without any local disk storage, typically used for running ’Live CD’ images or installing to network storage (iSCSI
     or NFS root).

12洞斯、網(wǎng)絡(luò)配置選項(Networking Configuration)

   -w NETWORK, --network=NETWORK
     連接客戶機(jī)到主機(jī)網(wǎng)絡(luò)。"NETWORK"可采用一下任何一種值:
     Connect the guest to the host network. The value for "NETWORK" can take one of 3 formats:

     bridge:BRIDGE
         連接到主機(jī)上名稱為"BRIDGE"的橋接設(shè)備坑赡。如果主機(jī)具有靜態(tài)網(wǎng)絡(luò)配置和客戶機(jī)需要與局域網(wǎng)進(jìn)行全面的入站出站連接時使用此選項烙如。在客戶機(jī)使用在線遷移時也
         使用此選項。
         Connect to a bridge device in the host called "BRIDGE". Use this option if the host has static networking config & the guest requires full
         outbound and inbound connectivity  to/from the LAN. Also use this if live migration will be used with this guest.

     network:NAME
         連接到主機(jī)上名稱為"NAME"的虛擬網(wǎng)絡(luò)毅否。虛擬網(wǎng)絡(luò)可以使用"virsh"命令行工具列出亚铁、建立和刪除。未經(jīng)修改的“l(fā)ibvirt”安裝通常有一個名字為“default”的虛擬
         網(wǎng)絡(luò)螟加。在主機(jī)使用動態(tài)網(wǎng)絡(luò)或無線網(wǎng)時使用虛擬網(wǎng)絡(luò)徘溢。任何一個連接活動時客戶機(jī)將通過地址轉(zhuǎn)換將連接請求轉(zhuǎn)到局域網(wǎng)。
         Connect to a virtual network in the host called "NAME". Virtual networks can be listed, created, deleted using the "virsh" command line
         tool. In an unmodified install of "libvirt" there is usually a virtual network with a name of "default". Use a virtual network if the host
         has dynamic networking (eg NetworkManager), or using wireless. The guest will be NATed to the LAN by whichever connection is active.

     user
         使用SLIRP連接到局域網(wǎng)捆探。只有沒有特權(quán)的用戶運行一個QEMU客戶機(jī)時才使用本選項然爆。這種方法從網(wǎng)絡(luò)地址轉(zhuǎn)換(NAT)提供了非常有限的方式。
         Connect to the LAN using SLIRP. Only use this if running a QEMU guest as an unprivileged user. This provides a very limited form of NAT.

     如果忽略此選項黍图,將在客戶機(jī)中建立一個單網(wǎng)絡(luò)接口卡(NIC)曾雕,如果在主機(jī)中有一個與物理網(wǎng)卡綁定的橋接設(shè)備,將用此設(shè)備進(jìn)行網(wǎng)絡(luò)連接助被。做不到這一點剖张,被成之為
     "default"的虛擬網(wǎng)絡(luò)將被使用。這個選項可以被指定多次從而設(shè)置多個網(wǎng)卡揩环。
     If this option is omitted a single NIC will be created in the guest. If there is a bridge device in the host with a physical interface
     enslaved, that will be used for connectivity. Failing that, the virtual network called "default" will be used. This option can be specified
     multiple times to setup more than one NIC.

   -b BRIDGE, --bridge=BRIDGE
     指定連接客戶機(jī)網(wǎng)卡的橋接設(shè)備搔弄。這個參數(shù)不能與 "--network"選項共同使用。指定
     Bridge device to connect the guest NIC to. This parameter is deprecated in favour of the "--network" parameter.

   -m MAC, --mac=MAC
     指定客戶機(jī)網(wǎng)卡物理地址丰滑;如果忽略這個參數(shù)或者指定了值"RANDOM"顾犹,將隨機(jī)產(chǎn)生一個適當(dāng)?shù)牡刂贰?yīng)基于Xen的虛擬機(jī)吨枉,物理地址中最先的3對必須是’00:16:3e’蹦渣,
     而QEMU或KVM虛擬機(jī)必須是’54:52:00’。
     Fixed MAC address for the guest; If this parameter is omitted, or the value "RANDOM" is specified a suitable address will be randomly
     generated. For Xen virtual machines it is required that the first 3 pairs in the MAC address be the sequence ’00:16:3e’, while for QEMU or KVM
     virtual machines it must be ’54:52:00’.

   --nonetworks
     請求一個沒有任何網(wǎng)卡的虛擬機(jī)貌亭。
     Request a virtual machine without any network interfaces.

13柬唯、圖形化配置(Graphics Configuration)

   如果沒有指定圖形選項,在DISPLAY環(huán)境變量已經(jīng)設(shè)置的情況下圃庭,"virt-install" 將默認(rèn)使用--vnc選項锄奢,否則將使用--nographics選項失晴。
   If no graphics option is specified, "virt-install" will default to --vnc if the DISPLAY environment variable is set, otherwise --nographics is
   used.

   --vnc
     在客戶機(jī)中設(shè)置一個虛擬控制臺并且將其導(dǎo)出為一個VNC服務(wù)。除非"--vncport" 參數(shù)也已提供拘央,VNC服務(wù)將運行在5900或其之上第一個未用的端口號涂屁。實際的VNC顯示
     可以使用"virsh"的"vncdisplay"命令(或者使用virt-viewer處理這個細(xì)節(jié))。
     Setup a virtual console in the guest and export it as a VNC server in the host. Unless the "--vncport" parameter is also provided, the VNC
     server will run on the first free port number at 5900 or above. The actual VNC display allocated can be obtained using the "vncdisplay"
     command to "virsh" (or virt-viewer(1) can be used which handles this detail for the use).

   --vncport=VNCPORT
     為客戶機(jī)VNC控制臺請求一個永久灰伟、靜態(tài)的指定端口號拆又。當(dāng)其他客戶機(jī)自動選擇端口號時不鼓勵使用此選項,因為可能產(chǎn)生沖突栏账。
     Request a permanent, statically assigned port number for the guest VNC console. Use of this option is discouraged as other guests may
     automatically choose to run on this port causing a clash.

   --sdl
     在客戶機(jī)中設(shè)置一個虛擬控制臺并且在主機(jī)中顯示一個SDL窗口來呈現(xiàn)輸出帖族。如果SDL窗口被關(guān)閉,客戶機(jī)將被無條件終止挡爵。
     Setup a virtual console in the guest and display an SDL window in the host to render the output. If the SDL window is closed the guest may be
     unconditionally terminated.

   --nographics
     指定沒有控制臺被分配給客戶機(jī)竖般。全虛擬化客戶機(jī)(Xen FV或者QEMU/KVM)將需要在客戶機(jī)第一個串口有一個文本控制臺配置(這可以通過--extra-args選項實現(xiàn))。
     Xen PV將自動進(jìn)行設(shè)置茶鹃。命令’virsh console NAME’被用來連接串行設(shè)備涣雕。
     No graphical console will be allocated for the guest. Fully virtualized guests (Xen FV or QEmu/KVM) will need to have a text console
     configured on the first serial port in the guest (this can be done via the --extra-args option). Xen PV will set this up automatically. The
     command ’virsh console NAME’ can be used to connect to the serial device.

   --noautoconsole
     使用本選項指定不自動試圖連接到客戶機(jī)控制臺。默認(rèn)行為是調(diào)用一個VNC客戶端顯示圖形控制臺闭翩,或者運行 "virsh" "console"命令顯示文本控制臺挣郭。
     Don’t automatically try to connect to the guest console. The default behaviour is to launch a VNC client to display the graphical console, or
     to run the "virsh" "console" command to display the text console. Use of this parameter will disable this behaviour.

   -k KEYMAP, --keymap=KEYMAP
     請求將虛擬VNC控制臺配置為非英語鍵盤布局。
     Request that the virtual VNC console be configured to run with a non-English keyboard layout.

14男杈、Miscellaneous Options

   -d, --debug
     在安裝過程中丈屹,打印調(diào)試信息到終端。即使忽略此選項伶棒,調(diào)試信息也保存在當(dāng)前用戶home目錄下的.virtinst/virt-install.log文件中旺垒。
     Print debugging information to the terminal when running the install process.  The debugging information is also stored in
     "$HOME/.virtinst/virt-install.log" even if this parameter is omitted.

   --noreboot
     防止域(虛擬機(jī))在安裝完成后自動重啟。
     Prevent the domain from automatically rebooting after the install has completed.

   --wait=WAIT
     設(shè)置以分鐘為單位的等待虛擬機(jī)完成其安裝的時間肤无。沒有這個的選項先蒋,virt-install將等待控制臺關(guān)閉(不必要指示客戶機(jī)已經(jīng)關(guān)閉),或者在--noautoconsole選項
     指定的情況下宛渐,簡單地開始安裝并退出竞漾。任何負(fù)值將使virt-install無限等待,0值將觸發(fā)與--noauotoconsole選項相同的結(jié)果窥翩。如果超出時間限制业岁,virt-install只是
     簡單的退出,保留虛擬機(jī)在其當(dāng)前狀態(tài)寇蚊。
     Amount of time to wait (in minutes) for a VM to complete its install.  Without this option, virt-install will wait for the console to close
     (not neccessarily indicating the guest has shutdown), or in the case of --noautoconsole, simply kick off the install and exit. Any negative
     value will make virt-install wait indefinitely, a value of 0 triggers the same results as noautoconsole. If the time limit is exceeded, virt-
     install simply exits, leaving the virtual machine in its current state.

   --force
     防止交互式提示笔时。如果預(yù)期的提示為是/否,總是回答是仗岸。對應(yīng)任何其他提示允耿,應(yīng)用將退出借笙。
     Prevent interactive prompts. If the intended prompt was a yes/no prompt, always say yes. For any other prompts, the application will exit.

   --prompt
     提供交互模式,提示選擇和輸入建立虛擬機(jī)必要的信息较锡。默認(rèn)情況下提示功能是關(guān)閉的业稼。
     Specifically enable prompting for required information. Default prompting is off (as of virtinst 0.400.0)

15、例子(EXAMPLES)

   Install a KVM guest, creating a new storage file, virtual networking, booting from the host CDROM, using VNC server/viewer

     # virt-install \
          --connect qemu:///system \
          --name demo \
          --ram 500 \
          --disk path=/var/lib/libvirt/images/demo.img,size=5 \
          --network network:default \
          --accelerate \
          --vnc \
          --cdrom /dev/cdrom

   Install a Fedora 9 KVM guest, using LVM partition, virtual networking, booting from PXE, using VNC server/viewer

     # virt-install \
          --connect qemu:///system \
          --name demo \
          --ram 500 \
          --disk path=/dev/HostVG/DemoVM \
          --network network:default \
          --accelerate \
          --vnc \
          --os-variant fedora9

   Install a QEMU guest, with a real partition, for a different architecture using SDL graphics, using a remote kernel and initrd pair:

     # virt-install \
          --connect qemu:///system \
          --name demo \
          --ram 500 \
          --disk path=/dev/hdc \
          --network bridge:eth1 \
          --arch ppc64 \
          --arch ppc64 \
          --sdl \
          --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/

   Run a Live CD image under Xen fullyvirt, in diskless environment

     # virt-install \
          --hvm \
          --name demo \
          --ram 500 \
          --nodisks \
          --livecd \
          --vnc \
          --cdrom /root/fedora7live.iso

   Install a paravirtualized Xen guest, 500 MB of RAM, a 5 GB of disk, and Fedora Core 6 from a web server, in text-only mode, with old style
   --file options:

     # virt-install \
          --paravirt \
          --name demo \
          --ram 500 \
          --file /var/lib/xen/images/demo.img \
          --file-size 6 \
          --nographics \
          --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/

   Create a guest from an existing disk image ’mydisk.img’ using defaults for the rest of the options.

     # virt-install \
          --name demo
          --ram 512
          --disk path=/home/user/VMs/mydisk.img
          --import

FROMhttp://blog.csdn.net/starshine/article/details/6998189

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末蚂蕴,一起剝皮案震驚了整個濱河市低散,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌掂墓,老刑警劉巖谦纱,帶你破解...
    沈念sama閱讀 212,383評論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡川慌,警方通過查閱死者的電腦和手機(jī)吃嘿,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,522評論 3 385
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來梦重,“玉大人兑燥,你說我怎么就攤上這事∏倥。” “怎么了降瞳?”我有些...
    開封第一講書人閱讀 157,852評論 0 348
  • 文/不壞的土叔 我叫張陵,是天一觀的道長蚓胸。 經(jīng)常有香客問我挣饥,道長,這世上最難降的妖魔是什么沛膳? 我笑而不...
    開封第一講書人閱讀 56,621評論 1 284
  • 正文 為了忘掉前任扔枫,我火速辦了婚禮,結(jié)果婚禮上锹安,老公的妹妹穿的比我還像新娘短荐。我一直安慰自己,他們只是感情好叹哭,可當(dāng)我...
    茶點故事閱讀 65,741評論 6 386
  • 文/花漫 我一把揭開白布忍宋。 她就那樣靜靜地躺著,像睡著了一般风罩。 火紅的嫁衣襯著肌膚如雪糠排。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,929評論 1 290
  • 那天泊交,我揣著相機(jī)與錄音乳讥,去河邊找鬼柱查。 笑死,一個胖子當(dāng)著我的面吹牛云石,可吹牛的內(nèi)容都是我干的唉工。 我是一名探鬼主播,決...
    沈念sama閱讀 39,076評論 3 410
  • 文/蒼蘭香墨 我猛地睜開眼汹忠,長吁一口氣:“原來是場噩夢啊……” “哼淋硝!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起宽菜,我...
    開封第一講書人閱讀 37,803評論 0 268
  • 序言:老撾萬榮一對情侶失蹤谣膳,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后铅乡,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體继谚,經(jīng)...
    沈念sama閱讀 44,265評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,582評論 2 327
  • 正文 我和宋清朗相戀三年阵幸,在試婚紗的時候發(fā)現(xiàn)自己被綠了花履。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,716評論 1 341
  • 序言:一個原本活蹦亂跳的男人離奇死亡挚赊,死狀恐怖诡壁,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情荠割,我是刑警寧澤妹卿,帶...
    沈念sama閱讀 34,395評論 4 333
  • 正文 年R本政府宣布,位于F島的核電站蔑鹦,受9級特大地震影響夺克,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜举反,卻給世界環(huán)境...
    茶點故事閱讀 40,039評論 3 316
  • 文/蒙蒙 一懊直、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧火鼻,春花似錦室囊、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,798評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至粗蔚,卻和暖如春尝偎,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,027評論 1 266
  • 我被黑心中介騙來泰國打工致扯, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留肤寝,地道東北人。 一個月前我還...
    沈念sama閱讀 46,488評論 2 361
  • 正文 我出身青樓抖僵,卻偏偏與公主長得像鲤看,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子耍群,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 43,612評論 2 350

推薦閱讀更多精彩內(nèi)容