Giter Site home page Giter Site logo

vagrant-alpine's Introduction

Vagrant Alpine Linux Guest

Gem Version Build Status

This is a Vagrant plugin adding support for Alpine Linux guests.

NOTE: The vagrant-alpine plugin requires Vagrant 1.7+

This plugin is now part of Vagrant core as of Vagrant 2.2.6. It is recommended that you uninstall the vagrant-alpine plugin if you are using Vagrant 2.2.6 or above.

Features

  • Detection
  • Set hostname
  • Configure networking DHCP or static
  • Halt/Shutdown the guest
  • RSync detection and installation
  • NFS client installation

Changes

  • v0.4.0 - updates for alpine 3.8+
  • v0.3.0 - update to fix defunct alpine apk repository in maier/alpine-3.3* boxes so that nfs client will install correctly.
  • v0.2.0 - add apk update and apk add --upgrade to nfs client install

Installation

$ vagrant plugin install vagrant-alpine

Usage

$ vagrant init maier/alpine-3.3.1-x86_64
$ vagrant up

or

$ vagrant init maier/alpine-3.2.3-x86_64
$ vagrant up

or

$ vagrant init maier/alpine-3.1.3-x86_64
$ vagrant up

Configuration

The vagrant-alpine plugin does not offer any configuration options.

Development

To work on the vagrant-alpine plugin, clone this repository, and use Bundler to get the dependencies:

$ gem install bundler -v '~> 1.7.0'
$ bundle install --path vendor/bundle

Once you have the dependencies, verify the unit tests pass with rake:

$ bundle exec rake

If those pass, you're ready to start developing. You can test the plugin without installing it into your Vagrant environment by creating a Vagrantfile in teh top level directory (it is gitignored). There is an example supplied in this repository. (cp Vagrantfile.example Vagrantfile and edit.)

Use bundler to execute Vagrant:

$ bundle exec vagrant up

Notes

