How to Force Delete the .minikube Folder on Windows 11 and Uninstall Minikube

If you’re running Minikube on Windows 11 and encounter issues with uninstallation, you may have noticed that it’s not always a straightforward process. The “file in use” error is a common frustration, especially when you try to delete the .minikube folder. In this guide, we will walk through the steps on how to completely uninstall Minikube and force delete the .minikube folder, even if other processes are preventing you from doing so.

Force Delete the .minikube Folder on Windows 11

Common Issues During Minikube Uninstallation

Users typically face the following issues when trying to uninstall Minikube on Windows 11:

  • Unable to delete the .minikube folder due to files being used by another process.
  • The Minikube uninstaller doesn’t remove all related files.
  • Leftover virtual machines in Hyper-V are still running, consuming system resources.
  • Minikube crashes or hangs frequently, prompting users to uninstall and reinstall the program.

Fortunately, with the right steps, you can completely remove Minikube from Windows 11 and resolve these errors.

Step-by-Step Guide to Uninstalling Minikube on Windows 11

1. Stop Running Minikube and Virtual Machines

Before you start the uninstallation process, you need to ensure that Minikube and its related virtual machines (VMs) are stopped. Here’s how to stop the Minikube VM:

minikube stop

If Minikube was set up using Hyper-V (the default for Windows 11), stopping the virtual machines in Hyper-V Manager can also help:

  1. Open Hyper-V Manager.
  2. Find the running Minikube VM, right-click it, and select Stop.
  3. After stopping the VM, close Hyper-V Manager.

2. Delete the Minikube Profile

Next, you need to delete the Minikube profile and all its associated files:

minikube delete --purge --all

This command ensures that all instances of Minikube are stopped and the profiles are removed. However, you might still encounter an error indicating that files in the .minikube folder are being used by another process.

3. Manually Stop Hyper-V Services (If Necessary)

If you still face issues while trying to delete the .minikube folder, you can manually stop Hyper-V services. In Windows 11, follow these steps:

  1. Open PowerShell as an administrator.
  2. Use the following commands to list and stop any running Hyper-V services:
Get-Service vmms
Stop-Service vmms
  1. Now try deleting the .minikube directory again.

4. Force Delete the .minikube Folder

Sometimes, Minikube files are locked by other processes, causing errors during deletion. To force delete the .minikube folder, you can use Safe Mode or third-party tools. Here’s how you can proceed:

force delete the .minikube folder on Windows 11 with this step-by-step guide
Force Delete the .minikube Folder
  • Method 1: Delete in Safe Mode
    1. Restart your Windows 11 computer in Safe Mode.
    2. Navigate to the .minikube folder located in C:\Users\[YourUsername]\.minikube.
    3. Manually delete the .minikube folder.
  • Method 2: Use Third-Party Software If Safe Mode doesn’t work, you can try using a third-party uninstaller like Revo Uninstaller:
    1. Download and install Revo Uninstaller.
    2. Search for “Minikube” in the program.
    3. Use the software to remove all associated files and directories, including the .minikube folder.

5. Clean Up Residual Files

Once Minikube is uninstalled, you should also delete the .kube folder, which stores Kubernetes configuration files. Here’s how:

  1. Navigate to the .kube folder:
    • C:\Users\[YourUsername]\.kube
  2. Manually delete this folder if it still exists.

6. Verify Minikube is Fully Uninstalled

To ensure that Minikube has been fully removed from your system, perform the following steps:

  1. Check for running VMs: Open Hyper-V Manager and verify that no Minikube VMs are left running.
  2. Check Program Files: Navigate to C:\Program Files\Kubernetes or C:\Program Files (x86)\Kubernetes to ensure all Minikube files are deleted.

Troubleshooting Uninstallation Errors

If you still encounter errors while uninstalling Minikube on Windows 11, it could be due to lingering system processes or misconfigured system settings. Here are a few additional solutions:

  • Use Task Manager to end any Minikube or Hyper-V processes still running.
  • Reboot your computer after stopping services to ensure no background processes hold on to files.
  • Run PowerShell as an administrator for all commands that stop services and delete files.

Conclusion

Uninstalling Minikube on Windows 11 can be challenging, especially when files are being used by other processes. By following this guide, you should be able to completely uninstall Minikube and remove the .minikube folder. Always ensure to stop running VMs and services, and consider using Safe Mode or third-party tools if manual deletion doesn’t work.

Shubhendu Bhatnager
Shubhendu Bhatnager

Shubhendu is a tech content writer with a knack for turning complex concepts into engaging and easy-to-understand content. With a keen eye for detail and a flair for storytelling, he crafts pieces that resonate with readers. When he's not at his keyboard, you'll find him relaxing and binge-watching, travelling and travel planning.

Articles: 65

Leave a Reply

Your email address will not be published. Required fields are marked *