在debian系统下测试通过
Libvirt是一个软件集合,便于使用者管理虚拟机和其他虚拟化功能,比如存储和网络接口管理等等。这些软件包括一个API库、一个daemon(libvirtd)和一个命令行工具(virsh)。Libvirt的主要目标是:提供一种单一的方式管理多种不同的虚拟化提供方式和hypervisor。
我这用的tcp的连接模式
修改配置文件
/etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
listen_addr = "0.0.0.0"
auth_tcp = "none"
/etc/default/libvirtd
libvirtd_opts="-l"
root@debian:~
Usage:
libvirtd [options]
Options:
-h | --help Display program help:
-v | --verbose Verbose messages.
-d | --daemon Run as a daemon & write PID file.
-l | --listen Listen for TCP/IP connections.
-t | --timeout <secs> Exit after timeout period.
-f | --config <file> Configuration file.
-V | --version Display version information.
-p | --pid-file <file> Change name of PID file.
libvirt management daemon:
Default paths:
Configuration file (unless overridden by -f):
/etc/libvirt/libvirtd.conf
Sockets:
/var/run/libvirt/libvirt-sock
/var/run/libvirt/libvirt-sock-ro
TLS:
CA certificate: /etc/pki/CA/cacert.pem
Server certificate: /etc/pki/libvirt/servercert.pem
Server private key: /etc/pki/libvirt/private/serverkey.pem
PID file (unless overridden by -p):
/var/run/libvirtd.pid
重启下libvirtd服务,我这里用systemctl 守护进程
systemctl restart libvirtd
查看默认端口
root@debian:~
tcp 0 0 0.0.0.0:16509 0.0.0.0:* LISTEN 2372/libvirtd
最后就可以在别的机器上进行连接测试
root@debian:~
Id Name State
-----------------------------
如果是本机自己访问就可以用
root@debian:~
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh
|