Giter Site home page Giter Site logo

libguestfs-container's Introduction

libguestfs-container

This is a Docker container for libguestfs. It allows for interactive interaction with remote virtual machine disk images. It is particularly useful for interacting with Microsoft Azure vhd images.

$ docker run -it gabrielhartmann/libguestfs
$ ./run virt-rescue --ro -a "<vhd URI>"
…
------------------------------------------------------------

Welcome to virt-rescue, the libguestfs rescue shell.

Note: The contents of / are the rescue appliance.
You have to mount the guest's partitions under /sysroot
before you can examine them.

groups: cannot find name for group ID 0
><rescue> mount /dev/sda1 /sysroot
><rescue> chroot /sysroot
><rescue> ls
bin   etc         initrd.img.old  lost+found  opt   run   sys  var
...

1. Install Docker##

2. Generate an Image URI

Generate a SAS key. For example:

$ AZURE_STORAGE_ACCOUNT=<storage_account_name> AZURE_STORAGE_ACCESS_KEY=<storage_key> azure storage blob sas create <container_name> <blob_name> r 2016-01-01
info:    Executing command storage blob sas create
Creating shared access signature for blob osdiskforconsul0-osdisk.vhd in container vhds
data:    Shared Access Signature
se=2016-01-01T00%3A00%3A00Z&sp=r&sv=2014-02-14&sr=b&sig=LOlrHXrQeaqlSEP51hRi7E5KDa9lnkqSvLTaZBmTkrQ%3D
info:    storage blob sas create command OK

The "r" term means read-only, other access levels are allowed. The final date is the expiration time of the SAS key.

Concatenate the resulting key to the blob URI. The final result should look like:

https://azurestoragename.blob.core.windows.net/vhds/osdiskforconsul0-osdisk.vhd?se=2016-01-01T00%3A00%3A00Z&sp=r&sv=2014-02-14&sr=b&sig=RaNdOmLeTtErSSEP51hRi7E5KDa9lnkqSvLTaZBmTkrQ%3D

3. Browse the VHD

$ docker run -it gabrielhartmann/libguestfs
$ ./run virt-rescue --ro -a "<vhd URI>"
><rescue> mount /dev/sda1 /sysroot
><rescue> chroot /sysroot

This container includes fixes for handling http and https URIs which contain query strings. The current implementation of libguestfs has two defects around URI handling.

  1. https://bugzilla.redhat.com/show_bug.cgi?id=1092583
  2. https://bugzilla.redhat.com/show_bug.cgi

The fixes made here are incompatible with protocols other than http and https. Permanent, fully compatible fixes are pending.

libguestfs-container's People

Contributors

gabrielhartmann avatar

Watchers

 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.