-
Notifications
You must be signed in to change notification settings - Fork 24
/
centos4.sh
38 lines (28 loc) · 945 Bytes
/
centos4.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
virt-install \
--virt-type kvm \
--name=centos4 \
--os-variant=rhel4.9 \
--vcpus 1 \
--memory 1024 \
--disk path=~/centos4.qcow2,format=qcow2,sparse=true,bus=sata \
--graphics spice \
--video qxl \
--network bridge=br0,model=virtio \
--metadata title='CentOS 4.9' \
--import
<<COMMENTS
to use the virtio-blk driver, boot the guest with sata configured, then run:
mkinitrd --with virtio_pci --with virtio_blk -f /boot/initrd-$(uname -r).img $(uname -r)
edit /boot/grub/device.map, replacing sda with vda:
(hd0) /dev/vda
then virsh edit the xml and swap from sata to virtio-blk (not virtio-scsi):
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='~/centos4.qcow2'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</disk>
COMMENTS