convert/convert_windows.ml: Attempt to remove VMware drivers#144
convert/convert_windows.ml: Attempt to remove VMware drivers#144rwmjones wants to merge 2 commits into
Conversation
|
Draft because this doesn't work for me. There are two main problems:
|
0389f30 to
176648a
Compare
|
In this update, I run pnputil using the full path, and I've removed the logging code so now logs go straight into I did not squash the additional patches yet, and this is still a draft. However it appears to work, although I'm not sure if it is removing the correct drivers. It says it's removing a bunch of drivers called stuff like @vrozenfe please see if the log below looks correct: |
|
@rwmjones Looks good to me. Are you going to add the VMW services removal code as well? Best, Vadim. |
I don't know - which actual script is that? |
|
@vrozenfe: Other questions about the current patch:
|
|
@rwmjones Hi Richard. is somewhat aggressive. We could make it less invasive by only stopping and disabling the relevant services rather than deleting them. Regarding printing the actual driver name instead of just oemX.inf: I assume you are referring to the output section such as: We can extend the parsing logic to also capture the Original Name field from pnputil /enum-drivers. That would allow us to print something like: set COUNT=0 for /f "tokens=1,* delims=:" %%A in (%temp%\vmware_drivers.txt) do ( ) Regarding the pnputil path: we need to use the same path handling as in the other calls. One important detail is that firstboot itself is a 32-bit process. When a 32-bit service runs on a 64-bit Windows system, any process it spawns is normally subject to WOW64 filesystem redirection, which means System32 is redirected to SysWOW64. Right, no reboot is needed as firstboot does it by itself. Best, |
So removing the uninstall permanently bit? (https://github.com/virtio-win/vmwremover/blob/6d70ce6830a57c3f6dc8b43a327260b2b20358db/services/remove_vmware_services.bat#L140) I suspect it'd be better if all that went into a separate pull request rather than making this one more complex. Thanks for the other explanations. I will see if I can change the current pull request to print the service name. |
0bc8984 to
1fa22e8
Compare
|
I just squashed the commits together and rebased on top of master. Still more work to be done here. |
Since we want to use the full path of pnputil later, abstract out the Windows path of this utility. I also added an explanation of what we understand to be going on with the path here. This was originally written by Vadim Rozenfeld in the comment linked below. Link: libguestfs#144 (comment) Thanks: Vadim Rozenfeld
|
@vrozenfe I made this change to the script which appears completely innocuous. Yet when I make this change, the script no longer finds any drivers at all! What's going on? @@ -569,11 +576,9 @@ echo Searching for VMware drivers and packages
echo Filtering lines with Published Name and VMware...
findstr /i /c:"Published Name" /c:"Provider Name" "%temp%\all_drivers.txt" > "%temp%\vmware_drivers.txt"
-echo.
-echo ===== VMware Drivers Found =====
-
set COUNT=0
set LAST_PUBLISHED=
+set LAST_ORIGINAL=
for /f "tokens=1,* delims=:" %%A in (%temp%\vmware_drivers.txt) do (
set LINE=%%A
@@ -584,17 +589,22 @@ for /f "tokens=1,* delims=:" %%A in (%temp%\vmware_drivers.txt) do (
set LAST_PUBLISHED=!VALUE!
)
+ if /i "!LINE!"=="Original Name" (
+ set LAST_ORIGINAL=!VALUE!
+ )
+
if /i "!LINE!"=="Provider Name" (
echo !VALUE! | findstr /i "VMware" >nul
if !errorlevel! == 0 (
REM This Published Name belongs to VMware
if not "!LAST_PUBLISHED!"=="" (
- echo Found VMware INF: !LAST_PUBLISHED!
+ echo Found VMware driver: !LAST_ORIGINAL! (!LAST_PUBLISHED!)
set INF_LIST[!COUNT!]=!LAST_PUBLISHED!
set /a COUNT+=1
)
)
set LAST_PUBLISHED=
+ set LAST_ORIGINAL=
)
) |
1fa22e8 to
d622039
Compare
|
@vrozenfe Please see comments above, plus in the latest version it seems like the final |
|
@rwmjones Let me check it, and sorry for the inconvenience. |
|
@rwmjones Hi Richard. It should be something like this: :: --- Filter for VMware drivers --- echo. :: --- Parse driver list for VMware providers ---
I tested it briefly, since I don't have a proper VMware-converted image at the moment. |
We essentially expect that uninstalling VMware drivers will fail (because the VMware uninstaller is broken). Therefore add a firstboot script which does the next best thing, removing VMware drivers by hand. This requires Microsoft pnputil which is present in Windows >= Vista. Most of the hard work was done by and all of the batch file was written by Vadim Rozenfeld. Thanks: Vadim Rozenfeld Fixes: https://issues.redhat.com/browse/RHEL-112249 Related: https://github.com/virtio-win/vmwremover/blob/main/drivers/remove_vmware_driver_packages.bat
d622039 to
38287ab
Compare
|
Thanks, I think it was the addition of |
|
Actually, there were two issues: a missing /c:"Original Name" and (!LAST_PUBLISHED!), which should be ^(!LAST_PUBLISHED!^) (the ")" in the batch if statement needs to be escaped as "^)" ). |
|
Thanks, I got both in the latest version. |
|
The current status is that mxie tested this and found that although drivers are removed, some left over Windows Registry information remains. The effect of this information is that the Windows Removing the Windows Registry information is possible, but registry changes in general are invasive and completely beyond what Microsoft would recommend or support. There are some scripts in the vmwremover repo for removing stuff from the Registry (eg: https://github.com/virtio-win/vmwremover/tree/main/reg) but I don't know which one is needed and they're all pretty invasive. We also don't know if they work across all versions of Windows or what side effects they have. |
We essentially expect that uninstalling VMware drivers will fail (because the VMware uninstaller is broken). Therefore add a firstboot script which does the next best thing, removing VMware drivers by hand.
This requires Microsoft pnputil which is present in Windows >= Vista.
Most of the hard work was done by and all of the batch file was written by Vadim Rozenfeld.
Thanks: Vadim Rozenfeld
Fixes: https://issues.redhat.com/browse/RHEL-112249
Related: https://github.com/virtio-win/vmwremover/blob/main/drivers/remove_vmware_driver_packages.bat