Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Discussions about using Windows guests in VirtualBox.
Locked
BroderO
Posts: 5
Joined: 26. Jul 2017, 22:53
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: RHEL/Debian/WIN

Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by BroderO »

Hi!

I cannot install Guest additions! They always fail with the message "Installation Aborted" and the error log showing this:

Code: Select all

Executing: "C:\Program Files\Oracle\VirtualBox Guest Additions\VBoxDrvInst.exe" netprovider add WebClient
Adding network provider "WebClient" (Order = 0) ...
RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!
Execution returned exit code: 2
Error excuting ""C:\Program Files\Oracle\VirtualBox Guest Additions\VBoxDrvInst.exe" netprovider add WebClient" (exit code: 2) -- aborting installation
Error excuting ""C:\Program Files\Oracle\VirtualBox Guest Additions\VBoxDrvInst.exe" netprovider add WebClient" (exit code: 2) -- aborting installation
Copy/paste between host/guest is not working, but other things like screen re-sizing and mouse integration, folder sharing etc. seems to work.

This is extremely annoying, as I will now have to use a text file that is shared as my copy/paste buffer!

Update: Disabling shared clipboard, save, re-enabling shared clipboard and reboot seems to have fixed the copy/paste problem.

Virtualbox is 5.1.24 r117012
VBoxGuestAdditions are 5.1.24
Guest is Win7
Under Settings/Display for the guest, I have tried playing around with 2D/3D acceleration with no change.
Under Settings/Audio, I hav e tried changing to the "Null Audio Driver" with no change.

Any ideas?
Last edited by BroderO on 26. Jul 2017, 23:40, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by socratis »

BroderO wrote:"C:\Program Files\Oracle\VirtualBox Guest Additions\VBoxDrvInst.exe"
That path looks suspicious. Are you following the instructions from the user manual? Ch. 4.2.1. Guest Additions for Windows? Mainly, are you using the menu Devices » Insert Guest Additions CD image, and then running the installer (if it hasn't started automatically)? That's definitely NOT the name of the installer, it's "VBoxWindowsAdditions.exe".

And remember that the Guest Additions are to be installed on the Guest.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
BroderO
Posts: 5
Joined: 26. Jul 2017, 22:53
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: RHEL/Debian/WIN

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by BroderO »

Yeah, I am not a beginner, have used computers since before Windows/DOS, I have run Virtualbox for almost 10 years, so almost since the beginning! Was running Windows in QEMU before Virtualbox existed (part of KVM today).

And yes, I am following the installation instructions, using "Devices" > "Insert Guest Additions CD Image..", then choosing "Run as administrator" on the "VBoxWindowsAdditions.exe" file on the mounted ISO image (on the guest OS). I have also remembered to reboot.

The path/file you see (C:\Program Files\Oracle\VirtualBox Guest Additions\VBoxDrvInst.exe) in the error message is the destination on the guests local disk where all files are installed. This is the standard location for these files....
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by mpack »

Error code 2 from RegQueryValueEx() apparantly is the system code for "File not found", which I guess means that the parent key in the registry was not found.

From the wording I'd guess VirtualBox was trying to add "WebClient" to the list of network providers, and found that the OS doesn't have a list of network providers.

Does this guest have networking and is it working?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by socratis »

mpack wrote:Error code 2 from RegQueryValueEx() apparantly is the system code for "File not found", which I guess means that the parent key in the registry was not found.
Nice catch Don! With that info and taking a look at the source code, the installer is trying to modify the following key:

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order]
"ProviderOrder"="VBoxSF,RDPNP,LanmanWorkstation,WebClient"
Believe it or not, the location and the value are exactly the same for Win2K all the way up to Win10. That's what I call backwards compatibility!

@BroderO
Follow mpack's advice and look for that key, not only for its existence, but for its access rights as well.

PS. I really can't tell someone's experience level just by looking at their "Joined" date and the number of "Posts"... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
BroderO
Posts: 5
Joined: 26. Jul 2017, 22:53
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: RHEL/Debian/WIN

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by BroderO »

The key is there, but only up to:

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order]
But I have another key that is very similar:

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder]
"ProviderOrder"="VBoxSF,RDPNP,LanmanWorkstation,WebClient,SnacNp,AdaptivaNetworkProvider"
So, I tried to create the "Order" key with this info:

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order]
"ProviderOrder"="VBoxSF,RDPNP,LanmanWorkstation,WebClient,SnacNp,AdaptivaNetworkProvider"
and that seems to have solved it! The installer now finishes!

I do not know why this key was missing, when it went missing, or how it got removed! Usually try to avoid poking around in the registry unless I have to (like now), and do not have a memory of touching it on this machine at all!

Impressive that you guys were able to find this so quickly, thanks a bunch!
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by socratis »

BroderO wrote:NetworkProvider\Order
BroderO wrote:NetworkProvider\HwOrder
In my Win 7 VM, I have both keys, with the "ProviderOrder"="VBoxSF,RDPNP,LanmanWorkstation,WebClient" value for both keys.

In your case however, you have two additional providers: "SnacNp" and "AdaptivaNetworkProvider". Maybe something that you've installed in the guest? The "SnacNp" comes up in Google as part of "Symantec Endpoint Protection" and the "AdaptivaNetworkProvider" has no results. So, maybe the installer of one of these two messed up your registry and deleted the key.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by mpack »

BroderO wrote: I do not know why this key was missing, when it went missing, or how it got removed!
My total guess, for what it's worth. Some inappropriate network related software was installed in the VM. The software didn't work and was uninstalled again: the uninstaller inadvertantly deleted that key inside of just deleting their own substring from it.
BroderO
Posts: 5
Joined: 26. Jul 2017, 22:53
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: RHEL/Debian/WIN

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by BroderO »

Yeah, this is a managed image from my work, needed for the applications that are only working on Windows managed images....
They officially support Linux (Ubuntu), MacOS and Windows, all 3 OS have managed versions, but still, some things only works on the Windows managed image. Go figure!

SnacNp is indeed Symantec Endpoint Protection, it is for "security".
AdaptivaNetworkProvider is for a peer-2-peer client IT uses to shove updates and "malware" applications onto our managed machines.
https://www.adaptiva.com/blog/2012/new- ... ent-video/
FirefighterGeek
Posts: 1
Joined: 26. Jan 2023, 19:42

Re: Guest additions "RegistryAddStringToList: RegQueryValueEx failed with 2, key type = 0x0!"

Post by FirefighterGeek »

Just a shout out to everyone else, BroderO's fix worked for me, too.
Reference post #p398464

added a string value to
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order]

String value name: ProviderOrder
String value: VBoxSF,RDPNP,LanmanWorkstation,WebClient

I used the same value names that were in
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\ProviderOrder]
Locked