Using Xen Functionality

    Good day. The Xen virtualization environment allows us to fairly flexibly manage the hardware resources of our server for maximum performance. For comfortable management of virtual machines, displaying more detailed logs, managing allocated memory and processor cores, and conducting full monitoring of RAM consumption, so-called feedback between the host and virtual machine is required. This connection is achieved by installing a set of utilities called “Xen tools” or “Xen guest utilities”. This publication is dedicated to them.

    So we have several host machines with Xen servers installed on them and a zoo of different virtual machines spinning on them (different tasks require different tools for solving). 60% of the zoo are Windows-based machines (win 7 32/64, win serv 2003/2008, there are even a couple of XP), the rest are based on Ubuntu Server / Debian / Centos and there are a couple of machines based on FreeBSD (one of them is the pfSense router 2.2). And it was these machines that stood out in XenCenter by the lack of many convenient functions and white spots in the summary statistics.

    And an annoying inscription:

    XenServer Tools not installed

    image

    With Windows-based virtual machines, it is very easy to deal with such a problem simply by clicking on this inscription, or by right-clicking on the machine in the list of virtual machines and selecting Install XenServer Tools ... - then a mini-image containing these utilities and depending on the system settings, installation will begin (or a request for installation will appear, or nothing will appear and you will need to go into the virtual disk yourself and select the file “installwizard.msi” to start it). Installing XenTools requires .Net Framework 4.0. During the installation process, the system will require a reboot. After which the remaining components will be installed and the system will be ready for battle.

    A bit more complicated with the Linux family of OS.
    To get started, you also need to connect the mini-image to our virtual OS. The next step is to mount this mini-image in the system - here the following command comes to our aid:

    mount /dev/cdrom /mnt
    

    The next step:

    bash /mnt/Linux/install.sh
    

    Personally, I usually look at the contents of a mounted directory with:

    ls -l /mnt
    ls -l /mnt/Linux
    

    After which I install the desired package, for example like this:

    dpkg -i /mnt/Linux/xe-guest-utilities_6.1.0-1031_amd64.deb
    

    At the end of the installation, unmount the CD-Rom:

    umount /mnt
    

    And we overload the machine:

    reboot
    

    After the reboot, the scary inscription disappears and tasty buns become available to us ...

    The most difficult thing was to make friends with the Freebsd OS, and more specifically with the FreeBSD 10.1 pfSense 2.2 assembled on the base.
    So, for a clean FreeBSD, the sequence of actions is as follows:

    pkg install xe-guest-utilities
    

    After waiting for the package to load and install, we will make changes to the startup file etc / rc.conf:

    ee /etc/rc.conf
    

    In this file you need to add the following line:

    xenguest_enable = "YES"
    At the end of the file, you must save and reboot the machine.

    reboot
    

    To check the operation of the service without rebooting, you can start the service with the command:

    service xenguest start
    

    Well, for the sweet pfSense. In fact, there are not so many differences, but they are there, set implicitly and spoiled a little drops of blood. Installation is performed by the same command:

    pkg install xe-guest-utilities
    

    And here is the attention, the rc.conf file - it is deleted upon reboot and its contents are not read, therefore we add the entry for autoload to the /etc/rc.conf.local file:

    ee /etc/rc.conf.local
    

    Since pfSense will not allow us to run a script without a .sh extension at startup, we make a symlink on it:

    ln -s /usr/local/etc/rc.d/xenguest /usr/local/etc/rc.d/xenguest.sh
    

    After that, you can overload and enjoy the result:

    reboot
    

    I hope this material, collected in one place, saves your nerves from a long search, do not forget to backup data and snapshots of machines before experiments.

    All the best.

    Also popular now: