Troubleshooting virtualization
SELinux
The SELinux policy in Fedora has the necessary rules to allow the use of virtualization. The main caveat to be aware of is that any file backed disk images need to be in the directory /var/lib/libvirt/images
. This applies both to regular disk images, and ISO images. Block device backed disks are already labelled correctly to allow them to pass SELinux checks.
Beginning with Fedora 11, virtual machines under SELinux are isolated from each other with sVirt.
Log files
The graphical interface, virt-manager
, used to create and manage
virtual machines, logs to $HOME/.virt-manager/virt-manager.log
.
The virt-install
tool, used to create virtual machines, logs to $HOME/.virtinst/virt-install.log
Logging from virt-manager
and virt-install
may be increased by setting the environment variable LIBVIRT_DEBUG=1
.
See http://libvirt.org/logging.html
All QEMU command lines executed by libvirt
are logged to /var/log/libvirt/qemu/$DOMAIN.log
where $DOMAIN
is the name of the guest.
The libvirtd
daemon is responsible for handling connections from
tools such as virsh
and virt-manager
.
The level and type of logging produced by libvirtd
may be modified in /etc/libvirt/libvirtd.conf
.
Serial console access for troubleshooting and management
Serial console access is useful for debugging kernel crashes and remote management can be very helpful.
Fully-virtualized guest OS will automatically have a serial console configured, but the guest kernel will not be configured to use this out of the box. To enable the guest console in a Linux fully-virt guest, edit the /etc/grub.conf in the guest and add 'console=ttyS0 console=tty0'. This ensures that all kernel messages get sent to the serial console, and the regular graphical console. The serial console can then be access in same way as paravirt guests:
su -c "virsh console <domain name>"
Alternatively, the graphical virt-manager
program can display the serial console. Simply display the 'console' or 'details' window for the guest & select 'View -> Serial console' from the menu bar.
Graphical console access
In order to get a graphical console on your guest you can either use 'virt-manager' and select the console icon for the guest, or you can use the 'virt-viewer' tool to just directly connect to the console:
virt-viewer guestname
Accessing data on guest disk images
The 'guestfish' package allows you to use a simple shell interface to manipulate guest disk images without needing to run the guest.
su -c 'yum install guestfish'
See 'man guestfish' and guestfish recipes for information and some common recipes. guestfish can also be scripted to change a group of guest disk images in a row.
Getting help
If the Troubleshooting section above does not help you to solve your problem, check the list of existing virtualization bugs, and search the archives of the mailing lists in the resources section. If you believe your problem is a previously undiscovered bug, please report it to Bugzilla.
Resources
Mailing lists
- Fedora
virt
mailing list
- Xen discussion
- Virtual Machine Manager,
virt-inst
and related tools
- Red Hat
virt-tools-list
mailing list
- Libvirt discussion
- Red Hat
libvir-list
mailing list
IRC Channels
- Some support for libvirt can be found in the #fedora channel on irc.freenode.net
- More specific libvirt support can be found in #virt on irc.oftc.net.
Documentation
The Virtulization guide can be found at https://fedorahosted.org/Virtualization_Guide/
References
- http://www-128.ibm.com/developerworks/linux/library/l-linux-kvm/?ca=dgr-lnxw07LinuxKVM
- http://kerneltrap.org/node/8088
Previous Fedora Virtualization Guides: