public:kvm:install
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
public:kvm:install [2023/07/24 08:31] – [Install ntp on a virtual host?] removed dead links and old statements wiki.manager | public:kvm:install [2024/08/14 15:48] (current) – [Installation sources] Version update Thomas Kornack | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Installation ===== | ||
+ | ==== Installation sources ==== | ||
+ | === Ubuntu === | ||
+ | On Ubuntu libvirt-daemon packages are provided by the Ubuntu package sources. Current Ubuntu versions provide the following libvirt-daemon versions: | ||
+ | ^ Ubuntu \\ version ^ Release \\ date ^ Version of \\ libvirt-daemon | ||
+ | | 18.04 LTS (Bionic Beaver) | 27. 04. 2018 | 4.0.0 | | ||
+ | | 20.04 LTS (Focal Fossa) | 23. 04. 2020 | 6.0.0 | | ||
+ | | 22.04 LTS (Jammy Jellyfish) | 21. 04. 2022 | 8.0.0 | | ||
+ | === Debian === | ||
+ | On Debian the libvirt-bin packages are also provided by the Debian package sources. Current Debian provides the following libvirt-daemon versions: | ||
+ | ^ Debian \\ version ^ Release \\ date ^ Version of \\ libvirt-daemon | ||
+ | | 10 (Buster) | 06. 07. 2019 | 5.0.0 | | ||
+ | | 11 (Bullseye) | 14. 08. 2021 | 7.0.0 | | ||
+ | | 12 (Bookworm) | 10. 06. 2023 | 9.0.0 | | ||
+ | We are currently using v9.0.0 of libvirt-daemon on Debian 12. | ||
+ | ==== Debian 9 and LVM ==== | ||
+ | Some defaults for configuring LVM were changed on Debian 9. The default lvm configuration file / | ||
+ | global { | ||
+ | ... | ||
+ | # Configuration option global/ | ||
+ | # Use lvmetad to cache metadata and reduce disk scanning. | ||
+ | # When enabled (and running), lvmetad provides LVM commands with VG | ||
+ | # metadata and PV state. LVM commands then avoid reading this | ||
+ | # information from disks which can be slow. When disabled (or not | ||
+ | # running), LVM commands fall back to scanning disks to obtain VG | ||
+ | # metadata. lvmetad is kept updated via udev rules which must be set | ||
+ | # up for LVM to work correctly. (The udev rules should be installed | ||
+ | # by default.) Without a proper udev setup, changes in the system' | ||
+ | # block device configuration will be unknown to LVM, and ignored | ||
+ | # until a manual ' | ||
+ | ... | ||
+ | use_lvmetad = 1 | ||
+ | As a result, the service ' | ||
+ | When using KVM with iSCSI or other distributed file systems set the option '' | ||
+ | While ' | ||
+ | pvscan --cache ; vgscan --cache ; lvscan --cache | ||
+ | |||
+ | ==== Partitioning ==== | ||
+ | For most of the installed KVM hosts the following partitioning was used: | ||
+ | ^ No. ^ Partition ^ Type ^ Size ^ File system ^ Mount point ^ | ||
+ | | 1. | /dev/sda1 | primary | 250 MB | ext2 | /boot | | ||
+ | | 2. | /dev/sda2 | primary | 16/32 GB | none | swap | | ||
+ | | 3. | /dev/sda3 | primary | 15 GB | ext4 | / | | ||
+ | | 4. | /dev/sda4 | primary | remainder | LVM | see below | | ||
+ | === Explanation of the partitioning: | ||
+ | == 1. Boot-Partition == | ||
+ | A boot partition is used for two reasons: | ||
+ | * it is a precondition for encrypting the host later and | ||
+ | * the file system ' | ||
+ | == 2. Swap-Partition == | ||
+ | According to the guidelines of [[wp> | ||
+ | == 3. System partition == | ||
+ | For a normal installation of Linux Ubuntu a partition size of 15 GB should be OK. Bigger data structures such as e.g. vhost images should rather be stored on separate partitions than on the system partition.\\ | ||
+ | == 4. LVM-Partiton == | ||
+ | The remainder of the disk space is managed by [[wp> | ||
+ | The partition should contain enough unused disk space for creating snapshots (e.g. 20 – 50 GB). | ||
+ | ==== Add a serial console ==== | ||
+ | Administration of virtual hosts is much easier when there is a simple way to access the console of a virtual host. One of the simplest ways of access is the access to a serial console: | ||
+ | root@kvm55: | ||
+ | Such serial access is possible when a serial console was properly added to the vhost with the following two steps: | ||
+ | * Add the serial console to the definition of the vhost | ||
+ | * Add the serial console inside the vhost | ||
+ | === Add the serial console to the vhost definition === | ||
+ | A serial console can be added to the vhost definition from the command line of the host running kvm: | ||
+ | root@kvm55: | ||
+ | <target port=' | ||
+ | < | ||
+ | < | ||
+ | === Add the serial console inside the vhost === | ||
+ | In order to enable the vhost to use a serial console for output the serial console has to be defined as device inside the vhost: | ||
+ | root@vhost: | ||
+ | root@vhost: | ||
+ | root@vhost: | ||
+ | When boot messages and messages from the boot manager ' | ||
+ | root@vhost: | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=\" | ||
+ | / | ||
+ | root@vhost: | ||
+ | GRUB_CMDLINE_LINUX=\" | ||
+ | / | ||
+ | root@vhost: | ||
+ | serial\“\nGRUB_SERIAL_COMMAND=serial --unit=0 --speed=115200 --word=8 \ | ||
+ | --parity=no --stop=1\"/ | ||
+ | root@vhost: | ||
+ | |||
+ | ==== Adapt the keyboard layout ==== | ||
+ | In order to use a German keyboard for Ubuntu when accessing the vhost virtual console via [[wp> | ||
+ | The German keyboard settings can be added to the xml vhost definition file like so: | ||
+ | root@kvm55: | ||
+ | < | ||
+ | For Debian vhosts the VNC settings don't need to be changed. Debian uses the client' | ||
+ | ==== Install ntp on a virtual host? ==== | ||
+ | In times of increasing use of [[wp> | ||
+ | There has been controversial discussions and contradicting statements about the use of ' | ||
+ | Newer statements admit, that the use of a ntpd service inside the affected vhosts is advised. Compare e.g. the [[https:// | ||
+ | As a conclusion the ntpd configuraton of physical and virtual host does not necessarily need to differ when using KVM as virtualization technology.\\ | ||
+ | \\ | ||
+ | [[public: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
public/kvm/install.txt · Last modified: 2024/08/14 15:48 by Thomas Kornack