Git Product home page Git Product logo

alpine-vagrant's Introduction

This builds an up-to-date Vagrant Alpine Linux Base Box.

Currently this targets Alpine Linux 3.14.

Usage

Install Packer (1.7+), Vagrant (2.2.16+) and VirtualBox (6.1+).

If you are on a Debian/Ubuntu host, you should also install and configure the NFS server. E.g.:

# install the nfs server.
sudo apt-get install -y nfs-kernel-server

# enable password-less configuration of the nfs server exports.
sudo bash -c 'cat >/etc/sudoers.d/vagrant-synced-folders' <<'EOF'
Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/*
Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY
EOF

For more information see the Vagrant NFS documentation.

qemu-kvm usage

Install qemu-kvm:

apt-get install -y qemu-kvm
apt-get install -y sysfsutils
apt-get install -y rng-tools
systool -m kvm_intel -v

Type make build-libvirt and follow the instructions.

Try the example guest:

cd example
apt-get install -y virt-manager libvirt-dev
vagrant plugin install vagrant-libvirt
vagrant up --provider=libvirt
vagrant ssh
exit
vagrant destroy -f

VirtualBox usage

Install VirtualBox.

Type make build-virtualbox and follow the instructions.

Try the example guest:

cd example
vagrant up --provider=virtualbox
vagrant ssh
exit
vagrant destroy -f

Packer boot_command

The following table describes the steps used to install Alpine Linux.

NB This Packer boot_command method of installation is quite brittle, if you are having trouble installing, try increasing the install wait timeout, or changing the Alpine mirror in the answers file to one near you.

step boot_command
login as root root<enter>
bring up the network ifconfig eth0 up && udhcpc -i eth0<enter><wait5>
download the setup answers wget -q http://{{.HTTPIP}}:{{.HTTPPort}}/answers<enter><wait>
run the setup setup-alpine -f $PWD/answers<enter><wait5>
type the root password vagrant<enter>
re-type the root password vagrant<enter>
wait for the services to start <wait30s>
confirm that we want to erase sda y<enter>
wait for the installation to finish <wait4m>
mount the root partition mount /dev/sda3 /mnt<enter>
configure sshd to allow root login sed -i -E 's,#?(PermitRootLogin\s+).+,\1yes,' /mnt/etc/ssh/sshd_config<enter>
reboot to the installed system reboot<enter>

Reference

alpine-vagrant's People

Contributors

rgl avatar ageis avatar sidroberts avatar

Watchers

James Cloos avatar  avatar

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.