From 8279cf1e828f1fe44a2c744d674b808777245b55 Mon Sep 17 00:00:00 2001 From: Dayle Parker Date: Thu, 14 Dec 2017 16:37:37 +1000 Subject: [PATCH] added virtualization topics --- en-US/modules/con_qemu_libvirt.adoc | 0 .../proc_creating_virtual_machines.adoc | 53 ++++++++ ...oc_installing_virtualization_software.adoc | 83 ++++++++++++ .../proc_managing_virtual_machines.adoc | 125 ++++++++++++++++++ .../ref_other_virtualization_options.adoc | 47 +++++++ 5 files changed, 308 insertions(+) create mode 100644 en-US/modules/con_qemu_libvirt.adoc create mode 100644 en-US/modules/proc_creating_virtual_machines.adoc create mode 100644 en-US/modules/proc_installing_virtualization_software.adoc create mode 100644 en-US/modules/proc_managing_virtual_machines.adoc create mode 100644 en-US/modules/ref_other_virtualization_options.adoc diff --git a/en-US/modules/con_qemu_libvirt.adoc b/en-US/modules/con_qemu_libvirt.adoc new file mode 100644 index 0000000..e69de29 diff --git a/en-US/modules/proc_creating_virtual_machines.adoc b/en-US/modules/proc_creating_virtual_machines.adoc new file mode 100644 index 0000000..ba6efbd --- /dev/null +++ b/en-US/modules/proc_creating_virtual_machines.adoc @@ -0,0 +1,53 @@ +[[creating-a-fedora-guest]] +== Creating a Fedora guest + +The installation of Fedora guests using Anaconda is supported. The +installation can be started on the command-line using the `virt-install` +program or in the user interface program `virt-manager`. + +[[creating-a-guest-with-virt-install]] +Creating a guest with virt-install + + +`virt-install` is a command-line based tool for creating virtualized +guests. Refer to +http://virt-tools.org/learning/install-with-command-line/ for +understanding how to use this tool. Execute `virt-install --help` for +command line help. + +`virt-install` can use kickstart files, for example +`virt-install -x ks=kickstart-file-name.ks`. + +If graphics were enabled, a VNC window will open and present the +graphical installer. If graphics were not enabled, a text installer will +appear. Proceed with the Fedora installation. + +[[creating-a-guest-with-virt-manager]] +=== Creating a guest with virt-manager + +. Start Virtual Machine Manager by navigating to +menu:Applications[System Tools], or by running the following command: ++ +---- +$ su -c "virt-manager" +---- ++ +[NOTE] +==== +If you encounter an error message when starting Virtual Machine Manager, run the above command as a non-root user, without the `su -c`. +The user interface will prompt for the root password. +==== ++ +. Open a connection to a hypervisor by navigating to menu:File[Add +connection]. +. Choose *qemu* for KVM, or *Xen* for Xen. +. Choose *local* or select a method to connect to a remote hypervisor. +. After a connection is opened, click the new icon next to the +hypervisor, or right-click on the active hypervisor and select *New*. +. Configure the virtual machine following the steps in the *New VM* wizard. +. Click *Finish* at the end of the wizard to provision the guest operating system. After a few moments a VNC +window will appear. Proceed with the Fedora installation. + + + + diff --git a/en-US/modules/proc_installing_virtualization_software.adoc b/en-US/modules/proc_installing_virtualization_software.adoc new file mode 100644 index 0000000..bce8894 --- /dev/null +++ b/en-US/modules/proc_installing_virtualization_software.adoc @@ -0,0 +1,83 @@ +[[installing-the-virtualization-packages]] +== Installing the virtualization packages + +When installing Fedora, you can install the virtualization packages by +selecting *Virtualization* in the *Base Group* in the installer. See https://docs.fedoraproject.org/f27/install-guide/install/Installing_Using_Anaconda.html[Installing Using Anaconda]. + + +For existing Fedora installations, you can install the virtualization tools via the command line using the Virtualization Package Group. To view the packages, run: ++ +---- +$ dnf groupinfo virtualization + +Group: Virtualization +Group-Id: virtualization +Description: These packages provide a virtualization environment. + +Mandatory Packages: + =virt-install + +Default Packages: + =libvirt-daemon-config-network + =libvirt-daemon-kvm + =qemu-kvm + =virt-manager + =virt-viewer + +Optional Packages: + guestfs-browser + libguestfs-tools + python-libguestfs + virt-top +---- ++ +. Run the following command to install the mandatory and default packages in the virtualization group: ++ +---- +$ su -c "dnf install @virtualization" +---- ++ +Alternatively, to install the mandatory, default, and optional packages, run: ++ +---- +$ su -c "dnf group install with-optional virtualization" +---- ++ +. After the packages install, start the `libvirtd` service: ++ +---- +$ su -c systemctl start libvirtd +---- ++ +To start the service on boot, run: ++ +---- +$ su -c systemctl enable libvirtd +---- ++ +. To verify that the KVM kernel modules are properly loaded: ++ +---- +$ lsmod | grep kvm +kvm_amd 55563 0 +kvm 419458 1 kvm_amd +---- ++ +If this command lists `kvm_intel` or `kvm_amd`, KVM is properly +configured. See How_to_debug_Virtualization_problems#Ensuring_system_is_KVM_capable[ +Ensuring system is KVM capable] for troubleshooting tips. (NEEDS EDITING) + +[[networking-support]] +=== Networking Support + +By default, libvirt will create a private network for your guests on the +host machine. This private network will use a 192.168.x.x subnet and not +be reachable directly from the network the host machine is on. However, +virtual guests can use the host machine as a gateway and can connect out +via it. If you need to provide services on your guests that are +reachable via other machines on your host network you can use iptables +DNAT rules to forward in specific ports, or you can set up a bridged environment. + +See the http://wiki.libvirt.org/page/Networking[libvirt networking setup +page] for more information on how to setup a bridged network. + diff --git a/en-US/modules/proc_managing_virtual_machines.adoc b/en-US/modules/proc_managing_virtual_machines.adoc new file mode 100644 index 0000000..10a2ef9 --- /dev/null +++ b/en-US/modules/proc_managing_virtual_machines.adoc @@ -0,0 +1,125 @@ +[[managing-virtual-machines]] +== Managing Virtual Machines + +When the installation of the guest operating system is complete, it can +be managed using the `virt-manager` program or via command line +using `virsh`. + +[[managing-guests-with-virt-manager]] +=== Managing guests with virt-manager + +. Start the Virtual Machine Manager by navigating to +menu:[Applications]System Tools, or run: ++ +---- +$ su -c "virt-manager" +---- ++ +If you are not root, you will be prompted to enter the root +password. Choose `Run unprivileged` to operate in read-only non-root +mode. ++ +. Choose the host you wish to manage and click *Connect* in the "Open +Connection" dialog window. +. The list of virtual machines is displayed in the main window. Guests +that are running will display a ">" icon. Guests that are not running +will be greyed out. +. To manage a particular guest, double click on it, or right click and +select "Open". +. A new window for the guest will open that will allow you to use its +console, see information about its virtual hardware and start, stop, and pause +it. + +For further information about `virt-manager`, see +http://virt-manager.et.redhat.com/. + +Bugs in the `virt-manager` tool should be reported in +http://bugzilla.redhat.com[Bugzilla] against the `virt-manager` +component. + +[[managing-guests-with-virsh]] +=== Managing guests with virsh + +The `virsh` command line utility allows you to manage virtual +machines on the command line. The `virsh` utility is built around the libvirt management API: + +* `virsh` has a stable set of commands whose syntax and semantics are +preserved across updates to the underlying virtualization platform. +* `virsh` can be used as an unprivileged user for read-only operations +(e.g. listing domains, listing domain statistics). +* `virsh` can manage domains running under Xen, QEMU/KVM, ESX or other +back-ends with no perceptible difference to the user. + +To start a virtual machine: ++ +---- +$ su -c "virsh create " +---- + + +To list the virtual machines currently running: ++ +---- +$ su -c "virsh list" +---- + +To list all virtual machines, running or not: ++ +---- +$ su -c "virsh list --all" +---- + +To gracefully power off a guest: ++ +---- +$ su -c "virsh shutdown " +---- + +To non gracefully power off a guest: ++ +---- +$ su -c "virsh destroy " +---- + +To save a snapshot of the machine to a file: ++ +---- +$ su -c "virsh save " +---- + +To restore a previously saved snapshot: ++ +---- +$ su -c "virsh restore " +---- + +To export the configuration file of a virtual machine: ++ +---- +$ su -c "virsh dumpxml