[SOLVED] Siimultaneous Spice Client Connections

Discussion in 'Proxmox VE: Installation and configuration' started by blackpaw, Dec 9, 2013.

  1. blackpaw

    blackpaw Member

    Joined:
    Nov 1, 2013
    Messages:
    230
    Likes Received:
    1
    Apparently experimental support has been in the spice server for this since spice 0.10

    http://www.spice-space.org/page/Features/MultipleClients

    One just needs to set
    export SPICE_DEBUG_ALLOW_MC=1

    before launching the qemu vm.

    Not sure where to set this on proxmox - I tried globally via /etc/profile but that didn't work.

    Any suggestions?
     
    #1 blackpaw, Dec 9, 2013
    Last edited: Dec 11, 2013
  2. blackpaw

    blackpaw Member

    Joined:
    Nov 1, 2013
    Messages:
    230
    Likes Received:
    1
    Well it took me a while, but I figured out where to set it and it does work.

    WARNING:Involves editing ProxMox perl code and hence totally unsupported.

    Edit /usr/share/perl5/PVE/Tools.pm

    Add the following before line 325:

    Code:
    local $ENV{SPICE_DEBUG_ALLOW_MC} = "1";
    So it should look like this:

    Code:
        319         eval {
        320             local $ENV{LC_ALL} = $lang;
        321
        322             # suppress LVM warnings like: "File descriptor 3 left open";
        323             local $ENV{LVM_SUPPRESS_FD_WARNINGS} = "1";
        324             [B]local $ENV{SPICE_DEBUG_ALLOW_MC} = "1";[/B]
        325
        326             $pid = open3($writer, $reader, $error, @$cmd) || die $!;
        327
        328             # if we pipe fron STDIN, open3 closes STDIN, so we we
        329             # a perl warning "Filehandle STDIN reopened as GENXYZ .. "
        330             # as soon as we open a new file.
        331             # to avoid that we open /dev/null
        332             if (!ref($writer) && !defined(fileno(STDIN))) {
        333                 POSIX::close(0);
        334                 open(STDIN, "</dev/null");
        335             }
        336         };
    
    The you should reboot the node, though probably restarting the pve manager service should be sufficient - didn't test that.

    Then you can open as many spice connections as you like to the same VM, from the same PC or multiple ones. So far I haven't had any issues or crashes. Mouse and keyboard are shared between connections.
     
  3. emanuelebruno

    emanuelebruno Member

    Joined:
    May 1, 2012
    Messages:
    113
    Likes Received:
    0
    Thank you for sharing this information
     
  4. aPollO

    aPollO Member
    Proxmox Subscriber

    Joined:
    Mar 6, 2014
    Messages:
    108
    Likes Received:
    7
    I know its old but i works like a charm.

    Is there any possibility to add this permanently? Every time i update Proxmox it gets overwritten. Then i edit the Tools.pm but i don't know wich service i have to restart for getting it to work online. The only way is a restart of the pve-manager. But this reboots all my VMs, too.
     
  5. Gilberto Ferreira

    Joined:
    Aug 21, 2014
    Messages:
    47
    Likes Received:
    0
    Hi... Old post but not working here... I try both PVE 4.4 and PVE 5... I am able to start the VM after alter the Tools.pm.
    When the VM start, I get this message:
    qm start 100
    (/usr/sbin/qm:8961): Spice-Warning **: reds.c:3378:do_spice_init: spice: allowing multiple client connections (crashy)

    But when connect from different clients, they share the connecttion and there is the same one....

    How can do it to work??? Thanks for any help.
     
  6. blackpaw

    blackpaw Member

    Joined:
    Nov 1, 2013
    Messages:
    230
    Likes Received:
    1
    But when connect from different clients, they share the connecttion and there is the same one....

    Thats what its meant

    Thats what its meant to do - share the same screen across multiple spice displays. We used it in support so a person could easily observe what the other was doing.
     
  7. Gilberto Ferreira

    Joined:
    Aug 21, 2014
    Messages:
    47
    Likes Received:
    0
    I see your point, but that's not the behavior I expected... I need that two or more people connected to VM without interfere with other, like RDP ir WTS does, you gotta?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice