Docker for Windows執行Container錯誤:No hypervisor is present on this system

在Windows 10 安裝完 Docker後,下載一個測試用的映象檔,在產生Container時出現下列的錯誤:

C:\> docker run hello-world bash
docker: Error response from daemon:
container 7d97d673d8f080a7a97da1272710f17f065594c330a7e95828aa7459d664252d
encountered an error during CreateContainer: failure in a Windows system call:
No hypervisor is present on this system. (0xc0351000)
...

其原因是未啟用Hyper-V的綠故,以系統管理員開啟powershell,並輸入下列指令
PS c:\> bcdedit /set hypervisorlaunchtype auto

成功執行上述指令後將電腦重開機再測試一次,這次就沒有問題了,但是啟用Hyper-V後,Oracle VirtualBox就不能用了。

如果同時有Docker與VirtualBox的需求,每次都要切換一次還挺麻煩的。

Windows 11安裝時跳過網路連線