[virt-tools-list] what is virt-viewer intended to be ?

Lentes, Bernd bernd.lentes at helmholtz-muenchen.de
Tue May 16 10:53:07 UTC 2017



----- On May 11, 2017, at 3:19 PM, Pavel Grunt pgrunt at redhat.com wrote:

> On Thu, 2017-05-11 at 15:03 +0200, Lentes, Bernd wrote:
>> Hi,
>> 
>> sorry for asking a simple question, but i'm confused. What is virt-
>> viewer intended to be ?
>> To connect directly to virtual machine consoles, e.g. with VNC ?
> and SPICE
> 
>> Or connect to libvirtd which runs e.g. on a remote linux host ?
>> Or both ?
> can do both - to connect to vm, it first has to connect to libvirt
> There is also remote-viewer which allows you to connect directly to
> the vm
> 
>> 
>> If i'm able to connect to libvirtd on a remote host, what can i do ?
>> I think the functionality of virt-viewer is limited compared to
>> virt-manager.
> compared to virt-manager it has multimonitor support, folder sharing,
> it shows progress bar with file transfer (SPICE features).
> remote-viewer also works on Windows.
> 
> 
>> This page (https://libvirt.org/windows.html) gaves me the impression
>> that i can connect with virt-viewer to a libvirtd on a remote host.
>> 
>> I tried to connect to a libvirtd on a linux host host using virt-
>> viewer and the following in the adress bar:
>> qemu+tcp://192.168.100.10 and qemu+tcp://192.168.100.1016509, but
>> didn't succeed.
> 
> please see the man page, it has a few examples:
> virt-viewer -c qemu+ssh://root@host/system
> 
>> The port 16509 on the linux host is opened in the firewall and
>> libvirtd is listening on it.
>> 
>> Is virt-viewer able to do this ?
>> 

Hi guys,

thanks for your quick answer. I have some further questions. I will leave windows and try to connect to libvirt or guest consoles from a linux box.
My scenario is that i have a few guests which are controlled by pacemaker in a two node cluster.
I'd like to have the ability to connect to the consoles when the guests have problems in booting. This way maybe i can identify the problems.
I don't want to open the libvirt port if possible but connect to libvirt/guest consoles using ssh.
I managed to connect to the hypervisor using virsh and ssh from a remote linux box.
My idea is that i configure in each guest a vnc display with increasing port numbers, starting from 5900, so i can connect to each guest indepently,
and to several concurrently.
I'd like to bind the vnc display just to the localhost interface because of not exposing this port.
I can connect to the hypervisor with the following: virt-viewer -vc qemu+ssh://root@ha-idg-1/system
Then i get a list of the running guests (currently only one). I choose it, and then ... nothing happens :-(
Virt-viewer says "waiting for display 1...", and i get the following message on my terminal: 
"(virt-viewer:810): Gtk-WARNING **: Allocating size to VncDisplay 0x10282f0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? "

This is the output of my shell:

(virt-viewer:8414): virt-viewer-DEBUG: connecting ...
(virt-viewer:8414): virt-viewer-DEBUG: Opening connection to libvirt with URI qemu+ssh://root@ha-idg-1/system
Opening connection to libvirt with URI qemu+ssh://root@ha-idg-1/system
Password: 
(virt-viewer:8414): virt-viewer-DEBUG: initial connect
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200

(virt-viewer:8414): Gtk-WARNING **: Theme directory base/ of theme oxygen has no size field

(virt-viewer:8414): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to f08c2f32-fe35-137a-0e9d-fa7485d57974
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200
(virt-viewer:8414): virt-viewer-DEBUG: Guest mausdb_vm is running, determining display
Guest mausdb_vm is running, determining display
(virt-viewer:8414): virt-viewer-DEBUG: Set connect info: (null),(null),-1,-1,(null),(null),(null),0
(virt-viewer:8414): virt-viewer-DEBUG: Guest mausdb_vm has a vnc display
Guest mausdb_vm has a vnc display
(virt-viewer:8414): virt-viewer-DEBUG: Guest graphics address is 127.0.0.1:5900
(virt-viewer:8414): virt-viewer-DEBUG: Set connect info: ha-idg-1,127.0.0.1,5900,-1,ssh,(null),root,0
(virt-viewer:8414): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD
(virt-viewer:8414): virt-viewer-DEBUG: After open connection callback fd=-1
(virt-viewer:8414): virt-viewer-DEBUG: Opening indirect TCP connection to display at 127.0.0.1:5900
Opening indirect TCP connection to display at 127.0.0.1:5900
(virt-viewer:8414): virt-viewer-DEBUG: Setting up SSH tunnel via root at ha-idg-1
Setting up SSH tunnel via root at ha-idg-1
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200
(virt-viewer:8414): virt-viewer-DEBUG: reconnect_poll: 0
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200
(virt-viewer:8414): virt-viewer-DEBUG: Insert display 0 0x1897c60
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200
Password: (virt-viewer:8414): virt-viewer-DEBUG: Allocated 1024x740
(virt-viewer:8414): virt-viewer-DEBUG: Child allocate 1024x640

(virt-viewer:8414): Gtk-WARNING **: Allocating size to VncDisplay 0x1a2a2f0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(virt-viewer:8414): virt-viewer-DEBUG: Window closed
(virt-viewer:8414): virt-viewer-DEBUG: close vnc=0x1a2a2f0
(virt-viewer:8414): virt-viewer-DEBUG: Not removing main window 0 0x187ec60
(virt-viewer:8414): virt-viewer-DEBUG: Disconnected
(virt-viewer:8414): virt-viewer-DEBUG: close vnc=0x1a2a520
(virt-viewer:8414): virt-viewer-DEBUG: notebook show status 0x1950200
(virt-viewer:8414): virt-viewer-DEBUG: Guest mausdb_vm display has disconnected, shutting down
Guest mausdb_vm display has disconnected, shutting down
pc65518:~ # 
Password: 
Password: 
Permission denied (publickey,keyboard-interactive).
pc65518:~ # pc65518:~ # pc65518:~ # 


Do i have to provide the desired resolution ? How can i do that ?
I tried virt-viewer with -f, but that didn't help.

What means "(virt-viewer:8414): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD
(virt-viewer:8414): virt-viewer-DEBUG: After open connection callback fd=-1" ?

Is my idea basically possible ? Or is it the problem that vnc is just listening on localhost ?
I changed the ip in the config of the guest to 0.0.0.0, but still didn't succeed.


This is the config of my guest:

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit mausdb_vm
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>mausdb_vm</name>
  <uuid>f08c2f32-fe35-137a-0e9d-fa7485d57974</uuid>
  <memory unit='KiB'>8197376</memory>
  <currentMemory unit='KiB'>8197376</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/vg_cluster_01/lv_cluster_01'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
     <!-- disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/idg-2/SysAdmin_AG_Wurst/software_und_treiber/linux/knoppix/7.2/KNOPPIX_V7.2.0DVD-2013-06-16-DE.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk -->
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:37:92:01'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' sharePolicy='allow-exclusive'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <!-- lauscht nur an localhost, vcnviewer localhost:5900 -->

    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Thanks.


Bernd







 

Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Heinrich Bassler, Dr. Alfons Enhsen
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671




More information about the virt-tools-list mailing list