Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

docker-machine can't remove machine #3001

Open
jeanlaurent opened this issue Feb 5, 2016 · 9 comments
Open

docker-machine can't remove machine #3001

jeanlaurent opened this issue Feb 5, 2016 · 9 comments

Comments

@jeanlaurent
Copy link
Member

with the docker-machine 0.6.0 when you try to remove a machine in a weird state like this :

 Directory of C:\Users\docker\.docker\machine\machines\default
02/04/2016  03:11 PM        33,554,432 boot2docker.iso
02/04/2016  03:11 PM    <DIR>          default
02/04/2016  07:36 PM        88,195,072 disk.vhd
               2 File(s)    121,749,504 bytes

it fails :

C:\Users\docker>docker-machine rm -f default
About to remove default
Error removing host "default": open C:\Users\docker\.docker\machine\machines\default\config.json: The system cannot find the file specified.
Can't remove "default"
@Zimmergren
Copy link

Just bumped into this on my Win 10 box as well. Are there any obvious workarounds or fixes?

@filipegorges
Copy link

filipegorges commented Feb 22, 2017

@jeanlaurent @Zimmergren

Just managed to fix this! Follow the path that it's trying to access through Explorer: in my case, I had deleted those files manually in an attempt to remove the machine, because I couldn't remove it through docker-machine rm for some reason I can't remember , so I just created the missing folder and file:

  1. Open Explorer
  2. Go to C:\Users\your_user.docker\machine\machines
  3. Create a folder named default
  4. Open folder default
  5. Create empty file config.json
  6. Open Powershell
  7. Run docker-machine rm -f default
PS E:\workspace\hubbles\sources> docker-machine rm -f default
About to remove default
WARNING: This action will delete both local reference and remote instance.
Error removing host "default": Error getting migrated host: unexpected end of JSON input
Successfully removed default
PS E:\workspace\hubbles\sources> docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER   ERRORS
PS E:\workspace\hubbles\sources>

@rdhaese
Copy link

rdhaese commented Jul 5, 2017

@filipegorges
Thanks for your reply! I was having this exact same issue.

I already tried what you said, but it wasn't working. But thanks to you I looked into it again.

For others having this issue, but still can't delete the machine when they add the config.json file:
Check if VBoxHeadless.exe is running (using task manager), this is probably using a file in the machine folder.
Kill it, make sure you have the config.json file and remove ->
Successfully removed default

@MFry
Copy link

MFry commented Mar 4, 2018

Same issue on Windows 10 pro. I have not been able to fix this with either solution. VBoxHeadless.exe was not running.

@felipecruz91
Copy link

Thanks @rdhaese , it worked for me!

@mechdeveloper
Copy link

I am using docker toolbox in a Windows 7 machine, uninstalling and installing the docker toolbox again fixed this issue for me. :)

@valekar
Copy link

valekar commented Jan 27, 2019

Deleting C:\Users<username>\.docker folder worked for me

@danielgis
Copy link

restart worked for me virtualbox 6.1

@suryambose
Copy link

Thank you... it's worked for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants