[Spice-devel] USB-redirection

Trebor Forban trebor.forban at gmail.com
Thu Oct 11 05:14:20 PDT 2012


Hello all,

I guess I'm still at a loss. I still have the problem that usb device
are showing up twice.

I've built the following debs:

swos-celt_0.5.1.3-1_amd64.deb
swos-libusbx_20121010151121-1_amd64.deb
swos-qemu_1.2.0-1_amd64.deb
swos-slirp_20121010151121-1_amd64.deb
swos-spice_0.12.0-1_amd64.deb
swos-spice-gtk_0.14-1_amd64.deb
swos-spice-protocol_0.12.2-1_amd64.deb
swos-usbredir_0.4.4-1_amd64.deb
swos-virt-viewer_0.5.4-1_amd64.deb

as such:

#! /bin/bash
SCRIPT=$(basename $0)
PRGDIR=$(cd -P $(dirname $0) && pwd -P)
SRC_ROOT=${PRGDIR}/SWOSTMP/swos-virt-viewer
STAMP=$(/bin/date +'%Y%m%d%H%M%S')
rm /tmp/${SCRIPT}.log
exec >> /tmp/${SCRIPT}.log 2>&1

echo $STAMP
rm -fr ${SRC_ROOT}
[ -d $SRC_ROOT ] || mkdir -p $SRC_ROOT

apt-get update

apt-get -qq --force-yes --no-install-recommends install \
bridge-utils build-essential checkinstall git intltool
python-pyparsing usbutils wget \
libacl1-dev \
libaio-dev \
libasound2-dev \
libdbus-glib-1-dev \
libgtk-3-dev \
libgudev-1.0-dev \
libjpeg-turbo8-dev \
libnss3-dev \
libogg-dev \
libpixman-1-dev \
libpolkit-gobject-1-dev \
libpulse-dev \
libssl-dev libsasl2-dev \
libvdeplug2-dev \
libxml2-dev

INST_ROOT=/usr/local
[ -d $INST_ROOT ] || mkdir -p $INST_ROOT

export PKG_CONFIG_PATH=$INST_ROOT/lib/pkgconfig:$INST_ROOT/share/pkgconfig

cd $SRC_ROOT
git clone git://libusbx.git.sourceforge.net/gitroot/libusbx/libusbx
mv libusbx swos-libusbx-$STAMP
cd swos-libusbx-$STAMP
./autogen.sh --prefix=${INST_ROOT}
make && make install && ldconfig
checkinstall --install=no --pkgname 'swos-libusbx' --pkgversion
"$STAMP" -D --pkgrelease '1' --maintainer 'swosadmin' --pakdir ../debs
--fstrans=no --showinstall=no --autodoinst=no --strip=yes
--stripso=yes --deldoc=yes --deldesc=yes --delspec=yes --nodoc -y

cd $SRC_ROOT
wget -c http://spice-space.org/download/usbredir/usbredir-0.4.4.tar.bz2
tar xf usbredir-0.4.4.tar.bz2 && mv usbredir-0.4.4 swos-usbredir-0.4.4
cd swos-usbredir-0.4.4
./configure --prefix=${INST_ROOT}
make -j2 && make install && ldconfig
checkinstall --install=no --pkgname 'swos-usbredir' --pkgversion
'0.4.4' -D --pkgrelease '1' --maintainer 'swosadmin' --pakdir ../debs
--fstrans=no --showinstall=no --autodoinst=no --strip=yes
--stripso=yes --deldoc=yes --deldesc=yes --delspec=yes --nodoc -y
...
...

in a minimal "debootstrapped" ubuntu 12.04 base system.

Now the symptoms:

If I install the built debs in a "normal" ubuntu-12.04 host-system all
is well, that is, usb-redirection works as expected.
I'm using a win7 guest with a patched (fixed a race condition causing
boot failure when only using 1-cpu) version of
"spice-guest-tools-0.1".

If I use the same debs in my minimal debootstrapped base system,
hotplugged (usb-devices that are already plugged in before starting
remote-viewer only show-up once in the gui)  usb-devices are shown
twice in the remote-viewer client-gui, and I get the

"Could not auto-redirect ... at ...: Cannot connect an already
connected usb device"

error.

The usb mass-storage works without errors in the win7 guest.

the debootstrapped system is using an openbox-session and no auto-mounting.

What Information can I provide to help debug this problem?

remote-viewer --spice-debug
-device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=3
strace, valgrind?

Unfortunately I'm not at all experienced with debugging...

Best regards,
TF


2012/9/16 Trebor Forban <trebor.forban at gmail.com>:
> Hello Hans,
>
> sorry for the late response, and sorry for the noise. The error was self-made
> (conflicting builds/installs of gtk-spice with and without polkit support).
>
> Regards,
> TF
>
> 2012/9/5 Hans de Goede <hdegoede at redhat.com>:
>> Hi,
>>
>>
>> On 09/04/2012 09:42 PM, Trebor Forban wrote:
>>>
>>> Hello spice developers,
>>>
>>> can someone help me debug the following error message, which is
>>> displayed after inserting an usb-device although all seems to work:
>>>
>>> "Could not auto-redirect ... at ...: Cannot connect an already
>>> connected usb device"
>>
>>
>> Hmm, that is strange, that means that the hotplug code sees a device
>> show up which is already there...
>>
>> Questions:
>> 1) With which platform/os is this (on both the host and client side)
>> 2) If the client is Linux, and you can reproduce the error
>>    can you do an lsusb on the client, after the error please.
>> 3) Does the device work inside the guest after this, despite the error?
>> 4) What versions of qemu / spice-server / spice-gtk are you using ?
>>
>> Regards,
>>
>> Hans


More information about the Spice-devel mailing list