lost and found ( for me ? )

Ubuntu 13.04: install Fedora 20 VM within KVM



root@ubuntu-1:~# tail -1 /etc/lsb-release ;uname -ri
DISTRIB_DESCRIPTION="Ubuntu 13.04"
3.8.0-35-generic x86_64

root@ubuntu-1:~# qemu-system-x86_64 --version
QEMU emulator version 1.4.0 (Debian 1.4.0+dfsg-1expubuntu4), Copyright (c) 2003-2008 Fabrice Bellard
root@ubuntu-1:~# libvirtd --version
libvirtd (libvirt) 1.0.2

Build Fedora20 VM with virt-manager.

OS: Linux
Version: Fedora 17 ( there are not Fedora20 in the list )


Here is an xml file of Fedora20 VM.
# virsh dumpxml f20-vm1
<domain type='kvm' id='5'>
 <name>f20-vm1</name>
 <uuid>3bd67183-b2ab-70f3-28f4-6af23fb81ea5</uuid>
 <memory unit='KiB'>1048576</memory>
 <currentMemory unit='KiB'>1048576</currentMemory>
 <vcpu placement='static'>1</vcpu>
 <os>
   <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
   <boot dev='cdrom'/>
 </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/bin/kvm</emulator>
   <disk type='file' device='disk'>
     <driver name='qemu' type='qcow2'/>
     <source file='/var/lib/KVM_images/f20-vm1.qcow2'/>
     <target dev='vda' bus='virtio'/>
     <alias name='virtio-disk0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
   </disk>
   <disk type='file' device='cdrom'>
     <driver name='qemu' type='raw'/>
     <source file='/home/hattori/ISO_files/Fedora-20-x86_64-DVD.iso'/>
     <target dev='hdc' bus='ide'/>
     <readonly/>
     <alias name='ide0-1-0'/>
     <address type='drive' controller='0' bus='1' target='0' unit='0'/>
   </disk>
   <controller type='usb' index='0'>
     <alias name='usb0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
   </controller>
   <controller type='ide' index='0'>
     <alias name='ide0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   </controller>
   <interface type='network'>
     <mac address=''/>
     <source network='default'/>
     <target dev='vnet5'/>
     <model type='virtio'/>
     <alias name='net0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>
     <source path='/dev/pts/6'/>
     <target port='0'/>
     <alias name='serial0'/>
   </serial>
   <console type='pty' tty='/dev/pts/6'>
     <source path='/dev/pts/6'/>
     <target type='serial' port='0'/>
     <alias name='serial0'/>
   </console>
   <input type='tablet' bus='usb'>
     <alias name='input0'/>
   </input>
   <input type='mouse' bus='ps2'/>
   <graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1' keymap='ja'>
     <listen type='address' address='127.0.0.1'/>
   </graphics>
   <video>
     <model type='cirrus' vram='9216' heads='1'/>
     <alias name='video0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
   </video>
   <memballoon model='virtio'>
     <alias name='balloon0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
   </memballoon>
 </devices>
 <seclabel type='none'/>
</domain>

The installation is very easy. just click, click..

done.

[ Enable virsh console access ]

On the F20 VM

Add “ttyS0” in /etc/securetty
# echo ttyS0 >> /etc/securetty

Add “console=ttyS0,115200” in /etc/default/grub
# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rhgb quiet console=ttyS0,115200"
GRUB_DISABLE_RECOVERY="true"

Update grub.cfg
# grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot the VM
# reboot

Access to the VM from KVM host via virsh console.
virsh # console f20-vm1
ドメイン f20-vm1 に接続しました
エスケープ文字は ^] です

Fedora release 20 (Heisenbug)
Kernel 3.12.6-300.fc20.x86_64 on an x86_64 (ttyS0)

localhost login: root
パスワード:
[root@localhost ~]#
[root@localhost ~]# cat /etc/fedora-release
Fedora release 20 (Heisenbug)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.