Qemu ошибка подключения к графической консоли

I am trying to create a virtual machine using QEMU/KVM. I am getting an error:

Error connecting to graphical console: Error opening Spice console SpiceClientGtk missing

I have looked around but cannot find an answer that resolves this for me.
Note, this is not the same issue as in:
https://askubuntu.com/questions/833964/virt-manager-cant-connect-to-graphical-console

About my system:

$ uname -a
Linux punko 4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux.

tshepang's user avatar

tshepang

3,3114 gold badges22 silver badges30 bronze badges

asked Nov 21, 2020 at 18:06

Punko Brewster's user avatar

I had the same problem. I had gir1.2-spiceclientgtk-3.0 and other needed modules installed. But it didn’t help.

So I went to Hardware Details section, and changed Display settings from Spice Server to VNC server, and it worked. It could work also other way around if you have VNC server marked, then you could change to Spice Server.

Another thing that I found on forums and can help is changing Video from VGA to QXL model.

peterh's user avatar

peterh

2,52310 gold badges31 silver badges49 bronze badges

answered Nov 13, 2021 at 21:10

crazyhorse's user avatar

  • Home
  • Forum
  • The Ubuntu Forum Community
  • Ubuntu Specialised Support
  • Virtualisation
  • [SOLVED] KVM — Error connecting to graphical console (SpiceClientGtk)

  1. KVM — Error connecting to graphical console (SpiceClientGtk)

    Hi All,

    I have a new install of Ubuntu Server 20.04.2 LTS setup and running KVM.

    Everything *seems* to be fine with the server.

    I have then installed ‘virt-manager’ on my Ubuntu 18.04 LTS Desktop machine, and successfully connected to the KVM Server.

    I have tried to create a new VM (Debian Stretch) from the Virtual Machine Manager (virt-manager), but each time I am getting the same issue which is that I cannot see the VM Console.

    The error I am getting is:

    Error connecting to graphical console:
    Error opening Spice console, SpiceClientGtk missing

    I have checked that ‘SpiceClientGtk’ is installed on the Ubuntu Server by entering:

    Code:

    sudo apt install gir1.2-spiceclientgtk-3.0 --dry-run

    which returns:

    Code:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    gir1.2-spiceclientgtk-3.0 is already the newest version (0.37-2fakesync1).
    gir1.2-spiceclientgtk-3.0 set to manually installed.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

    so I believe that is correctly installed. For what it was worth, I also installed it on my Desktop, but that made no difference either.

    I also tried connecting using ‘virt-viewer’.

    I entered this on my desktop:

    Code:

    virt-viewer --connect qemu+ssh://username@172.25.25.3/system VMName

    I don’t have keys setup (yet) so I am expecting to get asked for the password, which I am (a number of times, but apparently that is expected). The ‘virt-viewer’ application opens, and sits with the message:

    Connected to graphic server

    The VM is definitely running (at least according to the host):

    Code:

    $ virsh list
    
     Id   Name         State
    ----------------------------------------
     1    VMName   running

    Any suggestions on what to try or do next?

    Thanks,

    Alan.

    Last edited by Alan5127; March 9th, 2021 at 11:56 AM.

    Reason: Tidy up formatting


  2. Re: KVM — Error connecting to graphical console (SpiceClientGtk)

    Setup ssh-keys already.

    On the client system:

    Code:

    ssh-keygen -t ed25519
    ssh-copy-id -i ~/.ssh/id_ed25519.pub userid@remote

    That’s it.

    Verify the keys are working:

    On the client machine, you must have virt-manager and spice-client-…… (really long package name) installed and your userid should be in the libvirtd group on the KVM server.
    There are other settings inside the VM that are needed, but I think the defaults are for SPICE to be used since 18.04. You can change that to VNC or VMVGA, if you like in the VM settings. On a non-desktop, SPICE isn’t exactly useful. Heck, on a non-desktop, just use ssh directly. That is much more efficient.
    Until today, I never tried to connect to a server using spice. It never made any sense to try.


  3. Re: KVM — Error connecting to graphical console (SpiceClientGtk)

    Hi TheFu,

    Adding the SSH keys fixed the problem.

    No idea why — I appreciate it is more convenient, but not sure why it works that way, and not by typing the password, but regardless, it is working now.T

    Thanks!

    Alan.


Tags for this Thread

Bookmarks

Bookmarks


Posting Permissions

Since yesterday, I can’t view any running VMs (QEMU/KVM) with my virt-manager GUI any more. When I try to view the screen of a VM in its built-in viewer, I get this error message instead:

Error connecting to graphical console:
internal error: unable to execute QEMU command ‘getfd’:
No file descriptor supplied via SCM_RIGHTS

This applies to all of my VMs.

