Bug 815175 - virt-viewer failed to initialize software smartcard.
virt-viewer failed to initialize software smartcard.
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-viewer (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-04-22 23:03 EDT by Geyang Kong
Modified: 2013-08-04 23:43 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-26 03:38:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
This is what I got with --spice-debug option. (61.66 KB, text/plain)
2012-04-22 23:03 EDT, Geyang Kong
no flags Details

  None (edit)
Description Geyang Kong 2012-04-22 23:03:38 EDT
Created attachment 579401 [details]
This is what I got with --spice-debug option.

Description of problem:
  virt-viewer failed to initialize software smartcard.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Imaging there is a running guest, and executed #yum groupinstall "smart card support".
2. mkdir ~/.netscape
3. certutil -N (use an empty password)
4. certutil -x -t "CT,CT,CT" -S -s "CN=cert1" -n cert1
5. certutil -x -t "CT,CT,CT" -S -s "CN=cert2" -n cert2
6. certutil -x -t "CT,CT,CT" -S -s "CN=cert3" -n cert3
7. spicec -p 5900 -h localhost --smartcard --smartcard-db ~/.netscape/ --smartcard-cert cert1,cert2,cert3
8. virt-viewer --spice-smartcard --spice-smartcard-db=~/.netscape/ --spice-smartcard-certificates=cert1,cert2,cert3 $guestname

Actual results:

1. After step7, guest can read smart card successfully.
2. After step8, there is an error in terminal. "GSpice-WARNING **: Failed to initialize smart card", and guest cannot get software smart card."

Expected results:

1. After step8, guest can get smart card just like spicec without error.

Additional info:

1. remote-viewer --spice-smartcard --spice-smartcard-db=~/.netscape/ --spice-smartcard-certificates=cert1,cert2,cert3 spice://, this command has the same issue.
Comment 1 Christophe Fergeau 2012-04-25 12:20:28 EDT
Step 8 works for me if I use the full path to ~/.netscape, /home/teuf/.netscape in my case. Can you confirm it's working for you too? It's also working if I change "--spice-smartcard-db=~/.netscape/" to "--spice-smartcard-db ~/.netscape/", and this makes the command line closer to the spicec one.

spicy has the same behaviour so it's a spice-gtk bug. The behaviour with and without = is inconsistent, but most apps accepting an optional '=' in their options probably have the same behaviour (I think the shell does the ~ -> /home/foo/ substitution when it's preceded by a blank space, but not when there's a =). If you can confirm things are working for you with the changes I mentioned, then I think we can close this bug with no further action.
Comment 2 Geyang Kong 2012-04-26 02:35:54 EDT
I have retried with following 2 commands
virt-viewer --spice-smartcard --spice-smartcard-db ~/.netscape/ --spice-smartcard-certificates=cert1,cert2,cert3 $guestname
virt-viewer --spice-smartcard --spice-smartcard-db /root/.netscape/ --spice-smartcard-certificates=cert1,cert2,cert3 $guestname
Both of them works well for me.
Comment 3 Christophe Fergeau 2012-04-26 03:38:14 EDT
Ok, thanks  for retesting, I'm closing this bug then. If anyone disagree, just reopen it.

Note You need to log in before you can comment on or make changes to this bug.