Giter Club home page Giter Club logo

vfuse's Introduction

vfuse

This script takes a never-booted DMG and converts it to a VMware Fusion VM.

The germ of this idea came about, as all good ideas, and germs, do: while drinking beer. Specifically, I was tossing back drinks and tossing around ideas with Gilbert Wilson, and he mentioned that he uses the VMware CLI tools to convert DMGs to VMDKs based on a blog post he'd read. Intrigued, I asked Gil to email me the specifics. After seeing how potentially cool this was, I wrapped it up in this here terribly illegible, queasingly unpythonic script.

My thanks to Rich Trouton for testing this script for me and providing feedback. He is a saint among humans.

Requirements

  • VMware Fusion 7.x Professional
  • OS X 10.9.5+ (compatible with 10.10)
  • A never-booted image created with your favorite image creation tool.
  • I've only tested with 10.9.5 and 10.10. YMMV

Usage

usage: vfuse [-h] [-i INPUT] [-o OUTPUT] [-n NAME] [-w HW_VERSION]
             [-t TEMPLATE]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        /path/to/dmg
  -o OUTPUT, --output OUTPUT
                        /path/to/output/dir
  -n NAME, --name NAME  custom name
  -w HW_VERSION, --hw-version HW_VERSION
                        VMware hardware version
  -t TEMPLATE, --template TEMPLATE
                        use a template

Creating a VM

Running vfuse does not necessarily require sudo rights, but if you don't want to be prompted in the GUI for an admin password, run it with sudo. Escalated privileges is required to run the vmware-vdiskmanager binary, which vfuse uses.

The only required argument is -i aka --input. Run thusly, it will create a vm called osx-vm.vmwarevm in the current working directory:

sudo ./vfuse -i /path/to/OSX10.9.5_13F34.dmg

If you give it a URL, it will mount the dmg over the network.

sudo ./vfuse -i http://org.server.com/path/to/dmg

Alternatively, you can redirect the output directory, and/or give your VM a specific name:

sudo ./vfuse -i ~/Downloads/OSX10.9.5_13F34.dmg -o ~/vmtesting -n osx-mav

To use a custom virtualHW.version setting, i.e. for use with ESXi, use the -w argument

sudo ./vfuse -i ~/Downloads/OSX10.9.5_13F34.dmg -o ~/vmtesting -n osx-mav -w 10

Templates

Templates are simple json files that allow for automation and version control. The templating format is simple:

{
    "input": "/path/to/dmg",
    "output": "/path/to/output/dir",
    "name": "custom-name",
    "cache": false,
    "hw_version": 11
}

If you are using an http resource for the source DMG and cache is true, vfuse will cache the DMG in ~/.vfuse/ and will consult that directory before downloading the dmg again.

License

Copyright 2014 Joseph Chilcote

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

vfuse's People

Contributors

chilcote avatar

Watchers

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