Remote management of virtual machines via Libvirt

Source: Internet
Author: User

The previous article describes the installation of KVM virtual machines and Virsh related commands on CentOS 6, and here's how to get a virtual machine from a remote management node, or log on to the Virsh command line on a remote server.


2 main units:

node4:192.168.1.166

node5:192.168.1.143


Node4 as a remote Libvirt server with virtual machines already created, the virtual machines on the remote server are now managed on NODE5 in the following 2 ways:


    1. by Qemu+ssh Way

    2. by Qemu+tcp Way


Install Libvirt and related kits on NODE5, and I've installed these here,

#yum Groupinstall "Virtualization" #yum install Libvirt Libvirt-python python-virtinst virt-viewer

Through Qemu+ssh connection method is relatively simple, just NODE5 can use SSH remote access node4 can,

The command is as follows:

#virsh-C Qemu+ssh://[email Protected]/system

If 2 nodes set up mutual trust, key-free login, can directly execute Virsh related commands,

[[email protected] ~]# virsh-c qemu+ssh://[email protected]/system list Id name status-------------- --------------------------------------3 VM01 Running


The following describes the Virsh for logging on to a remote node by qemu+tcp:

Node4 on

To modify/ETC/SYSCONFIG/LIBVIRTD, turn on the following 2 configuration items:

[Email protected] ~]# egrep-v "^#|^$"/etc/sysconfig/libvirtdlibvirtd_config=/etc/libvirt/libvirtd.conflibvirtd_ Args= "--listen


Modify the configuration file,

Vim/etc/libvirt/libvirtd.conflisten_tls = 0listen_tcp = 1tcp_port = "16509" listen_addr = "0.0.0.0" auth_tcp = "None"

Restart the LIBVIRTD and view the monitored ports.

#/ETC/INIT.D/LIBVIRTD restart# netstat-anltp|grep 16509tcp 0 0 0.0.0.0:16509 0.0.0.0:* LISTEN 28843/ Libvirtd


Remote access on NODE5 (you need to make sure that you can access the NODE4 16509 TCP port):

[[email protected] ~]# virsh-c qemu+tcp://192.168.1.166/system list Id name status------------------ ----------------------------------3 VM01 Running

Remote management of virtual machines via Libvirt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.