zoukankan      html  css  js  c++  java
  • virsh使用qemu+tcp访问远程libvirtd

    因为ssh的不能访问 所以使用tcp进行对远程libvirtd进行连接访问,例如

    virsh -c qemu+tcp://example.com/system

    修改文件vim /etc/sysconfig/libvirtd,用来启用tcp的端口

    1
    2
    3
    LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
     
    LIBVIRTD_ARGS="--listen"

    修改文件vim /etc/libvirt/libvirtd.conf

    1
    2
    3
    4
    5
    6
    7
    8
    9
    listen_tls = 0
     
    listen_tcp = 1
     
    tcp_port = "16509"
     
    listen_addr = "0.0.0.0"
     
    auth_tcp = "none"

    运行 libvirtd

    1
    service libvirtd restart
    systemctl restart libvirtd.service

    如果没起效果(我的就没有生效 :( ),那么使用命令行:

    1
    libvirtd --daemon --listen --config /etc/libvirt/libvirtd.conf

    查看运行进程

    1
    2
    [root@ddd run]# ps aux | grep libvirtd
    root 16563 1.5 0.1 925880 7056 ? Sl 16:01 0:28 libvirtd -d -l --config /etc/libvirt/libvirtd.conf

    查看端口

    1
    2
    [root@ddd run]# netstat -apn | grep tcp
    tcp        0      0 0.0.0.0:16509           0.0.0.0:*               LISTEN      13971/libvirtd     

    在source host连接dest host远程libvirtd查看信息

    1
    2
    3
    4
    5
    6
    virsh -c qemu+tcp://211.87.***.97/system
    或者
    virsh -c qemu+tcp://nova@computer02/system
     
    Welcome to virsh, the virtualization interactive terminal.
     
    Type: 'help' for help with commands
    'quit' to quit

    成功使用tcp去访问libvirtd。

  • 相关阅读:
    protobufer安装
    flume sink processor
    flume 参考
    uniq 和 sort -u的不同
    XtraInputBox-How to set the XtraInputBox as password input?
    原型模式
    C#-IEditableObject Interface
    gridControl-The BindingSource.AddingNew event does not fire until I begin typing into the new row
    C#中Invoke 和 BeginInvoke 的区别
    C#启动时全屏显示窗体...
  • 原文地址:https://www.cnblogs.com/gzxbkk/p/7424179.html
Copyright © 2011-2022 走看看