Live CDの入手と配備
CentOS-5.5-x86_64-LiveCD.isoをCentOSミラーサイトからダウンロードして/var/lib/libvirt/images/に置きます(場所はどこでも可)。KVMでゲストを起動
libvirtで起動しようと試みましたが失敗(後述)したので、qemu-kvmコマンドで起動します。/usr/libexec/qemu-kvm -m 1024 -smp 1 -boot d \ -drive file=/var/lib/libvirt/images/vm1.img,if=ide \ -cdrom /var/lib/libvirt/images/CentOS-5.5-x86_64-LiveCD.iso \ -vnc localhost:1
この後UltraVNCなどのvncviewerで接続します。
(失敗メモ) libvirtでCD-ROMからブートを試みるも失敗
/etc/libvirt/qemu/vm1.xmlを以下のように書き換えます。
<domain type='kvm'>
<name>ora1</name>
<uuid>97f129e6-9b87-9998-0247-d573d774be81</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='rhel5.4.0'>hvm</type>
<boot dev='cdrom'/>
<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' cache='none'/>
<source file='/var/lib/libvirt/images/vm1.img'/>
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu'/>
<source file='/var/lib/libvirt/images/CentOS-5.5-x86_64-LiveCD.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='network'>
<mac address='54:52:00:54:37:df'/>
<source network='default'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
</devices>
</domain>
変更内容は<boot dev='cdrom'/>と
<disk type='file' device='cdrom'>
<driver name='qemu'/>
<source file='/var/lib/libvirt/images/CentOS-5.5-x86_64-LiveCD.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
の追加です。上記の定義を反映。
# virsh define /etc/libvirt/qemu/vm1.xml
起動してコンソールに接続
# virsh start vm1; virsh console vm1
gparted-live-0.7.1-1.isoもダウンロードして/var/lib/libvirt/images/に配置し、
<source file='/var/lib/libvirt/images/CentOS-5.5-x86_64-LiveCD.iso'/>
を
<source file='/var/lib/libvirt/images/gparted-live-0.7.1-1.iso'/>
に変えてみても同じでした。
おそらくCentOS-5.5-x86_64-LiveCD.isoとgparted-live-0.7.1-1.isoはシリアルコンソールで繋がるように作られていないということなのかと思います。
0 件のコメント:
コメントを投稿