GithubHelp home page GithubHelp logo

ipfs-vbox's Introduction

ipfs-vbox - boot VMs in virtual box with IPFS

Quick shell script to assist booting VMs with VirtualBox from IPFS. Based on https://github.com/zignig/astralboot

Install

git clone https://github.com/jbenet/ipfs-vbox
cd ipfs-vbox
cp ipfs-vbox /usr/local/bin/ipfs-vbox

You should now have:

> ipfs-vbox
usage: ipfs-vbox [ boot | rm ] <ipfs-path>
boot iso at <ipfs-path>

Usage

# add a vm
> ipfs add -w ipfs.iso
added QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso ipfs.iso

# run ipfs daemon + mount
> ipfs daemon --mount &

# boot a vm
> ipfs-vbox boot /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso

# remove a vm
> ipfs-vbox rm /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso

Example

First, get a vm image and add it to ipfs, like this:

> ipfs add -w ipfs.iso
added QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso ipfs.iso

(That o/ is a valid VM, so you should be able to test this script with it)

Make sure you have VirtualBox installed:

> VBoxManage --version
4.3.20r96996

Run the ipfs daemon mounted:

> ipfs daemon --mount
Initializing daemon...
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080

Check the iso is there, in the mounted /ipfs:

> stat /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso
771751942 17996664729543829149 -r--r--r-- 0 jbenet staff 0 27676672 "Aug 30 14:43:42 1754" "Aug 30 14:43:42 1754" "Aug 30 14:43:42 1754" "Aug 30 14:43:42 1754" 1048576 54056 0 /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso

Now, boot it with this script!

> ipfs-vbox boot /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso
...

You should see it boot like this:

Remove the vm with:

> ipfs-vbox rm /ipfs/QmRtavajASJyHcT4wVZkTS9s1XqtpFDW5jeUzGUzw6RPtb/ipfs.iso
VBoxManage: error: Invalid machine state: PoweredOff (must be Running, Paused or Stuck)
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component Console, interface IConsole, callee nsISupports
VBoxManage: error: Context: "PowerDown(progress.asOutParam())" at line 222 of file VBoxManageControlVM.cpp
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

ipfs-vbox's People

Contributors

jbenet avatar

Stargazers

 avatar Juan Alberto Cabrera Guerrero avatar RobertBrownieJr avatar  avatar  avatar Henry avatar Harlan T Wood avatar

Watchers

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