Alpine Linux boxes for testing are available on Atlas. Packer templates for building the boxes are in this GitHub repository.

  1. (Atlas)[https://atlas.hashicorp.com/maier/boxes/alpine-3.1.3-x86_64] Alpine 3.1.3 box v1.3.0 is for VirtualBox v5, use box v1.2.0 for VirtualBox v4. The v1.2.0 (built with VirtualBox v4) has intermittent kernel panic when used with VirtualBox v5 and CPUs are set to > 1.
  2. Alpine 3.2.3 box (built with VirtualBox v5) is available on (Atlas)[https://atlas.hashicorp.com/maier/boxes/alpine-3.2.3-x86_64] now.

Using VAGRANT_LOG=info, Vagrant's --debug switch, and vb.gui = true were all very useful when originally developing this guest plugin.

vagrant-alpine's People

Contributors

blackikeeagle avatar jbonhag avatar louy2 avatar maier avatar thunderbrew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-alpine's Issues

Problem with Docker Provisioner

I assumed I'd be able to build an image with the Docker provisioner. Bad assumption?

...
==> db_master: Setting hostname...
==> db_master: Configuring and enabling network interfaces...
==> db_master: Installing NFS client...
==> db_master: Exporting NFS shared folders...
==> db_master: Preparing to edit /etc/exports. Administrator privileges will be required...
==> db_master: Mounting NFS shared folders...
==> db_master: Running provisioner: docker...
    db_master: Installing Docker onto machine...
Vagrant attempted to execute the capability 'docker_install'
on the detect guest OS 'alpine', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

Vagrantfile

Vagrant.configure("2") do |config|
  

  config.vbguest.auto_update = false
  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  config.vm.provision "docker" do |d|
    d.build_image "/vagrant/5.7"
  end

  config.vm.define "db_master" do |web|
    web.vm.box = "maier/alpine-3.6-x86_64"
    web.vm.hostname = 'db_master'

    web.vm.network :private_network, ip: "192.168.56.101"

    web.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--memory", 512]
      v.customize ["modifyvm", :id, "--name", "db_master"]
    end
  end

  config.vm.define "db_slave" do |db|
    db.vm.box = "maier/alpine-3.6-x86_64"
    db.vm.hostname = 'db_slave'

    db.vm.network :private_network, ip: "192.168.56.102"

    db.vm.provider :virtualbox do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.customize ["modifyvm", :id, "--memory", 512]
      v.customize ["modifyvm", :id, "--name", "db_slave"]
    end
  end
end

Does not work, in any order

With the plugin installed, the vagrant up still outputs the following:

[default] No installation found.
The guest's platform ("alpine") is currently not supported, will try generic Linux method...

Vagrant 1.8.5, osx10.11.6, alpine any version (3.4, 3.3.1, etc)

hanging on NFS, even though not specified in the config

Its basically hanging on the NFS setup.
How to turn it off ? Its no specified in the config that vagrant generated, so kind of weird.

kick off:


vagrant plugin install vagrant-alpine
vagrant init maier/alpine-3.1.3-x86_64
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'maier/alpine-3.1.3-x86_64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'maier/alpine-3.1.3-x86_64'
    default: URL: https://atlas.hashicorp.com/maier/alpine-3.1.3-x86_64
==> default: Adding box 'maier/alpine-3.1.3-x86_64' (v1.3.0) for provider: virtualbox
    default: Downloading: https://atlas.hashicorp.com/maier/boxes/alpine-3.1.3-x86_64/versions/1.3.0/providers/virtualbox.box
==> default: Successfully added box 'maier/alpine-3.1.3-x86_64' (v1.3.0) for 'virtualbox'!
==> default: Importing base box 'maier/alpine-3.1.3-x86_64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'maier/alpine-3.1.3-x86_64' is up to date...
==> default: Setting the name of the VM: vanadium_default_1449596035883_65578
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: 
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Mounting shared folders...
    default: /vagrant => /Users/apple/workspace/go/src/bitbucket.org/gedw99/bb/infra/vanadium
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

mount: mounting vagrant on /vagrant failed: No such device

config it made was:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# 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.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "maier/alpine-3.1.3-x86_64"

  # 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 forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # 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|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # 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.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   sudo apt-get update
  #   sudo apt-get install -y apache2
  # SHELL
end

Now the issue is that it is trying to setup NFS, even though its not specified in the config.

NFS Mount fails to install client

I'm having the following issue:

==> default: Installing NFS client...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

apk add nfs-utils

Stdout from the command:

(1/13) Installing krb5-conf (1.0-r1)
(2/13) Installing keyutils-libs (1.5.9-r1)
(3/13) Installing libverto (0.2.5-r0)
(4/13) Installing krb5-libs (1.14-r0)
ERROR: krb5-libs-1.14-r0: package mentioned in index not found (try 'apk update')
(5/13) Installing libtirpc (0.3.2-r1)
(6/13) Installing rpcbind (0.2.3-r1)
Executing rpcbind-0.2.3-r1.pre-install
(7/13) Installing libattr (2.4.47-r4)
(8/13) Installing libcap (2.24-r1)
(9/13) Installing libevent (2.0.22-r0)
(10/13) Installing libmount (2.27.1-r0)
(11/13) Installing libnfsidmap (0.25-r1)
(12/13) Installing sqlite-libs (3.9.2-r0)
(13/13) Installing nfs-utils (1.3.3-r1)
Executing busybox-1.24.1-r7.trigger
1 errors; 279 MiB in 59 packages


Stderr from the command:

This is quite easy to solve with:

vagrant ssh -c "apk --update upgrade" && vagrant reload --provision

I think that if you add only the update && upgrade before installing the nfs client it will solve the issue.

Alpine 3.10?

This is the fastest 3.8 that is available at the moment and I thought creating a box for latest Alpine will be awesome! 💯 👍

`echo 'something' >> /etc/apk/repositories` results in permissions issue

I'm trying to programmatically modify /etc/apk/repositories through the Vagrantfile generated by this repo. When I attempt via:

echo 'http://nl.alpinelinux.org/alpine/v3.3/main' >> /etc/apk/repositories'

I get the following: bash: /etc/apk/repositories: Permission denied

Prefixing the command with sudo doesn't appear to make a difference. Am I missing something obvious?

Use-case: Trying to install docker on an alpine vagrantbox (at provision time) using instructions here: https://wiki.alpinelinux.org/wiki/Docker

Thanks!

Virtual machine is extremely large

I noticed when I bring up an Alpine 3.3 VM with Docker, it takes up ~160MB in VirtualBox - when I bring up the same with vagrant-alpine with the same packages, it takes up ~340MB.

Any ideas why that is and any advice how to reduce the size?

[NFS] Setting up NFS fails (maier/alpine-3.1.3-x86_64)

Host: Ubuntu 15.04 / OSX 11.3.1
Box: maier/alpine-3.1.3-x86_64

When exeuting vagrant up the first time the setup for NFS fails.

* Caching service dependencies ...                                                                                   [ ok ]
 * Starting rpcbind ...
Error loading shared library libgssapi_krb5.so.2: No such file or directory (needed by /usr/lib/libtirpc.so.1)
Error loading shared library libkrb5.so.3: No such file or directory (needed by /usr/lib/libtirpc.so.1)
Error loading shared library libk5crypto.so.3: No such file or directory (needed by /usr/lib/libtirpc.so.1)
Error relocating /usr/lib/libtirpc.so.1: gss_display_status: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_delete_sec_context: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_sign: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_init_sec_context: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_verify_mic: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_unwrap: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_release_buffer: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_release_name: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_get_mic: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_release_cred: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_wrap: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_accept_sec_context: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_duplicate_name: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_acquire_cred: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_import_name: symbol not found
Error relocating /usr/lib/libtirpc.so.1: gss_display_name: symbol not found
Error relocating /usr/lib/libtirpc.so.1: GSS_C_NT_HOSTBASED_SERVICE: symbol not found
 * start-stop-daemon: failed to start `/sbin/rpcbind'                                                                 [ !! ]
 * ERROR: rpcbind failed to start
 * ERROR: cannot start rpc.statd as rpcbind would not start

Solution

Run sudo apk update && sudo apk upgrade after the first time you called vagrant up.

Steps:

vagrant up
vagrant ssh -c "sudo apk update && sudo apk upgrade"
vagrant halt
vagrant up

Update ouput:

fetch http://dl-6.alpinelinux.org/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
v3.1.4-201-g3abe446 [http://dl-6.alpinelinux.org/alpine/v3.1/main]
OK: 4869 distinct packages available
(1/8) Upgrading libcrypto1.0 (1.0.1p-r0 -> 1.0.1r-r0)
(2/8) Upgrading libssl1.0 (1.0.1p-r0 -> 1.0.1r-r0)
(3/8) Upgrading openssh-client (6.7_p1-r2 -> 6.7_p1-r3)
(4/8) Upgrading openssh (6.7_p1-r2 -> 6.7_p1-r3)
(5/8) Upgrading openssl (1.0.1p-r0 -> 1.0.1r-r0)
(6/8) Upgrading sudo (1.8.12-r0 -> 1.8.15-r0)
(7/8) Upgrading krb5-libs (1.13-r1 -> 1.13.2-r0)
(8/8) Upgrading sqlite-libs (3.8.10.2-r0 -> 3.8.10.2-r1)
Executing busybox-1.22.1-r15.trigger
Executing ca-certificates-20141019-r0.trigger
OK: 226 MiB in 59 packages

Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "maier/alpine-3.1.3-x86_64"

  config.vm.network "private_network", ip: "192.168.200.10"
  config.vm.synced_folder './data', '/vagrant', type: 'nfs'

end

basic instructions did not work

> vagrant plugin install vagrant-alpine
Installing the 'vagrant-alpine' plugin. This can take a few minutes...
Installed the plugin 'vagrant-alpine (0.1.1)'!
> vagrant init maier/alpine-3.1.3
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'maier/alpine-3.1.3' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'maier/alpine-3.1.3' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, 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://atlas.hashicorp.com/maier/alpine-3.1.3"]
Error: The requested URL returned error: 404 Not Found
> vagrant -v
Vagrant 1.7.3
> uname -a
Darwin lorien.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

vagrant halt doesn't work

Alpine lacks shutdown, and uses poweroff instead. Where shall I alias it to make vagrant halt work?

nfs mounting problems

Hello!

I finally manage to solve VirtualBox Guest additions problem. Here is the commit which allow build up alpine linux box with working guest additions.

Vagrant box is located there: https://atlas.hashicorp.com/Dalee/boxes/alpine
But, i'm experiencing some problems to manage plugin to work:

Plugins installed:

> vagrant plugin list
vagrant-alpine (0.2.0)
vagrant-share (1.1.5, system)

Sample Vagrantfile:

Vagrant.require_version ">= 1.8.0"
Vagrant.configure("2") do |config|

    config.vm.box = "Dalee/alpine"
    config.vm.provider :virtualbox do |v|
    	v.gui = true
        v.memory = 512
        v.cpus = 1
    end

    config.vm.network "private_network", type: "dhcp"
    config.vm.synced_folder ".", "/home/web/project", type: "nfs"
end

And the vagrant message:

 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x00000103265ad0>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::NFSNoGuestIP: No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.>
ERROR vagrant: No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:131:in `rescue in read_dynamic_machine_ip'

Any suggestions?

Getting "Failed to mount folders in Linux guest" with Alpine 3.3.1

When I run I see the following:

➜  vagrant init maier/alpine-3.3.1-x86_64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
➜ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'maier/alpine-3.3.1-x86_64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'maier/alpine-3.3.1-x86_64'
    default: URL: https://atlas.hashicorp.com/maier/alpine-3.3.1-x86_64
==> default: Adding box 'maier/alpine-3.3.1-x86_64' (v1.0.0) for provider: virtualbox
    default: Downloading: https://atlas.hashicorp.com/maier/boxes/alpine-3.3.1-x86_64/versions/1.0.0/providers/virtualbox.box
==> default: Successfully added box 'maier/alpine-3.3.1-x86_64' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'maier/alpine-3.3.1-x86_64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'maier/alpine-3.3.1-x86_64' is up to date...
==> default: Setting the name of the VM: alpine_default_1455713139995_64487
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: 
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Mounting shared folders...
    default: /vagrant => /Users/Admin/vagrant/alpine
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

mount: mounting vagrant on /vagrant failed: No such device

Any ideas?

NFS client install returning a 404

Firstly, thanks for this! I was excited, and I'm a little bummed to be getting this error now.

fetch http://repos.dfw.lax-noc.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
ERROR: http://repos.dfw.lax-noc.com/alpine/v3.3/main: No such file or directory
v3.3.1-58-ga22d4a0 [http://repos.dfw.lax-noc.com/alpine/v3.3/main]
1 errors; 5314 distinct packages available

resolv.conf empty

Hi

I'm running OS X Sierra, VirtualBox 5.1.26, Vagrant 1.9.7.
Installed this plugin and trying to get a Alpine instance working.
The error is get when running vagrant up is

==> alpine: Configuring and enabling network interfaces...
No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.

Using box maier/alpine-3.6-x86_64 I've tried following

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.memory = 256
    vb.cpus = 1
    vb.customize [
      'modifyvm', :id,
      '--natdnshostresolver1', 'on',
      '--nic1', 'nat',
      '--cableconnected1', 'on'
    ]
  end

and

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.memory = 256
    vb.cpus = 1
  end

And networking is set as following

alpine.vm.network :private_network, type: "dhcp"

Networking works, but /etc/resolv.conf is empty.

Trying the same stuff with box ubuntu/xenial64 everything works.

Any idea on what I could be doing wrong?

Kernel panic

I ran into this problem today:

screen shot 2015-11-03 at 5 32 54 pm

Here's how my Vagrantfile looks like:

NODES = 1
MEMORY = 2048
CPUS = 2

config.vm.define "alpine-1" do |node|
  node.vm.box = "maier/alpine-3.1.3-x86_64"
  node.vm.synced_folder ".", "/vagrant", disabled: true

  # setup vm
  node.vm.provider :virtualbox do |v|
    v.name = "alpine-1"
    v.memory = MEMORY
    v.cpus = CPUS
    v.gui = true
  end
end

I tried multiple times, to no avail. I'm using OSX as my host. Have you ever run into something like this before?

Can't install on LinuxMint 18

$ cat /etc/apt/sources.list.d/official-package-repositories.list
deb http://packages.linuxmint.com sarah main upstream import backport #id:linuxmint_main
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ xenial partner

$ sudo apt install vagrant build-essential ruby-dev ri virtualbox
$ vagrant -v
Vagrant 1.8.1
$ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
$ gem -v
2.5.1

$ vagrant plugin install vagrant-alpine
Installing the 'vagrant-alpine' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=': undefined method `group_by' for nil:NilClass (NoMethodError)
        from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem'
        from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install'
        from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install'
        from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin'
        from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin'
        from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call'
        from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call'
        from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call'
        from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run'
        from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
        from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run'
        from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action'
        from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute'
        from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each'
        from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute'
        from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute'
        from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute'
        from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli'
        from /usr/bin/vagrant:173:in `<main>'

Why? Can help me? Thanks

3.3.1 metadata is malformed?

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'maier/alpine-3.3.1-x86_64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'maier/alpine-3.3.1-x86_64'
    default: URL: https://atlas.hashicorp.com/maier/alpine-3.3.1-x86_64
The metadata for the box was malformed. The exact error
is shown below. Please contact the maintainer of the box so
that this issue can be fixed.

Caught Encoding::CompatibilityError at '{"description":"Alpi': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)

alpine 3.5 support: small mod needed

Hi,

I create a vagrant box for alpine 3.5 using your template, found that two more lines are needed, nfs_client.rb needs to look like this:

            comm.sudo('apk update')
            comm.sudo('apk add --upgrade nfs-utils')
            comm.sudo('rc-update add rpcbind')
            comm.sudo('rc-service rpcbind start')
            comm.sudo('rc-update add rpc.statd')
            comm.sudo('rc-service rpc.statd start')

so two lines for rpcbind needed to be added.My first exposure to Ruby, but this worked. Could not find out how to detect alpine version number to make this only apply to alpine 3.5, but anyway.

Thanks for this plugin and the boxes.

Vagrant error on alpine startup

Not sure if this is the right place, however I would really like to use alpine iwth vagrant to save lots of diskspace. Unfortunately I get this error on vagrant up of maier/alpine-3.4-x86_64:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the command was:

mount: mounting vagrant on /vagrant failed: No such device

Can't get NFS working

Dear,

I am trying to get a sync folder working using NFS as you mentioned in the README.
If I run :

$ vagrant plugin list
vagrant-alpine (0.1.1)
vagrant-exec (0.5.2)
vagrant-hostmanager (1.5.0)
vagrant-share (1.1.3, system)

$ cat Vagrantfile 
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "maier/alpine-3.1.3-x86_64"
  config.vm.network "private_network", ip: "192.168.200.10"
  config.vm.synced_folder ".", "/vagrant", type: "nfs"
end

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'maier/alpine-3.1.3-x86_64' is up to date...
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
It appears your machine doesn't support NFS, or there is not an
adapter to enable NFS on this machine for Vagrant. Please verify
that `nfsd` is installed on your machine, and try again. If you're
on Windows, NFS isn't supported. If the problem persists, please
contact Vagrant support.

The Vagrantfile is actually the one provided by the command :\

$ vagrant init maier/alpine-3.1.3-x86_64

in which I added the modifications you asked on the network and removed the comments to make it readable.

Maybe a dumb question, is it normal that the version of the plugin is 0.1.1 while current version on Atlas is 1.2.0?

Last thing maybe unrelated, if I disable nfs with :

config.vm.synced_folder '.', '/vagrant', disabled: true

I am able to boot the VM and when I try to halt it, I get the message :

$ vagrant halt
==> default: Attempting graceful shutdown of VM...
The SSH connection was unexpectedly closed by the remote end. This
usually indicates that SSH within the guest machine was unable to
properly start up. Please boot the VM in GUI mode to check whether
it is booting properly.

Could you tell me what I've done wrong?

Thanks a lot,
Regards,
Maxime

EDIT: Forgot to mention, I am running Ubuntu 14.04.2 LTS with Linux 3.13.0-55-generic and vagrant version is 1.7.3

alpine plugin fails on OSX when run with landrush

I was trying the alpine box with landrush but get an error message that looks like a conflicting operation of the landrush module.

==> haproxy: Waiting for machine to boot. This may take a few minutes...
    haproxy: SSH address: 127.0.0.1:2222
    haproxy: SSH username: vagrant
    haproxy: SSH auth method: private key
    haproxy: 
    haproxy: Vagrant insecure key detected. Vagrant will automatically replace
    haproxy: this with a newly generated keypair for better security.
    haproxy: 
    haproxy: Inserting generated public key within guest...
    haproxy: Removing insecure key from the guest if it's present...
    haproxy: Key inserted! Disconnecting and reconnecting using new SSH key...
Vagrant attempted to execute the capability 'iptables_installed'
on the detect guest OS 'alpine', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

I found a way to switch the landrush plugin off by adding config.landrush.guest_redirect_dns = false to the vagrant config but now I am getting the below error:

==> haproxy: Setting hostname...
==> haproxy: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

hostname -I

Stdout from the command:



Stderr from the command:

hostname: unrecognized option: I
BusyBox v1.24.1 (2015-12-16 08:00:02 GMT) multi-call binary.

Usage: hostname [OPTIONS] [HOSTNAME | -F FILE]

Get or set hostname or DNS domain name

    -s  Short
    -i  Addresses for the hostname
    -d  DNS domain name
    -f  Fully qualified domain name
    -F FILE Use FILE's content as hostname

Did anyone ever got this plugin to work with landrush on OSX?

Many thanks,
Niels

rsync install

rsync can not install without an apk update or apk SHOULD use --no-cache.

I propose the following changes:

module VagrantPlugins
  module GuestAlpine
    module Cap
      class RSync
        def self.rsync_installed(machine)
          machine.communicate.test('which rsync')
        end

        def self.rsync_install(machine)
          machine.communicate.tap do |comm|
            comm.sudo('apk --no-cache add rsync')
          end
        end
      end
    end
  end
end

Synced Folder SMB support

Without VBGA, SMB is the only choice of bi-dir folder syncing method on Windows. It seems to be as easy as installing cifs-utils. I'd love to help with coding and testing.

Upstreaming into official Vagrant

Hello @maier,

I have been working on an upstream-compatible version of your plugin here, which I ultimately plan to get ready for upstreaming into official vagrant.

Do you mind if I open a pull-request from that branch against upstream Vagrant? I'd mark it as WIP first, to track progress (since some parts might still need cleaning) and to get opinions on this from the Vagrant developers.

Could you release a new version

Could you please release a new version so we can use alpine 3.8 guests without manually having to change things in the vagrant-alpine plugin locally?

The following SSH command responded with a non-zero exit status???

{ vagrant-alpine } master » vagrant up /cygdrive/g/vagrantCluster/vagrant-alpine
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'maier/alpine-3.3.1-x86_64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'maier/alpine-3.3.1-x86_64' is up to date...
==> default: Setting the name of the VM: vagrant-alpine-test
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: password
default: Warning: Remote connection disconnect. Retrying...
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
[default] No installation found.
The guest's platform ("alpine") is currently not supported, will try generic Linux method...
Copy iso file D:\sofeware\virtualbox5118\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: mounting /dev/loop0 on /mnt failed: Invalid argument

==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
**==> default: [vagrant-hostsupdater] Checking for host entries
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount /tmp/VBoxGuestAdditions.iso -o loop /mnt

Stdout from the command:

Stderr from the command:

mount: mounting /dev/loop0 on /mnt failed: Invalid argument**

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.