Microk8s: "microk8s install" fails on Windows 10 version 2004

Created on 2 Jul 2020  Â·  6Comments  Â·  Source: ubuntu/microk8s

"microk8s install" fails on Windows 10 with the following message:

An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

But, can install microk8s within microk8s-vm manually.

C:\>ver

Microsoft Windows [Version 10.0.19041.329]

C:\>multipass --version
multipass  1.3.0+win
multipassd 1.3.0+win

C:\>multipass list
No instances found.

C:\>microk8s install
One quick question before we launch … Would you like to help
the Multipass developers, by sending anonymous usage data?
This includes your operating system, which images you use,
the number of instances, their properties and how long you use them.
We’d also like to measure Multipass’s speed.

Launched: microk8s-vm
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

C:\>multipass shell microk8s-vm
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-109-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Jul  2 22:45:31 JST 2020

  System load:  0.23              Processes:           107
  Usage of /:   2.0% of 48.29GB   Users logged in:     0
  Memory usage: 83%               IP address for eth0: 172.18.244.15
  Swap usage:   0%


0 packages can be updated.
0 updates are security updates.


ubuntu@microk8s-vm:~$ sudo ping -c 1 snapcraft.io
PING snapcraft.io (91.189.91.44) 56(84) bytes of data.

--- snapcraft.io ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

ubuntu@microk8s-vm:~$ snap list
No snaps are installed yet. Try 'snap install hello-world'.
ubuntu@microk8s-vm:~$ sudo snap install microk8s --classic --channel=1.18/stable
2020-07-02T22:49:39+09:00 INFO Waiting for restart...
microk8s (1.18/stable) v1.18.4 from Canonical✓ installed

I did microk8s inspect, but I couldn't found the tarball.

PS D:\Temp> microk8s inspect
Inspecting Certificates
Inspecting services
  Service snap.microk8s.daemon-cluster-agent is running
  Service snap.microk8s.daemon-flanneld is running
  Service snap.microk8s.daemon-containerd is running
  Service snap.microk8s.daemon-apiserver is running
  Service snap.microk8s.daemon-apiserver-kicker is running
  Service snap.microk8s.daemon-proxy is running
  Service snap.microk8s.daemon-kubelet is running
  Service snap.microk8s.daemon-scheduler is running
  Service snap.microk8s.daemon-controller-manager is running
  Service snap.microk8s.daemon-etcd is running
  Copy service arguments to the final report tarball
Inspecting AppArmor configuration
Gathering system information
  Copy processes list to the final report tarball
  Copy snap list to the final report tarball
  Copy VM name (or none) to the final report tarball
  Copy disk usage information to the final report tarball
  Copy memory usage information to the final report tarball
  Copy server uptime to the final report tarball
  Copy current linux distribution to the final report tarball
  Copy openSSL information to the final report tarball
  Copy network configuration to the final report tarball
Inspecting kubernetes cluster
  Inspect kubernetes cluster

Building the report tarball
  Report tarball is at /var/snap/microk8s/1496/inspection-report-20200702_230747.tar.gz
bug

Most helpful comment

Try disabling Realtime protection on Windows Defender (in Windows 10 Options search for "Virus & Threat Protection" - under "Virus & Threat Protection Settings" click "_Manage Settings_". Turn off Realtime Protection.).

Unless you run a Registry change the Realtime Protection setting is re-enabled when Windows is restarted. You should be able to install Microk8s successfully - Windows Defender does not appear to affect it once it is installed. For performance reasons I would not use the Microk8s embedded Kubectl - you are better off installing the native version (use Chocolatey Package Manager to install it if you need it: _choco install kubernetes-cli_ ).

All 6 comments

Hi @tksh164,

Could you please try the steps listed here https://multipass.run/docs/troubleshooting-networking-on-windows and let me know if you can run micrko8s install afterwards, please?

Thanks,
Joe

Thank you @joedborg,

I did purge existing microk8s-vm, after that remove HNS network and reboot. But, the result was the same. Also, C:\WINDOWS\System32\drivers\etc\hosts.ics on my machine had only one microk8s-vm entry.

C:\>multipass list
Name                    State             IPv4             Image
microk8s-vm             Running           172.18.244.15    Ubuntu 18.04 LTS

C:\>multipass delete microk8s-vm

C:\>multipass list
Name                    State             IPv4             Image
microk8s-vm             Deleted           --               Not Available

C:\>multipass purge

C:\>multipass list
No instances found.
PS C:\> Get-HNSNetwork | ? Name -Like "Default Switch" | Remove-HNSNetwork

(reboot)

Microsoft Windows [Version 10.0.19041.329]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\>multipass list
No instances found.

C:\>microk8s install
Launched: microk8s-vm
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

C:\>multipass list
Name                    State             IPv4             Image
microk8s-vm             Running           172.28.26.75     Ubuntu 18.04 LTS

