Virtual Machine on Fedora

From Klaus' wiki
Jump to: navigation, search

Be sure to have installed libvirt - yum install @virtualization should get the most necessary item installed.

Next ensure that the virtualisation is started

]$ systemctl start libvirtd

If needed enable the libvirtd if you want it to be started at every boot

]$ systenctl enable libvirtd.service

When installing a new virtual machine do ensure that it runs on the kvm virtualisation, not the qemu - qemu is an emulator and run very slow.

Virtual-running-kvm.png

Notice the Hypervisor

Networking

I have had some trouble accessing the network from the virtuals.

I found these instructions and performed as shown below while logged in as standard user:

]$ virsh net-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes
 
]$ virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml
]$ virsh net-autostart default
Network default marked as autostarted
]$ virsh net-start default
Network default started
 
]$ brctl show
bridge name	bridge id		STP enabled	interfaces
virbr0		8000.000000000000	yes

Finally, as root, in /etc/sysctl.d/99-sysctl.conf add this line

 net.ipv4.ip_forward = 1

And a reboot to get the networking up running with the new settings.

With two virtuals running I get this:

\source lang="bash"> ]$ brctl show bridge name bridge id STP enabled interfaces virbr0 8000.fe5400249719 yes vnet0

                                                       vnet1
                                                       vnet2                                                                             
                                                       vnet3                                                                             
                                                       vnet4                                                                             
                                                       vnet5   

</source>