Unable to launch vagrant-lxc - vagrant

I'm trying to launch vagrant-lxc on Ubuntu 14.04. I'm using the latest Vagrant download (rather than the ancient version in the Debian repos).
vagrant plugin install vagrant-lxc
runs successfully, as does:
vagrant init fgrehm/precise64-lxc
I ran
sudo vagrant lxc sudoers
to handle the sudo issues mentioned here.
But when I run
vagrant up --provider=lxc
(both with and without sudo) the container doesn't load, spitting out this:
> Bringing machine 'default' up with 'lxc' provider...
==> default: Checking if box 'fgrehm/precise64-lxc' is up to date...
==> default: Setting up mount entries for shared folders...
default: /vagrant => /home/ubuntu
==> default: Starting container...
There was an error executing ["sudo", "/usr/local/bin/vagrant-lxc-wrapper", "lxc-start", "-d", "--name", "ubuntu_default_1456156125505_47833"]
For more information on the failure, enable detailed logging by
setting the environment variable VAGRANT_LOG to DEBUG
Here's the log output I'm getting (from /var/log/lxc/ ubuntu_default_1456156125505_47833.log):
lxc-start 1456158555.539 ERROR lxc_start - start.c:lxc_spawn:884 - failed initializing cgroup support
lxc-start 1456158555.568 ERROR lxc_start - start.c:__lxc_start:1121 - failed to spawn 'ubuntu_default_1456156125505_47833'
lxc-start 1456158555.568 ERROR lxc_start_ui - lxc_start.c:main:341 - The container failed to start.
lxc-start 1456158555.568 ERROR lxc_start_ui - lxc_start.c:main:343 - To get more details, run the container in foreground mode.
lxc-start 1456158555.568 ERROR lxc_start_ui - lxc_start.c:main:345 - Additional information can be obtained by setting the --logfile and --logpriority options.
Any ideas what I'm doing wrong?
Thanks,

Go into /home/<USERNAME>/.vagrant.d/boxes/fgrehm/precise64-lxc/.../lxc/lxc-config
file and
comment out:
lxc.pivotdir = lxc_putold
the do vigrant up again it should work!

Related

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

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.

Openwhisk on-premise install error

I tried to install an openwhisk VM on a windows 10 machine.
Cloned the git repo, cd'd to openwhisk/tools/vagrant and run ./hello.
Many, many minutes later, I get the following error.
==> default: :index
==> default: :goPrepare
==> default: FAILED
==> default: FAILURE:
==> default: Build failed with an exception.
==> default:
==> default: * What went wrong:
==> default: Execution failed for task ':goPrepare'.
==> default: > Create symbolic link at /home/vagrant/openwhisk/bin/openwhisk-cli/.gogradle/project_gopath/src/github.com/apache/incubator-openwhisk-cli
failed
Though I can find the index task in build.gradle, I can not find the goPrepare task under openwhisk-cli or the parent directories.
I presume this command was run on the newly created VM as I get
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
But running vagrant ssh does log me on to the VM.
Looking at the vagrantfile, there is
# Clone and Build CLI
echo "`date`: build-cli-start" >> /tmp/vagrant-times.txt
cd ${OPENWHISK_HOME}/bin
rm -rf openwhisk-cli
su vagrant -c 'git clone --depth=1 https://github.com/apache/incubator-openwhisk-cli.git openwhisk-cli'
cd openwhisk-cli
su vagrant -c './gradlew releaseBinaries'
echo "`date`: build-cli-end" >> /tmp/vagrant-times.txt
The log in /tmp shows build-cli-start but not build-cli-end.
The releaseBinaries task is in build.gradle but no links there.
Has anyone else come across this error? Does anyone know where the goPrepare task is?
Regards
Raised defect at https://github.com/apache/incubator-openwhisk/issues/3649.
Fixed in https://github.com/apache/incubator-openwhisk/pull/3651.
Updated git, run hello again and it works. Congrats to the openwhisk team for responding so quickly.

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

Error occurred when creating the ssh key (ssh-keygen returned 1)

vagrant init precise32
vagrant up
This normally works, i've not changed anything but now every time I try run vagrant it gives me
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Less insecure SSH key not found, generating key
Error occurred when creating the ssh key (ssh-keygen returned 1)
How do I fix this?
The error is caused by the new vagrant-rekey-ssh plugin.
If you do vagrant up --debug and examine the ouput, you will see that the following causes your command to fail:
Starting process: ["C:\\Program Files (x86)\\Git\\bin/ssh-keygen.EXE", "-f", "C:
/Users/Nik/.vagrant.d/less_insecure_private_key", "-N", ""]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: ssh-keygen.EXE": option requires an argument -- N
A simple fix for this problem is to manually generate a private key.
To do so simply do: ssh-keygen -f ~/.vagrant.d/less_insecure_private_key

Vagrant provision fail with puppet

Hello i have generated a vm on http://vmg.slynett.com/.
The vm works fine but nothing is installed on it.
I don't know why vagrant provision fail.
vagrant provision
[default] Running provisioner: Vagrant::Provisioners::Shell...
stdin: is not a tty
Europe/Paris
Current default time zone: 'Europe/Paris'
Local time is now: Fri Jun 28 13:15:42 CEST 2013.
Universal Time is now: Fri Jun 28 11:15:42 UTC 2013.
[default] Running provisioner: Vagrant::Provisioners::Puppet...
[default] Running Puppet with /tmp/vagrant-puppet/manifests/base.pp...
stdin: is not a tty
Warning: Could not retrieve fact fqdn
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type concat at /tmp/vagrant-puppet/modules-0/apache/manifests/init.pp:130 on node dev
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type concat at /tmp/vagrant-puppet/modules-0/apache/manifests/init.pp:130 on node dev
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
cd /tmp/vagrant-puppet/manifests && puppet apply --modulepath '/tmp/vagrant-puppet/modules-0' /tmp/vagrant-puppet/manifests/base.pp --detailed-exitcodes || [ $? -eq 2 ]
I am on mac OS X 10.8.3, virtualbox 4.2.6, Vagrant 1.2.2
It looks like you're referring to the concat module from ripenaar/concat and an error like that is usually thrown when a resource isn't present (i.e. not installed or in your module path).
I solved this problem by adding the concat and file_concat puppet modules to the puppet module path. I usually have all needed puppet modules as git submodules in puppet/modules of the vagrant project, so to add the concat and file_concat module, I do:
git submodule add https://github.com/puppetlabs/puppetlabs-concat.git puppet/modules/concat
git submodule add https://github.com/electrical/puppet-lib-file_concat.git puppet/modules/file_concat
Note that the concat module is the official one from puppetlabs and the file_concat module is the one used in concat (it should be installed automatically, but this didn't seem to work for me and may be your problem as well).

Resources