iamgini / vagrant-iac-usecases

Using Vagrant for Quick Sandboxes
Apache License 2.0
54 stars 108 forks source link

Getting error on a Windows 11 using Vagrant with VirtualBox #5

Open mshariful opened 1 year ago

mshariful commented 1 year ago

Hello,

I followed your video on Youtube and tried to setup an Ansible Lab on my Windows 11 PC with VirtualBox and Vagrant. I get the following error. Could you please help. TIA. Sharif

endro@LAPTOP-68SEHTAB MINGW64 ~/AnsibleVagrant/vagrant-iac-usecases/virtualbox-ansible-lab (master) $ vagrant up Bringing machine 'ansible-lab-node-1' up with 'virtualbox' provider... Bringing machine 'ansible-lab-node-2' up with 'virtualbox' provider... Bringing machine 'ansible-lab-control' up with 'virtualbox' provider... ==> ansible-lab-node-1: Box 'fedora/38-cloud-base' could not be found. Attempting to find and install... ansible-lab-node-1: Box Provider: virtualbox ansible-lab-node-1: Box Version: >= 0 The box 'fedora/38-cloud-base' could not be found or could not be accessed in the remote catalog. If this is a private box on HashiCorp's Vagrant Cloud, please verify you're logged in via vagrant login. Also, please double-check the name. The expanded URL and error message are shown below:

URL: ["https://vagrantcloud.com/fedora/38-cloud-base"] Error: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - Die Sperrfunktion konnte keine Sperrpr�fung f�r das Zertifikat durchf�hren.

iamgini commented 1 year ago

Are you using a private network? (Like office laptop and VPN/proxy based internet)

Try the below command and if you are able to download the box.

$ vagrant box add hashicorp/bionic64
$ vagrant box list
mshariful commented 1 year ago

Hi, Thanks for your reply. No I am using my home-net...no VPN, or proxy. I get this error:

$ vagrant box add hashicorp/bionic64 The box 'hashicorp/bionic64' could not be found or could not be accessed in the remote catalog. If this is a private box on HashiCorp's Vagrant Cloud, please verify you're logged in via vagrant login. Also, please double-check the name. The expanded URL and error message are shown below:

URL: ["https://vagrantcloud.com/hashicorp/bionic64"] Error: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - Die Sperrfunktion konnte keine Sperrpr�fung f�r das Zertifikat durchf�hren.

iamgini commented 1 year ago

That means you have issue with your internet connection! Try to ping google or hashicorp and see.

You should get something like below!

$  vagrant box add hashicorp/bionic64
==> box: Loading metadata for box 'hashicorp/bionic64'
    box: URL: https://vagrantcloud.com/hashicorp/bionic64
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) hyperv
2) virtualbox
3) vmware_desktop

Enter your choice: 2
==> box: Adding box 'hashicorp/bionic64' (v1.0.282) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/hashicorp/boxes/bionic64/versions/1.0.282/providers/virtualbox.box
==> box: Successfully added box 'hashicorp/bionic64' (v1.0.282) for 'virtualbox'!

let me know the outcome then.

mshariful commented 1 year ago

Hi, Thanks for your reply. I disabled my Avast antivirus and could get rid off the previous error. I could ping Google without any error. Now I get this new error:

$ vagrant up Bringing machine 'ansible-lab-node-1' up with 'virtualbox' provider... Bringing machine 'ansible-lab-node-2' up with 'virtualbox' provider... Bringing machine 'ansible-lab-control' up with 'virtualbox' provider... ==> ansible-lab-node-1: Importing base box 'centos/8'... ==> ansible-lab-node-1: Matching MAC address for NAT networking... ==> ansible-lab-node-1: Checking if box 'centos/8' version '2011.0' is up to date... ==> ansible-lab-node-1: Setting the name of the VM: ansible-lab-node-1 ==> ansible-lab-node-1: Clearing any previously set network interfaces... A host only network interface you're attempting to configure via DHCP already has a conflicting host only adapter with DHCP enabled. The DHCP on this adapter is incompatible with the DHCP settings. Two host only network interfaces are not allowed to overlap, and each host only network interface can have only one DHCP server. Please reconfigure your host only network or remove the virtual machine using the other host only network.

Please suggest how to fix this. TIA

iamgini commented 1 year ago

try to modify the network configuration as per your system.

if vagrant is not working, try to create the VMs in Vagrant and install manually.

https://www.techbeatly.com/creating-a-free-ansible-lab-in-public-cloud/