I can still correctly view and interact with my VMs in virt-viewer though, only the virt-manager built-in viewer is dead.

What is wrong here and how can I fix it?

Edit: I just found out I am using virt-manager version 1:1.4.0-1~getdeb1 from the archive.getdeb.net repo.

asked Oct 6, 2016 at 19:46

Byte Commander's user avatar

Byte CommanderByte Commander

105k45 gold badges282 silver badges421 bronze badges

2

In working to try to Merge the latest virt-manager 1.4.0 to Ubuntu I came across this same issue. It does not appear to be a bug in virt-manager just a change how it sends display data to VMs.

I’ve opened a bug to add the necessary permissions to libvirt which is where the apparmor profiles are defined — https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1668681

To fix this issue without disabling security append:

# allow connect with openGraphicsFD to work
unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),

to the file /etc/apparmor.d/abstractions/libvirt-qemu but not in the qemu-bridge-helper section. (So right after «owner @{PROC}/0-9*/fd/ r,»)

Then reload the profiles with sudo systemctl reload apparmor.

Having said all that, I always do recommend using the packages from our archive for best support.

sierrasdetandil's user avatar

answered Feb 28, 2017 at 16:28

gQuigs's user avatar

gQuigsgQuigs

4554 silver badges10 bronze badges

3

In my case, it was apparmour preventing access. The apparmour magic profile generator doesn’t seem to be working as it should. My workaround is as follows.

After starting the KVM instance and receiving the error, I did:

$sudo apparmour_status

which listed the profile causing the issue,

libvirt-<some long key> 

Then I set the apparmour profile to complain instead of enforce with:

$sudo aa-complain /etc/apparmor.d/libvirt/libvirt-<some long key>

Now I no longer receive the error. Hope this conflict gets fixed.

answered Nov 25, 2016 at 7:29

Mischa's user avatar

I could not reproduce the problem, but there were updates for libvirt on October, 5th :

libvirt-bin-1.3.1-1ubuntu10.2 was upgraded to libvirt-bin-1.3.1-1ubuntu10.3
libvirt0-1.3.1-1ubuntu10.2 was upgraded to libvirt01.3.1-1ubuntu10.3

If you did not change any settings or anything else, most probably something went wrong during the upgrade process. Completely remove all virt-manager related packages and reinstall them.

sudo apt purge libvirt-bin libvirt-glib libvirt0 virt-manager virt-viewer virtinst  
sudo apt install libvirt-bin libvirt-glib libvirt0 virt-manager virt-viewer virtinst  

Reboot the host operating system — now everything should work properly as it did before.

answered Oct 7, 2016 at 7:32

cl-netbox's user avatar

cl-netboxcl-netbox

30.7k7 gold badges93 silver badges130 bronze badges

5

Seems like a bug in virt-manager version 1:1.4.0-1~getdeb1 from http://getdeb.net.

Downgrading the package again to the latest version available from the official repos (1:1.3.2-3ubuntu1.16.04.2 from xenial-updates) fixes this.

Update: Version 1:1.4.0-1~getdeb2 didn’t fix this issue yet.

answered Oct 7, 2016 at 18:54

Byte Commander's user avatar

Byte CommanderByte Commander

105k45 gold badges282 silver badges421 bronze badges

1

I

igor145

New member

07.09.2018

#1

Сообщения
13


07.09.2018

#1

При возникновении ошибки:
Ошибка подключения к графической консоли
Error opening Spice console, SpiceClientGTK missing

а она у меня возникает при попытке подключения к созданной в виртменеджере виртуальной машине в ситуации «Орел 2.12 из коробки», необходимо добавить пакет gir1.2-spice-client-gtk-3.0 с зависимостями.

Работая над попыткой слить последнюю версию virt-manager 1.4.0 с Ubuntu, я столкнулся с этой же проблемой. Похоже, это не ошибка в virt-manager, а просто изменение способа отправки отображаемых данных на виртуальные машины.

Я открыл ошибку, чтобы добавить необходимые разрешения для libvirt, где определяются профили apparmor — https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1668681

Чтобы устранить эту проблему, не отключая функцию безопасности, добавьте:

# allow connect with openGraphicsFD to work
unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),

в файл /etc/apparmor.d/abstractions/libvirt-qemu но не в разделе qemu-bridge-helper. (Так сразу после «owner @{PROC}/0-9*/fd/ r,»)

Затем перезагрузите профили с sudo systemctl reload apparmor,

Сказав все это, я всегда рекомендую использовать пакеты из нашего архива для лучшей поддержки.

  • Qe 22d ошибка e1
  • Qbittorrent произошла ошибка ввода вывода windows 10
  • Qbittorrent ошибки при закачке
  • Qbittorrent ошибка скачивания торрента
  • Qbittorrent ошибка недопустимый торрент