Linux

使用 virt-install 在 CentOS 6.6 上安裝 VM 掛起

  • June 8, 2015

我正在嘗試使用以下命令在 CentOS 6.6 主機上安裝 Centos 6.6 VM。

virt-install \
--name vm-queue \
--description "Queue Server" \
--ram 2048 \
--disk path=/var/kvm/images/vm-queue.img,size=30 \
--vcpus 2 \
--os-type linux \
--os-variant rhel6 \
--network bridge=br0 \
--graphics none \
--console pty,target_type=serial \
--cdrom /var/iso/CentOS-6.6-x86_64-minimal.iso

我得到一個引導螢幕,讓我選擇一個安裝選項。

在此處輸入圖像描述

當我按下輸入鍵時,我得到了

Loading vmlinuz......
Loading initrd.img....................................ready.
Probing EDD (edd=off to disable)... ok

然後我在左下角看到一個游標,大約 3-4 秒後,我看到了.

在此處輸入圖像描述

我讓它坐了一個小時,沒有任何反應。

據我所知,該安裝線中的所有內容都很酷。該機有2個4核處理器,96G記憶體,橋接工作。

/var/log/libvirt/libvirtd.log在安裝過程中沒有得到任何東西。但是,當我最終不得不Enter++~終止.會話時,我得到了

14232: error : daemonStreamHandleAbort:609 : stream aborted at client request
14232: error : virNetSocketReadWire:1194 : End of file while reading data: Input/output error

然後當我終止程序時。

14232: error : qemuMonitorIO:615 : internal error End of file from monitor

有人知道我在嘗試安裝時得到的隨機字元是怎麼回事嗎?

如果有人需要,這裡是 libvirt 創建的 XML 文件

<domain type='kvm'>
 <name>vm-queue</name>
 <uuid>de964c10-fdc3-ddad-96d3-c885bd9c1661</uuid>
 <description>Queue Server</description>
 <memory unit='KiB'>2097152</memory>
 <currentMemory unit='KiB'>2097152</currentMemory>
 <vcpu placement='static'>2</vcpu>
 <os>
   <type arch='x86_64' machine='rhel6.6.0'>hvm</type>
   <boot dev='hd'/>
 </os>
 <features>
   <acpi/>
   <apic/>
   <pae/>
 </features>
 <clock offset='utc'/>
 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>restart</on_crash>
 <devices>
   <emulator>/usr/libexec/qemu-kvm</emulator>
   <disk type='file' device='disk'>
     <driver name='qemu' type='raw' cache='none'/>
     <source file='/var/kvm/images/vm-queue.img'/>
     <target dev='vda' bus='virtio'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
   </disk>
   <disk type='block' device='cdrom'>
     <driver name='qemu' type='raw'/>
     <target dev='hdc' bus='ide'/>
     <readonly/>
     <address type='drive' controller='0' bus='1' target='0' unit='0'/>
   </disk>
   <controller type='usb' index='0' model='ich9-ehci1'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x7'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci1'>
     <master startport='0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0' multifunction='on'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci2'>
     <master startport='2'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x1'/>
   </controller>
   <controller type='usb' index='0' model='ich9-uhci3'>
     <master startport='4'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x2'/>
   </controller>
   <controller type='ide' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   </controller>
   <interface type='bridge'>
     <mac address='52:54:00:bd:ac:6e'/>
     <source bridge='br0'/>
     <model type='virtio'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>
     <target port='0'/>
   </serial>
   <console type='pty'>
     <target type='serial' port='0'/>
   </console>
   <input type='tablet' bus='usb'/>
   <memballoon model='virtio'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
   </memballoon>
 </devices>
</domain>

您似乎正在嘗試使用串列控制台而不是普通控制台進行安裝。不知道你為什麼這樣做,但是……

預設情況下,安裝程序會嘗試在 Linux 控制台上顯示文本或圖形。要將輸出轉移到串列控制台,您需要Tab在引導螢幕上點擊,並確保將以下選項添加到引導命令行:

text console=ttyS0

引用自:https://serverfault.com/questions/697474