Bashar:
Hi everyone, has anybody run into this issue when using kubeadm (VirtualBox + Vagrant)
Info:
Host = Windows 11
VirtualBox VM = ubuntu-20.04.3
Bringing machine 'kubemaster' up with 'virtualbox' provider...
Bringing machine 'kubenode01' up with 'virtualbox' provider...
Bringing machine 'kubenode02' up with 'virtualbox' provider...
==> kubemaster: Clearing any previously set forwarded ports...
==> kubemaster: Clearing any previously set network interfaces...
==> kubemaster: Preparing network interfaces based on configuration...
kubemaster: Adapter 1: nat
kubemaster: Adapter 2: hostonly
==> kubemaster: Forwarding ports...
kubemaster: 22 (guest) => 2711 (host) (adapter 1)
kubemaster: 22 (guest) => 2222 (host) (adapter 1)
==> kubemaster: Running 'pre-boot' VM customizations...
==> kubemaster: Booting VM...
==> kubemaster: Waiting for machine to boot. This may take a few minutes...
kubemaster: SSH address: 127.0.0.1:2222
kubemaster: SSH username: vagrant
kubemaster: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
unnivkn:
Hi @Bashar
see this error message:
If the box appears to be booting properly, you may want to increase
the timeout (“config.vm.boot_timeout”) value.
Please increase the value of config.vm.boot_timeout
from the default value of 600(10min) to 1200(20-min) & try again.
Bashar:
Increased:
Bringing machine 'kubenode01' up with 'virtualbox' provider...
Bringing machine 'kubenode02' up with 'virtualbox' provider...
==> kubemaster: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> kubemaster: flag to force provisioning. Provisioners marked to run always will still run.
==> kubenode01: Clearing any previously set forwarded ports...
==> kubenode01: Fixed port collision for 22 => 2222. Now on port 2200.
==> kubenode01: Clearing any previously set network interfaces...
==> kubenode01: Preparing network interfaces based on configuration...
kubenode01: Adapter 1: nat
kubenode01: Adapter 2: hostonly
==> kubenode01: Forwarding ports...
kubenode01: 22 (guest) => 2721 (host) (adapter 1)
kubenode01: 22 (guest) => 2200 (host) (adapter 1)
==> kubenode01: Running 'pre-boot' VM customizations...
==> kubenode01: Booting VM...
==> kubenode01: Waiting for machine to boot. This may take a few minutes...
kubenode01: SSH address: 127.0.0.1:2200
kubenode01: SSH username: vagrant
kubenode01: SSH auth method: private key
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Remote connection disconnect. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Remote connection disconnect. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Remote connection disconnect. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
kubenode01: Warning: Connection reset. Retrying...
Bashar:
I am afraid that there is problem with the networking.
unnivkn:
Could you please share your vagrant file ?
unnivkn:
May I know which version of VirtualBox you are using ? If it is old, please install the latest version & try
Bashar:
# -*- mode: ruby -*-
# vi:set ft=ruby sw=2 ts=2 sts=2:
# Define the number of master and worker nodes
# If this number is changed, remember to update setup-hosts.sh script with the new hosts IP details in /etc/hosts of each VM.
NUM_MASTER_NODE = 1
NUM_WORKER_NODE = 2
IP_NW = "192.168.56."
MASTER_IP_START = 1
NODE_IP_START = 2
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# <https://docs.vagrantup.com>.
config.vm.boot_timeout = 1200
# Every Vagrant development environment requires a box. You can search for
# boxes at <https://vagrantcloud.com/search>.
# config.vm.box = "base"
config.vm.box = "ubuntu/bionic64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
config.vm.box_check_update = false
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Provision Master Nodes
(1..NUM_MASTER_NODE).each do |i|
config.vm.define "kubemaster" do |node|
# Name shown in the GUI
node.vm.provider "virtualbox" do |vb|
vb.name = "kubemaster"
vb.memory = 2048
vb.cpus = 2
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
node.vm.hostname = "kubemaster"
node.vm.network :private_network, ip: IP_NW + "#{MASTER_IP_START + i}"
node.vm.network "forwarded_port", guest: 22, host: "#{2710 + i}"
node.vm.provision "setup-hosts", :type => "shell", :path => "ubuntu/vagrant/setup-hosts.sh" do |s|
s.args = ["enp0s8"]
end
node.vm.provision "setup-dns", type: "shell", :path => "ubuntu/update-dns.sh"
end
end
# Provision Worker Nodes
(1..NUM_WORKER_NODE).each do |i|
config.vm.define "kubenode0#{i}" do |node|
node.vm.provider "virtualbox" do |vb|
vb.name = "kubenode0#{i}"
vb.memory = 2048
vb.cpus = 2
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end
node.vm.hostname = "kubenode0#{i}"
node.vm.network :private_network, ip: IP_NW + "#{NODE_IP_START + i}"
node.vm.network "forwarded_port", guest: 22, host: "#{2720 + i}"
node.vm.provision "setup-hosts", :type => "shell", :path => "ubuntu/vagrant/setup-hosts.sh" do |s|
s.args = ["enp0s8"]
end
node.vm.provision "setup-dns", type: "shell", :path => "ubuntu/update-dns.sh"
end
end
end
Bashar:
VirtualBox Version 6.1.32 r149290 (Qt5.6.2)
Bashar:
Which is the latest
unnivkn:
may I know what is your windows IP? share all IPv4 Address
unnivkn:
from cmd–> ipconfig
unnivkn:
First 3-part enough eg: 192.168.0.
Bashar:
The adapter of virtualbox you need?
unnivkn:
pls check what is the first 3-part of all Ipv4 address,.
unnivkn:
check for this: Wireless LAN adapter Wi-Fi:
Bashar:
mine is under network 192.168.0.
Bashar:
Virtualbox host-only is under 192.168.56., but it should be irrelevant because the virualbox VM adapter is NAT
unnivkn:
okie… just try this: line number:7 in vagrant file, update this: IP_NW = “192.168.56.” with IP_NW = “192.168.0.”
unnivkn:
how much RAM & cpu you have in your windows host ?
Bashar:
setting it to 192.168.0 would cause collision