现象,执行ssh $remoteIP之后,

[xxoo@BJ_SJHL_LHZQ0006 ~]$ virt-manager 

Unable to initialize GTK: could not open display

解决方法:

通过ssh -X连接对端服务器


之后继续,输入virt-manager之后,弹出下面的页面信息:

wKioL1X7zi2B5n6nAAGoy0HrSAs866.jpg


解决方法:

在/etc/polkit-1/localauthority/50-local.d/50-lhop.pkla 

[Remote libvirt SSH access]

        Identity=unix-group:xxoo

        Action=org.libvirt.unix.manage;org.libvirt.unix.monitor

        ResultAny=yes

        ResultInactive=yes

        ResultActive=yes

确保unix-group中包含的lhop用户是管理员用户即可 

国外注释:

The above would allow users of group “lhop” to access libvirt and manage libvirt through policy kit action “org.libvirt.unix.manage” . The above rules are placed in file 50-org.example-libvirt-remote-access.pkla under directory “/etc/polkit-1/localauthority/50-local.d”.


添加上述内容之后,再次执行virt-manager,显示如下信息,表示正常:

wKioL1X7zyvhEYX8AADycz8njGw294.jpg