virt-manager / virt-viewer => 虚拟化 => 命令行替代方案?

virt-manager / virt-viewer => 虚拟化 => 命令行替代方案?

我的系统上没有安装 X。是否有一些可以替代 virt-manager / virt-viewer 程序的程序,这些程序只能使用 curses(?) 库在命令行上运行(=>只能像“top”一样以文本格式打印信息,对吗?)。

谢谢!jens

答案1

virsh 用于管理(debian 软件包 libvirt-bin),virt-top 用于统计

答案2

  1. 远程:VNC,使用 vnc 查看器。如果您不知道端口号,请执行

    ps -aux |grep kvm

    根 4042 7.2 1.9 463456 163132? Sl 20:19 1:36 /usr/libexec/qemu-kvm -S -M rhel5.4.0 -m 256 -smp 1 -name centos -uuid 333e53da-4f9d-2d18-ccba-8ea9f4708886 -no-kvm-pit-reinjection -monitor pty -pidfile /var/run/libvirt/qemu//centos.pid -boot c -drive file=/var/lib/libvirt/images/base-centos.img,if=ide,index=0,boot=on,cache=none -drive file=,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:6b:77:fb,vlan=0 -net tap,fd=15,script=,vlan=0,ifname=vnet0 -串行pty-并行无-usb-vnc 0.0.0.0:1-k en-us

    vnc://kvm主机ip:5901

  2. 来自本地主机:串行连接可以工作

答案3

我一直在 Fedora 笔记本电脑上使用 virt-manager 连接到运行 KVM(libvirt)的无头 CentOS 5.X 服务器。virt-manager 可以远程连接到运行 KVM 的其他计算机。

在 virt-manager 的文件下拉菜单中,找到“添加连接”。选中“连接到远程主机”复选框。对于用于连接到远程系统的协议,有多种选择。在我的 virt-manager 版本(0..8.7)中,我有以下协议:

  • SSH
  • TCP(SASL、Kerberos 等)
  • 带证书的 SSL/TLS

在我看来,最简单的方法是使用 SSH。有关如何操作的详细信息如下:http://virt-manager.org/page/RemoteSSH

最终,virt-manager 在幕后执行以下操作:

virt-viewer -c qemu+ssh://[email protected]/system myvm1

其中 192.168.1.1 是我的 KVM 无头服务器,myvm1 是我的一个客户 KVM 实例。或者,您可以从无头系统远程运行 virt-manager,并使用以下命令通过 ssh 建立隧道:

ssh -X [email protected] virt-manager

这也可以,但我一般只在 LAN 情况下使用它,而不是 WAN。

相关内容