Docker not working inside Hyper-V - VM

Hi - Unsure where to post this but having this issue when loading docker inside a hyper-v container.

Installed docker as admin on server 2022 and it just refuses to open with this parsing error below, I enabled hyper v inside the host I have re-installed and cleared the app data and a few other little things but looking for some more ideas…

Hope this is ok. Thanks.

Newtonsoft.Json.JsonReaderException:
Unexpected character encountered while parsing value: n. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__10.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 58
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__7.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 108
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.EngineStateMachine.<StartAsync>d__17.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\EngineStateMachine.cs:line 97
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.Engines.<StartAsync>d__25.MoveNext() in C:\workspaces\PR-21718\src\github.com\docker\pinata\win\src\Docker.Engines\Engines.cs:line 126
````Preformatted text`

I’d like to clarify: Did you install Docker on the Server and that server is a VM?
A few things:

  • Docker Desktop doesn’t work on Windows Server. You have to install Moby/Docker CE. More info here: Prepare Windows operating system containers | Microsoft Learn
  • You don’t need Hyper-V installed to run containers on Windows Server. Windows containers on Windows Server run with process isolation, so you’ll only need Hyper-V if you want to run hypervisor isolation.