Code Monkey home page Code Monkey logo

go-vhd's Introduction

go-vhd

Go package and CLI to work with VHD images (https://technet.microsoft.com/en-us/virtualization/bb676673.aspx)

Highly Experimental

  • Support for printing VHD headers
  • Create Dynamic (sparse) VHD images
  • Convert a RAW image to a fixed VHD
govhd create foo.vhd 80GiB
govhd info foo.vhd
Cookie:                  0x636f6e6563746978 (conectix)
Features:                0x00000002
File format version:     0x00010000
Data offset:             0x0000000000000200 (512 bytes)
Timestamp:               2015-02-10 14:17:25 +0100 CET
Creator application:     go-v
Creator version:         0x00000000
Creator OS:              Wi2k
Original size:           0x0000001400000000 ( 85899345920 bytes )
Current size:            0x0000001400000000 ( 85899345920 bytes )
Disk geometry:           0xa0a010ff (c: 41120, h: 16, s: 255) (85898035200 bytes)
Disk type:               0x00000003 (Dynamic)
Checksum:                0xffffee82
UUID:                    16a1614a-f6f9-1708-a42a-3bf58ada0942
Saved state:             0

Reading dynamic/differential VHD header...
Cookie:                  0x6378737061727365 (cxsparse)
Data offset:             0xffffffffffffffff
Table offset:            0x0000000000000600
Header version:          0x00010000
Max table entries:       0x0000a000
Block size:              0x00200000
Checksum:                0xfffff3d7
Parent UUID:             00000000-0000-0000-0000-000000000000
Parent timestamp:        2000-01-01 01:00:00 +0100 CET
Reserved:                0x00000000
Parent Name:
Reserved2:               0
$ dd if=/dev/null of=img.raw bs=1 seek=8M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0,000172473 s, 0,0 kB/s

$ go-vhd raw2fixed img.raw

$ go-vhd info img.vhd

VHD footer
==========
Cookie:                  0x636f6e6563746978 (conectix)
Features:                0x00000002
File format version:     0x00010000
Data offset:             0xffffffffffffffff (18446744073709551615 bytes)
Timestamp:               2015-03-17 14:04:14 +0100 CET
Creator application:     go-v
Creator version:         0x00000000
Creator OS:              Wi2k
Original size:           0x0000000000800000 ( 8388608 bytes )
Current size:            0x0000000000800000 ( 8388608 bytes )
Disk geometry:           0x00f00411 (c: 240, h: 4, s: 17) (8355840 bytes)
Disk type:               0x00000002 (Fixed)
Checksum:                0xffffe70b
UUID:                    54d36115-6bd7-5237-615a-b53a3a912557
Saved state:             0

Building

You'll need golang installed. Tested with go >= 1.2.

make

Creating a Debian source package

The following dependencies are required/recommended:

apt-get install build-essential debuild dpkg-dev devscripts

Create the source deb, that will be moved to ~/debian/go-vhd:

make srcdeb

go-vhd's People

Contributors

rubiojr avatar rootfs avatar nikhita avatar

Stargazers

James Chong avatar 不知火 Shiranui avatar Dima Geyets avatar  avatar Brendan Thompson avatar xuxiandi avatar BaiMath avatar ulopong avatar Roman Posudnevskiy avatar Trevor Rudolph avatar Daniel P. Smith avatar Mark avatar Paul Meyer avatar

Watchers

Michael Procter avatar James Cloos avatar  avatar  avatar

go-vhd's Issues

Potential license conflict

I am one of the Kubernetes maintainers and we use this repo in https://github.com/kubernetes/kubernetes.

We received an issue recently (kubernetes/kubernetes#92704) that ran a license scan on our repo and found that a part of the code that go-vhd uses is licensed under CC-BY-SA. As per the CC-BY-SA license:

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

This means that go-vhd would need to be licensed under CC-BY-SA, and by consequence kubernetes would need to be too.

@rubiojr would it be possible for you to update the problematic part of the code to not use code from StackOverflow? We tried removing the dependency to this repo entirely in kubernetes but that isn't an easy solution (kubernetes/kubernetes#92749 (comment)).

The original issue kubernetes/kubernetes#92704 contains more details.

cc @dims @andrewsykim @andyzhangx @lachie83

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.