Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1080731

Summary: [virtio-win][virtio-rng]Can not find 'QEMU VirtIO RNG Provider' on windows guest on win7-32
Product: Red Hat Enterprise Linux 7 Reporter: Xu Han <xuhan>
Component: virtio-winAssignee: Gal Hammer <ghammer>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, bcao, ghammer, hhuang, juzhang, mazhang, michen, virt-maint, xuhan
Target Milestone: rcKeywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virtio-win-prewwhql-0.1-78 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:18:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot
none
screenshot for win7-32 none

Description Xu Han 2014-03-26 03:36:53 UTC
Description of problem:
I tried to access to the virtio-rng device on a windows 2012r2 guest by using:
    ...
    if(!NT_SUCCESS(status = BCryptOpenAlgorithmProvider(
                                                &hRandomAlg,
                                                BCRYPT_RNG_ALGORITHM,
                                                L"QEMU VirtIO RNG Provider",
                                                0)))
    {
        wprintf(L"**** Error 0x%x returned by BCryptOpenAlgorithmProvider\n", status);
        goto Cleanup;
    }
    ...
but failed. The program returned:
"Error 0xc0000225 returned by BCryptOpenAlgorithmProvider"

And this error code means:
0xC0000225: STATUS_NOT_FOUND - The object was not found.
http://msdn.microsoft.com/en-us/library/cc704588.aspx

STATUS_NOT_FOUND - No provider was found for the specified algorithm ID.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa375479%28v=vs.85%29.aspx

I'm not sure if I were using the right steps. If not, please correct me. 


Version-Release number of selected component (if applicable):
virtio-win-prewhql-0.1-76
qemu-kvm-rhev-1.5.3-57.el7ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1. boot windows guest with virtio-rng device.
# /usr/libexec/qemu-kvm ... \
    -object rng-random,filename=/dev/random,id=rng-random0 \
    -device virtio-rng-pci,rng=rng-random0,id=rng0

2. install virtio-rng driver on guest

3. try to access to virtio-rng device.
CMD> random.exe

Actual results:
Error 0xc0000225 returned by BCryptOpenAlgorithmProvider.

Expected results:
virtio-rng device works properly.

Additional info:

Comment 1 juzhang 2014-03-26 03:54:58 UTC
Seems this is virtio-win bz.

Best Regards,
Junyi

Comment 2 Xu Han 2014-03-28 04:52:53 UTC
Also hit this problem on win7-64bit and win8.0-32bit guest.

Comment 3 Gal Hammer 2014-03-30 07:37:29 UTC
This is something that the installer should handle. In the mean while you can register the provider manually.

1. Copy the file viorngum.dll to C:\Windows\system32
2. Run (as admin) rundll32 C:\Windows\system32\viorngum.dll,RegisterProvider

Comment 4 Mike Cao 2014-03-31 02:41:11 UTC
hanxu ,pls retest it w/ comment #3

Comment 5 Xu Han 2014-03-31 03:20:24 UTC
Thanks for gal's feedback.

Re-tested with following steps on a win8-32bit guest:
1. Copy the file viorngum.dll to C:\Windows\system32
2. Run (as admin) rundll32 C:\Windows\system32\viorngum.dll,RegisterProvider
3. Try to generate random number

Result:
CMD> C:\Users\qiguo\Desktop\random.exe 
Generated random number is
0xdf, 0x3b, 0xd7, 0x85, 0xfd, 0x66, 0x6e, 0x79, 0xfa, 0x5a, 
0x46, 0x84, 0xee, 0xf6, 0xa1, 0x87, 0xcd, 0x8b, 0xb0, 0x78, 
0x4a, 0xdb, 0x88, 0x14, 0xe3, 0x7a, 0x50, 0x93, 0x9e, 0x30, 
0xfa, 0x0c, 0xe8, 0xaf, 0xa1, 0xe6, 0xa6, 0xc1, 0x22, 0x1d, 
0x10, 0x7c, 0x66, 0x86, 0x7e, 0xc7, 0x19, 0x1f, 0x0b, 0x21, 
0x89, 0xea, 0xfc, 0x1f, 0x74, 0x9a, 0x51, 0x7d, 0x47, 0x23, 
0xd0, 0x1d, 0xf9, 0x4f, 0x1c, 0x80, 0x23, 0x1c, 0xaf, 0x7b, 
0xfe, 0x23, 0xc3, 0x02, 0x46, 0x57, 0xd2, 0x59, 0xea, 0x1b, 
0x4a, 0x33, 0xa4, 0x34, 0x5b, 0x9d, 0xde, 0x64, 0x76, 0xb8, 
0xf0, 0x19, 0xb3, 0xe1, 0x79, 0xa5, 0x89, 0xff, 0xa4, 0xd3, 
0x1f, 0x22, 0xea, 0xb5, 0x7a, 0xac, 0xb6, 0xb1, 0x49, 0x77, 
0x80, 0xf9, 0x07, 0xa2, 0xdc, 0xe4, 0x6a, 0x38, 0x1f, 0x9a, 
0x98, 0x65, 0x06, 0x9c, 0x25, 0xce, 0x5e, 0xb1,

