1. 程式人生 > >virt-viewer的簡單使用

virt-viewer的簡單使用

virt-viewer

簡介:  virt-viewer是一個用於顯示虛擬機器的圖形控制檯的最小工具。 控制檯使用VNC或SPICE訪問協議。 可以基於其名稱,ID或UUID來引用guest虛擬機器。如果客戶端尚未執行,則可以告知觀看者請等待,直到它開始,然後嘗試連線到控制檯。此檢視器可以連線到遠端主機以查詢控制檯資訊然後也使用同一網路連線到遠端控制檯。

用法:virt-viewer [OPTIONS] -- DOMAIN-NAME|ID|UUID

子命令類別

執行“virt-viewer”時,接受以下選項:
-h,-help  顯示命令列幫助摘要
-V,--version  顯示程式版本號
-v,-verbose  顯示有關連線的資訊
-w, - wait  等待域啟動,然後再嘗試連線到控制檯
-r,--reconnect
            如果關閉並重新啟動,則自動重新連線到域
        -td PCT,-zoom = PCT
            顯示視窗的縮放級別(百分比)。 範圍10-400。
        -d,--direct
            不要嘗試通過SSH隧道控制檯,即使主要
            連線URI使用SSH。
        -a,--attach
            而不是直接TCP / UNIX套接字連線到遠端
            顯示,要求libvirt提供一個預連線的socket
            顯示。 這避免了需要與遠端驗證
            顯示伺服器。 此選項僅在連線時有效
            到在與virt-viewer相同的主機上執行的客戶機
            程式。 如果通過libvirt連線到客戶端失敗,virt-viewer
            會自動回退到嘗試正常的直接TCP / UNIX
            插座連線。

EXAMPLES

      1:To connect to the guest called 'demo' running under Xen
      # virt-viewer demo
       2:To connect to the guest with ID 7 running under QEMU
   #virt-viewer --connect qemu:///system 7
       
       3:To wait for the guest with UUID 66ab33c0-6919-a3f7-e659-16c82d248521 to  startup and then connect, also reconnecting upon restart of VM
   

    #virt-viewer --reconnect --wait 66ab33c0-6919-a3f7-e659-16c82d248521
       4:To connect to a remote console using TLS
          #virt-viewer --connect xen://example.org/ demo

      5:To connect to a remote host using SSH, lookup the guest config and then make a tunnelled connection of the console


       

          #virt-viewer --connect qemu+ssh://[email protected]/system demo
       6:When using a SSH tunnel to connect to a SPICE console, it's recommended to have ssh-agent running to avoid getting multiple authenticationprompts.To connect to a remote host using SSH, lookup the guest config and then make a direct non-tunnelled connection of the console     
 # virt-viewer --direct --connect xen+ssh://[email protected]/ demo