Giter Site home page Giter Site logo

fagrant's Introduction

Fagrant

Vagrant is slow, bloated and has quite some issues as a result. Inspired by Bocker, I created fagrant as a "100 lines of code" script to implement the functionality of Vagrant that I mostly use. If you're a very light Vagrant user, like me, then you might actually find this useful.

Top definition: Fagrant

A fake vagrant.

"Jeromy is too lazy to work 9-5, so he puts on dirty clothes and stands on a corner begging for change."

"That's pretty lame."

"Dude, he makes more than minimum wage as a fagrant."

Source: http://www.urbandictionary.com/define.php?term=Fagrant

Functionality

Currently, the following functionality is implemented in fagrant.

  • Creating a VM cloned from an existing VM
  • Using an existing VM as is with fagrant
  • SSH into the VM
  • Mounts current working directory on the VM so your files are accessible in the VM.
  • Bake the current state of the VM
  • Halting the VM
  • Destroying the VM

asciicast

How to use

For ease of use, fagrant utilises the same vocabulary as Vagrant. It uses the current working directory to initialise the environment (i.e. creating a VMFile) and shares the directory with the virtual machine as a shared folder.

To create a clone from an existing VM in your Virtualbox (see below to create a fagrant VM):

$ fagrant init <VM name>
$ fagrant up
$ fagrant ssh

As a feature for lazy people as myself, when SSH'ing as the vagrant user - Yes, vagrant - the insecure vagrant private key is used to perform passwordless login.

Once you're finished with your work, shut down the VM as such (use --force to pull the "plug"):

$ fagrant halt

Or delete the VM all together:

$ fagrant destroy

Other features

Because your time is valuable, fagrant allows the usage of an existing VM without cloning, which omits the time consuming cloning step.

$ fagrant up <VM name>

You can also define the user to log in with:

$ fagrant ssh root

Another feature is "baking", where we bake and store the current state of the VM. This allows for easy distribution and recreation of the exact same state as currently in the fagrant VM. For example:

$ # Do some stuff inside VM
$ fagrant bake "Application now supports awesome feature X!"

This is just a fancy (new?) devops term for snapshotting...

If you want to boot the VM with a GUI (not headless), use the --gui option:

$ fagrant up --gui

If you don't like the default user for SSH'ing into the box, you can configure your own default user:

$ echo "defaultuser" > ~/.fagrant

If you don't like the name "fagrant", you can just alias it in your .bashrc:

alias vm="fagrant"

Creating fagrant compatible VMs

  • Create a fagrant user (and give sudo rights)
  • Install fagrant public key into VM
  • Install VirtualBox Guest Additions
  • Add fagrant user to vboxsf group
  • Create directory /fagrant/ and set default mount point to /fagrant/
  • Load VirtualBox modules on boot
  • Enable auto-mounting of shared folder on login (put it in .bashrc)
  • Install puppet for provisioning

See make_vm.sh as an example of commands to execute. They're pretty similar to what one has to do to create a Vagrant box.

Disclaimer

Please don't take this project too Sirius. It was just a fun evening project.

fagrant's People

Contributors

adriaandens avatar xsawyerx 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

Watchers

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