Comment 6 Mike Cao 2014-04-01 05:04:36 UTC
Re-Open this issue as I still can reproduce it on win7-32 guest

Comment 7 Mike Cao 2014-04-01 05:10:44 UTC
Created attachment 881202 [details]
screenshot

Comment 8 Gal Hammer 2014-04-01 08:14:59 UTC
(In reply to Mike Cao from comment #7)
> Created attachment 881202 [details]
> screenshot

Ever after following the steps in comment #3?

Which providers are listed under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Cryptography\Providers"?

Comment 9 Mike Cao 2014-04-01 09:20:49 UTC
(In reply to Gal Hammer from comment #8)
> (In reply to Mike Cao from comment #7)
> > Created attachment 881202 [details]
> > screenshot
> 
> Ever after following the steps in comment #3?

I mean I can not run (as admin) rundll32 C:\Windows\system32\viorngum.dll,RegisterProvider successfully ,see comment #7
> 
> Which providers are listed under
> "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Cryptography\Providers"?
referring to next screenshot attachment

Comment 10 Mike Cao 2014-04-01 09:26:07 UTC
Created attachment 881269 [details]
screenshot for win7-32

Comment 12 Mike Cao 2014-04-02 03:19:26 UTC
I still can reproduce this issue on win7-32 with virtio-win-prewhql-77
raising testblocker flag

Comment 13 Mike Cao 2014-04-02 03:29:34 UTC
I can not reproduce it on windows server 2012

Comment 14 Gal Hammer 2014-04-02 05:44:23 UTC
(In reply to Mike Cao from comment #13)
> I can not reproduce it on windows server 2012

What happens if you take the Windows Server 2012 dll (win8 directory if I'm not mistaken) and try to register it on a Windows 7 machine? I'm trying to understand if this is a bug in the registration code (my fault) or something is wrong in the dll signing (error in the build system).

Comment 15 Mike Cao 2014-04-02 05:52:13 UTC
(In reply to Gal Hammer from comment #14)
> (In reply to Mike Cao from comment #13)
> > I can not reproduce it on windows server 2012
> 
> What happens if you take the Windows Server 2012 dll (win8 directory if I'm

Tried the file in win8\x86 on win7-32 ,hit the same issue as comment #9.
Tried the file in win8\amd64 on win7-32 ,It reports it is not a valid win32 application 

I will try win8\x86 on win8-32 bit guest later 

Mike

Comment 16 Mike Cao 2014-04-02 06:00:24 UTC
(In reply to Mike Cao from comment #15)
> (In reply to Gal Hammer from comment #14)
> > (In reply to Mike Cao from comment #13)
> > > I can not reproduce it on windows server 2012
> > 
> > What happens if you take the Windows Server 2012 dll (win8 directory if I'm
> 
> Tried the file in win8\x86 on win7-32 ,hit the same issue as comment #9.
> Tried the file in win8\amd64 on win7-32 ,It reports it is not a valid win32
> application 
> 
> I will try win8\x86 on win8-32 bit guest later 
This matrix works fine 

> 
> Mike

Comment 17 Gal Hammer 2014-04-02 08:44:22 UTC
There was a redundant linker's command line option (/integritycheck) which cause this. I removed it and was able to register the dll on Window 7 32-bit.

Comment 20 Mike Cao 2014-04-03 02:12:49 UTC
Verified this bug on virtio-win-prewhql-78

Steps
1../RandByte
2.Start VM with virito-rng
/usr/libexec/qemu-kvm -M pc -m 6G -smp 4 -cpu host -usb -device usb-tablet -drive file=win7-32.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,mac=00:52:36:18:34:22,id=net0 -uuid 534daeff-e3af-451c-bbb7-b4ab8fb84079 -rtc-td-hack -no-kvm-pit-reinjection -chardev socket,id=a,path=/tmp/monitor-win2k8R2-serial,server,nowait -mon chardev=a,mode=readline -name win2k8-R2-serial -vnc :2 -vga cirrus -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=0 -monitor stdio -chardev socket,host=localhost,port=1024,id=chr0 -object rng-egd,chardev=chr0,id=rng0 -device virtio-rng-pci,rng=rng0
3.Copy the file viorngum.dll to C:\Windows\system32
4. Run (as admin) rundll32 C:\Windows\system32\viorngum.dll,RegisterProvider
5.random.exe in the guest 

Actual Results
it will generate random data successfully

Based on above ,this issue has been fixed ald ,move status to VERIFEID

Comment 21 Mike Cao 2014-04-03 03:37:01 UTC
Verified this bug on win7-64 guest as well steps same as comment #20

Comment 22 Ludek Smid 2014-06-13 10:18:58 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.