C:\>microk8s inspect
sudo: microk8s.inspect: command not found
An error occurred when trying to execute 'sudo microk8s.inspect' with 'multipass': returned exit code 1.

C:\WINDOWS\System32\drivers\etc\hosts.ics:

# Copyright (c) 1993-2001 Microsoft Corp.
#
# This file has been automatically generated for use by Microsoft Internet
# Connection Sharing. It contains the mappings of IP addresses to host names
# for the home network. Please do not make changes to the HOSTS.ICS file.
# Any changes may result in a loss of connectivity between machines on the
# local network.
#

172.24.34.89 fs1.mshome.net # 2020 7 2 7 13 15 54 462
172.28.26.75 microk8s-vm.mshome.net # 2020 7 4 9 14 41 31 210
172.20.70.170 mk8s.mshome.net # 2020 7 3 8 16 54 30 214
172.28.16.1 tp12.mshome.net # 2025 7 2 1 14 41 31 210
172.24.40.107 WIN-0DYNC87JNS9.mshome.net # 2020 7 2 7 5 19 40 337

 337


144.1 tp12.mshome.net # 2025 5 1 26 14 16 53 949
#172.27.149.97 WIN-BD6MDGK9NBO.mshome.net # 2020 6 3 3 7 26 46 948
N-OE1EKEL7T7F.mshome.net # 2020 3 2 31 5 46 27 820
8.88.0.233 WPT.mshome.net # 2020 3 2 31 5 39 21 886
9 21 886
6
8.88.0.233 WPT.mshome.net # 2020 3 2 31 5 39 21 886
5 39 21 886
2.18.88.237 WIN-VHMDQ7432U3.mshome.net # 2020 3 2 31 1 16 57 326
#8.88.0.233 WPT.mshome.net # 2020 3 2 31 5 39 21 886
326
172.17.181.114 WIN-VVFVBMI54BV.mshome.net # 2020 3 0 29 15 41 55 247
8.88.0.233 WPT.mshome.net # 2020 3 2 31 5 39 21 886

1 5 39 21 886
21 886
8.88.233 WPT.mshome.net # 2020 3 2 31 5 39 21 886
31 5 39 21 886

Thanks,
Takeshi

Hey @tksh164,

Thanks for trying that, sorry it didn't fix the issue.

What happens if you try:

multipass shell

(this will create a VM called primary)

Once you get a shell inside the VM, can you please try

ping 8.8.8.8
ping snapcraft.io

And let me know the results, please?

(You can then delete and purge the primary VM).

Thanks,
Joe

Hi @joedborg,

Sorry for the late reply. The results are the following:

PS C:\> multipass --version
multipass  1.3.0+win
multipassd 1.3.0+win

###########################################################################################
New Multipass 1.4.0 release
Better mount experience and configurable shortcut!

Go here for more information: https://github.com/CanonicalLtd/multipass/releases/tag/v1.4.0
###########################################################################################

PS C:\> multipass shell
Launched: primary

###########################################################################################
New Multipass 1.4.0 release
Better mount experience and configurable shortcut!

Go here for more information: https://github.com/CanonicalLtd/multipass/releases/tag/v1.4.0
###########################################################################################
Mounted 'C:\Users\tksh' into 'primary:Home'
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-112-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Sun Aug 16 23:40:56 JST 2020

  System load:  0.38              Processes:           105
  Usage of /:   22.4% of 4.67GB   Users logged in:     0
  Memory usage: 57%               IP address for eth0: 172.25.92.213
  Swap usage:   0%


0 packages can be updated.
0 updates are security updates.


ubuntu@primary:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
140 packets transmitted, 0 received, 100% packet loss, time 142329ms

ubuntu@primary:~$ ping snapcraft.io
PING snapcraft.io (91.189.91.45) 56(84) bytes of data.
^C
--- snapcraft.io ping statistics ---
104 packets transmitted, 0 received, 100% packet loss, time 105451ms

ubuntu@primary:~$

Thanks,
Takeshi

Try disabling Realtime protection on Windows Defender (in Windows 10 Options search for "Virus & Threat Protection" - under "Virus & Threat Protection Settings" click "_Manage Settings_". Turn off Realtime Protection.).

Unless you run a Registry change the Realtime Protection setting is re-enabled when Windows is restarted. You should be able to install Microk8s successfully - Windows Defender does not appear to affect it once it is installed. For performance reasons I would not use the Microk8s embedded Kubectl - you are better off installing the native version (use Chocolatey Package Manager to install it if you need it: _choco install kubernetes-cli_ ).

@mattscottuk Thank you for your suggestion. I'm going to try your solution when I get this issue again. Because I upgraded my machine to Windows 10 version 20H2 and not using the microk8s currently. So I will close this issue.

Was this page helpful?
0 / 5 - 0 ratings