lost and found ( for me ? )

Ubuntu 13.04: install Fedora 20 VM within KVM

root@ubuntu-1:~# tail -1 /etc/lsb-release ;uname -ri
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'>
 <memory unit='KiB'>1048576</memory>
 <currentMemory unit='KiB'>1048576</currentMemory>
 <vcpu placement='static'>1</vcpu>
   <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
   <boot dev='cdrom'/>
 <clock offset='utc'/>
   <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 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'/>
     <alias name='ide0-1-0'/>
     <address type='drive' controller='0' bus='1' target='0' unit='0'/>
   <controller type='usb' index='0'>
     <alias name='usb0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
   <controller type='ide' index='0'>
     <alias name='ide0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   <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'/>
   <serial type='pty'>
     <source path='/dev/pts/6'/>
     <target port='0'/>
     <alias name='serial0'/>
   <console type='pty' tty='/dev/pts/6'>
     <source path='/dev/pts/6'/>
     <target type='serial' port='0'/>
     <alias name='serial0'/>
   <input type='tablet' bus='usb'>
     <alias name='input0'/>
   <input type='mouse' bus='ps2'/>
   <graphics type='vnc' port='5903' autoport='yes' listen='' keymap='ja'>
     <listen type='address' address=''/>
     <model type='cirrus' vram='9216' heads='1'/>
     <alias name='video0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
   <memballoon model='virtio'>
     <alias name='balloon0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
 <seclabel type='none'/>

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


[ 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_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
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"

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.