libguestfs now works on Mac OS X

$ LIBGUESTFS_PATH=appliance ./fish/guestfish
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help with commands
      'quit' to quit the shell

><fs> add /tmp/test.img
><fs> run
><fs> list-devices
/dev/vda
><fs> list-partitions
/dev/vda1
><fs> vfs-type /dev/vda1
ext3
><fs> mount /dev/vda1 /
><fs> ll /
total 13
drwxr-xr-x  3 root root  1024 Mar 21 21:45 .
dr-xr-xr-x 19 root root     0 Mar 21 17:20 ..
drwx------  2 root root 12288 Mar 21 21:45 lost+found
><fs> touch /hello
><fs> ll /
total 13
drwxr-xr-x  3 root root  1024 Mar 21 22:02 .
dr-xr-xr-x 19 root root     0 Mar 21 17:20 ..
-rw-r--r--  1 root root     0 Mar 21 22:02 hello
drwx------  2 root root 12288 Mar 21 21:45 lost+found
><fs> !uname -a
Darwin koneko.home.annexia.org 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

We used porting plan 3 from here, in this case running a Fedora appliance. A curious side-effect of this is that libguestfs on Mac OS X can read ext3 partitions and LVM, something which OS X itself wouldn’t normally be able to do. On the downside, it’s kind of slow, because qemu is not accelerated on OS X.

Interested people should look at the lengthy series of patches posted on the mailing list.

5 Comments

Filed under Uncategorized

5 responses to “libguestfs now works on Mac OS X

  1. Do you know if there are any plans to fix the source so that the patching isn’t needed? I’m making a formula for Homebrew and I’m wondering if there is even a point of raising an issue with RedHat, since some of the problems I’ve patched have existed since at least 2010.

    • rich

      Patches are welcome — please send them to the mailing list.

    • Have you packaged this for Homebrew? Was looking for this capability on OSX.

      • rich

        Not to my knowledge. There are further upstream patches for Mac OS X last year too, check out the mailing list.

      • Margaret

        I have the homebrew recipe ready, but was waiting for a new stable version, to avoid having to submit a 130kB patch with it (all issues except missing open_memstream have been merged into devel by now). Might give up on waiting and just submit as is. Assuming Homebrew maintainers accept it, that is.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.