virt-manager + libvirt + KVM on Debian mini-HOWTO

Long story short, you can seem KVM as replacement of VMware, XEN, VirtualBox, and so on (If you don't know what am I talking about, please give a look about what is Virtualization).

If you have play with similar solutions once before, the virtualization GUI shouldn't be new to you. The virtualization GUI usually provide an interface for client creation, managment and also operation, e.g. when you start a virtual client, the GUI will provide a window for it and display its screen message as like as real PC. So any similar solution for KVM? Yes, virt-manager (http://virt-manager.et.redhat.com/) is one of similar choice.

Besides previous 2 mini-HOWTO (KVM on Debian mini-HOWTO and libvirt + KVM on Debian mini-HOWTO), here I will guide you though how to employ virt-manager for more high level visualization handling.

Some background information

As the beginning (refer to KVM on Debian mini-HOWTO), we only use KVM directly plus some low level toolkits. It demonstrate the most basic idea about how KVM functioning, e.g. play with suitable hardware (Intel-VT or AMD-V supported CPUs), install required packages, prepare network, create required disk image and so on. Or at least, if everything else gone wrong, you may still have some idea about how to fix it.

For the next generation, libvirt comes in as an assistance (refer to libvirt + KVM on Debian mini-HOWTO). It provide some handy solution for client installation or daily maintenance tasks. From my point of view as a system administrator, this is already enough for production, and I am also using it for production more than 3 months without any critical problem.

virt-manager is now acting as the last abstraction layer for KVM, when compare the similar architecture with VMware. Since it is target for the final abstraction of virtual client management, there is not much different in basic operation with above 2 solutions. If you have never play with that before, go back and give a quick review with it :-)

Prepare your Debian sid

I will assume you have KVM and libvirt install and functioning correctly. Run the following command for additional packages installation:

apt-get update
apt-get install virt-manager virt-viewer

Basic operation before playing with virt-manager

As mentioned before, please go though the following procedures and ensure you have a functional environment for KVM:

  1. Prepare network.
  2. Create required disk image.
  3. Start client installation with virt-install.
  4. Preform some basic management operation with virsh.

So now you are able to work with KVM in CLI. There is not much short cut for virtual client initialization (simple, stable and elegant), but virt-manager can simplify our daily life. Let's play with it now.

A quick look with virt-manager

Figure 1. Virtual Machine Manager main screen.Figure 1. Virtual Machine Manager main screen.To start virt-manager, just simply type virt-manager in CLI (for sure that, you will need to have X running, or remote X server as like as Xming installed). Figure 1. show the main screen when it start.

Figure 2. Virtual Machine Console.Figure 2. Virtual Machine Console.You can find all of your existing virtual clients within the main screen. Most client related information are list in here too, e.g. Status, CPU usage, memory usage, etc. Just double-click any running client and a console for this client will be opened.

From the console you can start, pause or shutdown the client directly. Sometime client may not response to shutdown command correctly, e.g. a Windows XP client with ACPI off, therefore you can go to "Virtual Machine -> Destroy" and force kill the client instant. Figure 2. show a console of an active client, which running with Debian etch installation.

Figure 3. Tab "Overview" of client details.Figure 3. Tab "Overview" of client details.The next important page is the about the client details. This can be open by choosing the target client from main screen then click on the "Details" button, or start from "View -> Details" from client console. From the tab "Overview", you can have more information about the client CPU and memory usage history.

Figure 4. Tab "Hardware" of client details.Figure 4. Tab "Hardware" of client details.Besides "Overview", the "Hardware" tab provide general information of your virtual client's hardware configuration. e.g. If you hope to autostart a client during system bootup, go to "Boot Options" and check on the "Autostart VM" box.

Most likely the above operations are the most common use of virt-manager. Browse client status and information, open virtual client console without any CLI command, a better visual look and feel, and that's all.

Other indeed configuration

Figure 5. Open a connection to remote libvirt host.Figure 5. Open a connection to remote libvirt host.virt-manager also able to connect to another remote host running with libvirt, as like as similar feature of that in VMware. For sure that your firewall should allow such traffic (sorry that I have not yet study which port does it use...). This can be found from main screen "File -> Open connection". BTW, I don't really think this function as very useful, since I always combine PuTTY + Xming for remote X access from Windows.

Figure 6. Tab "Overview" for host.Figure 6. Tab "Overview" for host.The host itself also have a "Details" page. Click from main screen "Edit -> Host details" and you will have the "Overview" tab (Figure 6.) of overall CPU and memory usage among this host machine.

Figure 7. Tab "Virtual Networks" for host.Figure 7. Tab "Virtual Networks" for host.Next to this "Overview" tab there is a "Virtual Networks" (Figure 7.). According to original design of libvirt and virt-manager, we can setup different type of network architecture with this page, e.g. host only private network, LAN with NAT, or directly bridge to a real network interface. If you have experience with VMware, this idea shouldn't be too complicated; BTW, this section is still not stable enough. As we have already setup bridge to real interface manually, we can just skip this section right now.

Conclusion

As you can see that most operation can function without using virt-manager, so what is the benefit of using it? Well, I think it is a handy toolkits for daily maintenance and able to save some of our time from remember a lot of CLI commands, but not means we should replace our basic knowledge of how KVM functioning with this helper.

The design of virt-manager is quite correct, since not every end users are power user. My only complain is about its stability and functionalities, e.g. can't create disk image other than RAW, which will cause a lot of useless disk space. May be the next generation should belong to web interfaces, so we will able to operate our virtual client as like as that of MS VirtualPC (well... MS VirtualPC use ActiveX for display client console though web, I don't know how can we replace it with open source standard technology...).

virt-manager is still a very young program. Let's give it more time for improvement and look forward for its growth :-)


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <h5> <h6> <em> <strong> <code> <del> <blockquote> <q> <sub> <p> <br> <ul> <ol> <li> <dl> <dt> <dd> <a> <b> <u> <i> <sup> <acronym> <pre> <img>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.