virt-install KVM“無法開啟顯示”

virt-install KVM“無法開啟顯示”

所以我嘗試使用KVM(在CentOS 6.3上)建立一個VM,我使用的命令如下:

virt-install  --connect qemu:///system  --virt-type kvm  --name ffVM32  --ram 1024 --disk path=/home/datastore/images/ffVM32.img,size=10  --vnc  --cdrom  /home/datastore/backups/CentOS-6.4-i386-minimal.iso   --bridge bridge0

我得到的輸出是:

Starting install...
Allocating 'ffVM32.img'                                             |  10 GB     00:00     
Creating domain...                                                  |    0 B     00:00     
Cannot open display: 
Run 'virt-viewer --help' to see a full list of available command line options
Domain installation still in progress. You can reconnect to 
the console to complete the installation process.

我已經完成了「X Windows System」的群組安裝,但沒有幫助。我正在嘗試透過運行 Ubuntu 13..04 的筆記型電腦來存取它。奇怪的是,當我在另一台裝有 PCLinuxOS 的機器上嘗試相同的操作時,virt-viewer 打開,我可以繼續安裝。

列出所有虛擬機器時,我發現虛擬機器正在運行

[root@ts3 ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 8     ffVM32                         running

我錯過了什麼?

答案1

您可能還沒有使用-Xssh 開關登入您的硬體節點。

[root@yourmachine]# ssh -X root@<your-hardware-node-ip>

man頁面:

         Enables X11 forwarding.  This can also be specified on a per-host 
         basis in a configuration file.

         X11 forwarding should be enabled with caution.  Users with the
         ability to bypass file permissions on the remote host (for the
         user's X authorization database) can access the local X11 display
         through the forwarded connection.  An attacker may then be able
         to perform activities such as keystroke monitoring.

         For this reason, X11 forwarding is subjected to X11 SECURITY
         extension restrictions by default.  Please refer to the ssh -Y
         option and the ForwardX11Trusted directive in ssh_config(5) for
         more information.

若要停用 X11 轉發,您可以使用該-x開關。

若要啟用 X11 轉發,請編輯位於下列位置的conf 檔案/etc/ssh/sshd_config並取消註解下列行:

X11Forwarding Yes

並使用重新啟動服務service sshd restart

希望這可以幫助。

答案2

讓 vnc 與 libvirt 一起使用的完整步驟:

  1. 如果您正在透過 ssh 連線到主機:

    ssh -XY ...@....
    
  2. 如果未安裝則安裝X11(針對RHEL,其他調整):

    yum groupinstall "X Window System"
    

您可能需要按照步驟 1 嘗試再次登出並使用 ssh。

  1. 只有當上述內容本身不起作用且未$DISPLAY定義時,才嘗試定義它:

    export DISPLAY=":0"
    

答案3

連接Ubuntu 筆記型電腦上的-X開關 ( )。ssh -X [host]

相關內容