Trying to run a couple of VMs using Vagrant. On running vagrant up command I get Call to virDomainCreateWithFlags failed: internal error - vagrant

Trying to run a CentOS 7 VM on Virtual Box using vagrant on my Fedora 35 machine.
On running the run the vagrant up & vagrant up --debug commands I get the following message as output.
There was an error talking to Libvirt. The error message is shown
below:
Call to virDomainCreateWithFlags failed: internal error: /usr/libexec/qemu-bridge-helper --use-vnet --br=virbr0 --fd=27: failed to communicate with bridge helper: Transport endpoint is not connected
stderr=failed to get mtu of bridge `virbr0': No such device

So I was making a rookie mistake of not properly defining the VM provider in vagrant up command. Running vagrant up --provider virtualbox fixed this issue.

Related

Vagrant + Virtual Box Session error

I am trying to fire up a vm via Vagrant using VirtualBox.
I got this error when I execute the command vagrant up (see below) using the latest versions of Virtual box 5.1.4 and Vagrant 1.7.4, therefore I downgraded Virtual box to 5.0 and Vagrant to 1.7.4 but it did not help.
I have installed the vagrant plugins vagrant-omnibus, vagrant-cashier and vagrant-berkshelf (version=4.1).
My OS is Mac OS X El Capitan and the vm that I am trying to run is a centos 6.
The final part of the output of the command "vagrant up" is:
default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "63825f6b-5189-4b66-bb7a-167c7f742c49", "--type", "headless"]
Stderr: VBoxManage: error: The VM session was aborted
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface Session
I googled this error and as many threads suggest I tried to restart VirtualBox, but I haven't had any success..
Below I copied the last few lines of the VM logs:
00:00:00.085763 APIC: Activating Local APIC
00:00:00.085782 CPUM: SetGuestCpuIdFeature: Enabled APIC
00:00:00.086115 PIT: mode=3 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:00.089080 Shared Folders service loaded
00:00:00.094857 DrvBlock: Flushes will be ignored
00:00:00.094868 DrvBlock: Async flushes will be passed to the disk
00:00:00.094970 VD: VDInit finished
00:00:00.095086 AIOMgr: Endpoint for file '/Users/daniele/VirtualBox VMs/my-vm_default_1475241914862_51348/centos-6.7-x86_64-disk1.vmdk' (flags 000c0723) created successfully
00:00:00.098079 VD: Opening the disk took 3191386 ns
00:00:00.098106 AHCI: LUN#0: disk, PCHS=16383/16/63, total number of sectors 83886080
00:00:00.098115 AHCI: LUN#0: using async I/O
00:00:00.098190 AHCI#0: Reset the HBA
00:00:00.098353 PIIX3 ATA: LUN#0: no unit
00:00:00.098358 PIIX3 ATA: LUN#1: no unit
00:00:00.098376 PIIX3 ATA: LUN#2: no unit
00:00:00.098380 PIIX3 ATA: LUN#3: no unit
00:00:00.098398 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:00.098411 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:00.104664 NAT: Guest address guess set to 10.0.2.15 by initialization
I ran out of ideas
Possible Solution 1:
I'm troubleshooting the same problem but with another Linux distro. I found a workaround for Mint 18 that may work for you too.
When I go into VirtualBox, and set the troublesome VM's Settings>Network value to 'Bridged..' or 'NAT network', then the VM starts. Further, I can browse/curl the Internet from that running VM.
The VirtualBox forums show that others are getting this error too.
Possible Solution 2:
In my experiments, older VirtualBox versions don't have this network problem. For example, versions 5.0.24 and 5.0.18 allow VM creation with no need for manual intervention.
Additional Info:
It's worth noting, that if you use Docker Toolbox, it will silently upgrade VirtualBox to whatever version it wants (e.g. Docker Toolbox 1.12.2 forces VirtualBox to 5.1.6).
At first I thought this problem was caused by VirtualBox defaulting to "NAT" as the network choice. But that's not the cause. VirtualBox 5.0.24 and 5.018 both use "NAT" and they work fine.
It was a bug in VirtualBox, it is now fixed in 5.1.8.
For reference: https://www.virtualbox.org/ticket/15687

Vagrant Windows 10 'hangs" on vagrant up

I've been having a problem with Vagrant (1.8.1, using VirtualBox 5.0.20) on Windows 10.
When I follow the getting started tutorial https://www.vagrantup.com/docs/getting-started/ after I have typed vagrant up, my console is stuck on:
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
It does not continue, i can see the VM boot inside of VirtualBox, and i can use the VirtualBox GUI to log in with the default credentials, so the VM itself is working.
According to https://www.vagrantup.com/docs/virtualbox/common-issues.html
I should run VirtualBox as admin and do vagrant up from a cmd.exe with admin rights, but when i do that i get the message:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "1b9d4f9b-04d8-48bf-8d16-d3aed99d341b", "--natpf1", "delete", "ssh"]
Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp
This seems different from the 100's of posts all around the net like these:
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/375
since I am not getting antying after the output listed above, it just sits there and after alike 10 minutes it comes up with the message:
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.
I've also read Vagrant stuck in "Waiting for VM to Boot" but it did not help me.
Is there anything else I am missing here?
In my case, vagrant up was hanging on 'Syncing VM folder' , on Windows 7 with Vagrant 1.9.3 and VBox 5.1.18 . It turned out that it requires Powershell >= 3.0.
I downloaded it from https://www.google.ca/search?q=powershell+3.0+download&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=x0fdWLfsBubQXu2OorAD, and worked fine afterwards.
try to turn off the VM from VirtualBox or from command line
C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe controlvm default poweroff
then restart the VM from vagrant.
In case you get an error when powering off the VM, force the shutdown
C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe startvm default --type emergencystop
Then vagrant up will should work nicely
I actually already found my problem. It was a .dll from some addware scanner that was preventing the virtualbox VM from starting. I lost the link to the forum topic which helped me solve this unfortunately.
What i did was open the logs from the VM in VirtualBox and had a read trough. At some point, a line indicating an error appeared with a .dll name which was the culprit. I deleted the offending .dll files from my pc and it was fixed.
If i find the link again to the topic explaining exactly what dll it was i will post it here. Im not at the machine that i fixed the problem on now so i can't access my search history.
Hope it will work for you as it worked for me
I'm still investigating why, but as a solution it works.
our case - when typed in cmd (inside vagrand image directory) "vagrant up"
it open virtual box vm and stuck on "default: SSH auth method:
private key" as mentioned in question
so fix by this steps:
open manually virtual box (besides what already opened by vagrant up)
run the vm that had added to the list (by vagrant up)
open CMD
type "Vagrant ssh"
and it will work
hope it helped,
best regards

Docker Quickstart Terminal fails to start VirtualBox VM in Windows 10

I've tried several times to start the Docker VM via the Docker Quickstart Terminal. After deleting the default virtual machine in VirtualBox I receive the following output
Creating Machine default...
Running pre-create checks...
Creating machine...
(default) OUT | Creating VirtualBox VM...
(default) OUT | Creating SSH key...
(default) OUT | Starting VirtualBox VM...
Error creating machine: Error in driver during machine creation: exit status 1
Looks like something went wrong... Press any key to continue...
To troubleshoot further, I attempted to start the default machine in the VirtualBox GUI directly using Start > Headless Start, as suggested in other Docker issues. The startup failed and I received an error dialog box with the content:
Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).
Result Code:
E_FAIL (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Versions of related components:
VirtualBox Version 5.0.11 r104393
Docker Toolbox 1.9.1a
Windows 10 Version 1511 (OS Build 10586.14)
One of the answers to this question solved my problem. Here it is with a few edits:
I found a solution
Open Windows Network Connections
Right click on VirtualBox Host only adapter that was created
Choose properties
Check "VirtualBox NDIS6 Bridged Networking driver"
Disable and Enable the highlighted item
For me "VirtualBox NDIS6 Bridged Networking Driver" was not checked. I checked it and clicked OK to close the Properties window. After that, the Docker Quickstart Terminal was able to start the VM successfully.
The same thing happened to me. At this moment I am using Windows Home.
At least in my case, what happened was that the environment variables DOCKER_MACHINE and DOCKER_TOOLBOX_INSTALL_PATH were not created for the system.
I just had to add them and it worked.
I tried to follow #chris-hunt answer, but I didn't found the highlighted item. I realized it was due to the fact I didn't installed the VirtualBOX that comes in the Docket Tools installation. I think I was using an older version.
So I uninstalled docker tools AND VitualBOX, both on windows Control Panel. After that, I reinstalled Docker Tools with the VirtualBOX checked, and it finally worked.

Types of errors docker in Windows?

When I began to start docker it stuck and there are so many bad problem with it
System: Windows 8.1 64-bit
I replace virtualbox 5.0.6 to virtualbox 5.0.7 Still, there's an error
Error One:
When Docker Quickstart Terminal want to begin Starting VM... is hanging
Error two
I test my installation with docker run hello-world I get the following:
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Error three
Kinematic doesn't work
It work until 99% BUT suddenly it doesn't work
Machine IP could not be fetched. Please retry the setup. If this fails please file a ticket on our GitHub repo.
Best solution I've found after googling for a while:
First check if your Virtualbox version is the latest or at least above 5, then
Run on CMD docker-machine rm -f ##dockerContainerName## (Generally: default)
Delete .docker folder from your user folder
Run docker-machine create --driver virtualbox ##dockerContainerName##
Profit!!!

Installing Kubernetes on mac with vagrant and virtualbox

This is my first attempt to install and use Kubernetes. I am trying to install an environment on Mac for developing my own apps and deploying them for test locally with Kubernetes. I am familiar with using Vagrant, VirtualBox and Docker for the same purpose. When I saw this page https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/vagrant.md I assumed it would be trivial. I executed these lines:
export KUBERNETES_PROVIDER=vagrant
curl -sS https://get.k8s.io | bash
This created a master VM and a Minion, but Kubernetes seems to have failed to start on the master. On the master /var/log/salt/master is full of python Traceback errors, like this:
2015-07-17 22:14:42,629 [cherrypy.error ][INFO ][3252] [17/Jul/2015:22:14:42] ENGINE Started monitor thread '_TimeoutMonitor'.
2015-07-17 22:14:42,736 [cherrypy.error ][ERROR ][3252] [17/Jul/2015:22:14:42] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/process/servers.py", line 187, in _start_http_thread
self.httpserver.start()
File "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1824, in start
raise socket.error(msg)
error: No socket could be created
Vagrant is version 1.7.3. VirtualBox is version 4.3.30
Have I made an obvious stupid mistake?
I don't yet know the fix but I know what is going wrong since it happens to me as well:
OS X 10.10.3
Vagrant 1.7.4
VirtualBox 4.3.30
Kubernetes 1.0.1
When I run the default configuration of this (which creates one "master" and one "minion" VM) I see that the static IP address is not being assigned to the "eth1" interface, and I also see that the Salt API server is sitting in what appears to be an infinite retry loop because it is trying to listen on that IP address.
Also, the following message happened during boot:
[vagrant#kubernetes-master ~]$ dmesg | grep eth1
[ 9.321496] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
So basically, the static IP address didn't get assigned because eth1 wasn't ready when the system first booted, and Salt is waiting for it to get assigned.
I could fix this after boot by sshing to the box using "vagrant ssh" and running the command:
sudo /etc/init.d/network restart
on each host.
This "fixes" eth1 by assigning the static IP address, and after that Salt begins to do its thing, installs Docker, boots various containers, and so on.
What I don't know is how to make this work every time without manual intervention. It appears to be some sort of a race condition between Vagrant and VirtualBox.
If you just want to kick the tires with Kubernetes, I'd recommend installing boot2docker and then following the Running kubernetes locally via Docker getting started guide. Once you are comfortable interacting with the Kubernetes API and want a more complex local setup, you can then work on installing Vagrant.
If the Vagrant instructions aren't working, you should also feel free to file a bug in the github repository.
The tutorial pointed by Robert is realy easy to run. Just change the version to 0.21.2 (maybe 0.21.3 works too).
Else, if you prefer a vagrant solution, try with pires cluster on vagrant. It runs with almost nothing to change.
Running Kubernetes inside VirtualBox requires 4 networks and some adjustments to the configuration:
The VirtualBox HOST ONLY network will be the network used to access the Kubernetes master and nodes from the Mac or PC.
The NAT Network to download packages from the Internet.
The internal connections between Kubernetes PODs uses a tunnel network TUN
The Kubernetes Cluster IP Network is a private IP range used inside the cluster to give each Kubernetes service a dedicated IP
Vagrantfile needs to pass the node public IPs to the Ansible roles that configure Kubernetes to set KUBELET_EXTRA_ARGS environment variable with the public IP of each node (required for reading logs using kubectl).
NodePort needs to be used to publish applications running inside the Kubernetes cluster as Load Balancers are not available in VirtualBox.
See the full example and download the code at Building a Kubernetes Cluster with Vagrant and Ansible (without Minikube), it has been tested in Ubuntu but should work on a MAC as well.

Resources