XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    [Windows Guest Tools] Cleaner Tool

    Scheduled Pinned Locked Moved Development
    10 Posts 7 Posters 11.9k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • borzelB Offline
      borzel XCP-ng Center Team
      last edited by

      Hello all together!

      I started to build a little tool, that should help to find the problems before installing/updating the Guest Tools in a Windows VM. For now its only a first start, but it can grow to a very usefull tool.

      Any constructive help or hint is very welcome!

      Later (so my plans) it should be a part of a new Guest Tools Installer.

      Issue: https://github.com/xcp-ng/xcp/issues/152
      GIT repository: https://github.com/xcp-ng/win-installer-ng

      borzel created this issue in xcp-ng/xcp

      open Windows guest tools pre-install checker #152

      S 1 Reply Last reply Reply Quote 3
      • borzelB Offline
        borzel XCP-ng Center Team
        last edited by

        If you have problems to install Citrix(TM) or XCP-ng Windows Guest Tools, please try the first working version of this tool:

        🎆 https://schulzalex.de/builds/xcp-ng/XCP-ng-Windows-Guest-Tools-Cleaner_alpha_1.0.0.0.zip 🎆

        Good

        2e40afde-6030-47dc-afbe-f6f17153c23b-grafik.png

        Bad

        c89d5bf1-7166-4291-8a0e-f9c86439f245-grafik.png

        1 Reply Last reply Reply Quote 3
        • Ced76C Offline
          Ced76
          last edited by

          Good work ! This tool will help us.

          1 Reply Last reply Reply Quote 1
          • A Offline
            AllooTikeeChaat
            last edited by

            @borzel Alex.. thanks for putting this wee tool together.

            1 Reply Last reply Reply Quote 0
            • J Offline
              JohnPCooper
              last edited by

              @borzel This looks like a great tool so when complete my studies and ever need to run or update a Windows VM for a client's web application. It will aid in doing so (especially if migrating from Xen Server).

              1 Reply Last reply Reply Quote 0
              • S Offline
                siodor
                last edited by

                @borzel
                I just noticed that your cleaner tool doesn't detect the "liteagent.exe" file which is the "XenServer Interface Service".

                borzelB 1 Reply Last reply Reply Quote 0
                • borzelB Offline
                  borzel XCP-ng Center Team @siodor
                  last edited by

                  @siodor thanks for the hint, I added it to https://github.com/xcp-ng/xcp/issues/152

                  borzel created this issue in xcp-ng/xcp

                  open Windows guest tools pre-install checker #152

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    JonathanPitre
                    last edited by borzel

                    Here's a copy of a script I was using to clean XenTools from XenServer 6.0 I believe. Please include all the reg keys and files mentioned. Thanks!

                    $appName = 'Citrix Tools for Virtual Machines'
                    $appFileName = 'uninstaller.exe'
                    $appParameters = '/S /NORESTART'
                    $appSourcePath = "${env:ProgramFiles(x86)}\Citrix\XenTools"
                    If (($ComputerManufacturer -ne "Xen") -and (Get-InstalledApplication -Name $appName))
                    {
                        Write-Log -Message "Uninstalling $appName ..." -WriteHost $True -LogType 'CMTrace'
                        # http://discussions.citrix.com/topic/347782-unable-to-installuninstall-xen-tools
                        Execute-Process -Path "$appSourcePath\$appFileName" -Parameters $appParameters -CreateNoWindow -PassThru
                        Remove-Folder -Path "$appSourcePath"
                        Remove-File -Path "$env:windir\System32\xennetco.dll"
                        Remove-File -Path "$env:windir\System32\drivers\xen*.sys"
                        Remove-File -Path "$env:windir\System32\drivers\scsifilt.sys"
                        Remove-File -Path "$env:windir\System32\drivers\xevtchn.sys"
                        Remove-RegistryKey -Key 'HKLM:\SOFTWARE\Citrix\XenTools' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\xenvbd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\xenvif' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\xenvbd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\xenvif' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\xenvbd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\xenvif' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\Citrix Xen Guest Agent' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xenbvd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xeniface' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xennet6' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\Application\xensvc' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xenvif' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\System\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\System\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\CurrentControlSet\services\eventlog\System\xenvbd' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\Citrix Xen Guest Agent' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xenbvd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xeniface' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xennet6' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\Application\xensvc' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xenvif' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\System\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\System\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\services\eventlog\System\xenvbd' -Recurse
                    
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\Citrix Xen Guest Agent' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xenbvd' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xeniface' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xennet' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xennet6' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xensvc' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\Application\xenvif' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\System\scsifilt' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\System\xenevtchn' -Recurse
                        Remove-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet002\services\eventlog\System\xenvbd' -Recurse
                    
                        Set-RegistryKey -Key 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}' -Name 'LowerFilters' -Value '' -Type MultiString
                    
                        If (Get-Service "XenSvc" -ErrorAction 'SilentlyContinue'){(Get-WmiObject -Class Win32_Service -Filter "Name='XenSvc'").Delete()}
                        If (Get-Service "XenPVInstall" -ErrorAction 'SilentlyContinue'){(Get-WmiObject -Class Win32_Service -Filter "Name='XenPVInstall'").Delete()}
                        Get-WmiObject -Query "SELECT * FROM __Namespace WHERE Name='xenserver'" -Namespace "root\cirix" -ErrorAction SilentlyContinue | Remove-WmiObject
                    } 
                    ElseIf (($ComputerManufacturer -eq "Xen") -and (Get-InstalledApplication -Name $appName)) 
                    {
                        Write-Log -Message "$appName is already installed." -WriteHost $True -LogType 'CMTrace'
                    }
                    Else
                    {
                        Write-Log -Message "Not a Citrix XenServer virtual machine." -WriteHost $True -LogType 'CMTrace'
                    }
                    
                    borzelB 1 Reply Last reply Reply Quote 0
                    • borzelB Offline
                      borzel XCP-ng Center Team @JonathanPitre
                      last edited by borzel

                      @JonathanPitre cool 🙂

                      I edited your post, please wrap code sections always with ```` before and after the textblock

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        Station-Already @borzel
                        last edited by

                        @borzel Does this still work with current versions of the guest tools?

                        1 Reply Last reply Reply Quote 0
                        • A Andrew referenced this topic on

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post