• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Convert directly from VHD/VHDX to FOG?

    Scheduled Pinned Locked Moved
    Feature Request
    5
    5
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by

      In our setup, we create images in a HyperV VM (usually using MBR but now sometimes with UEFI since tablets tend now to only support UEFI). FOG is located on that same server (as a Linux VM).

      Is there any way to directly convert the VHD/VHDX file to FOG without having to “upload” it? Or, could a method for it be created?

      We were just thinking that it, if possible, it could decrease the amount of time it takes for our images to be put into FOG. In our case, uploading doesn’t really make sense; we’re only uploading because we don’t know of any other way to get the image into FOG.

      ch3iC Wayne WorkmanW 2 Replies Last reply Reply Quote 0
      • ch3iC
        ch3i Moderator @A Former User
        last edited by

        @loosus456 Hi, FOG use partclone to backup image, I think there is no way to convert VHD(X) to partclone image. You can check on partclone website : http://partclone.org/

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Sebastian Roth

          @loosus456 Haven’t done this yet but there are numerous tools to read/convert/loopmount all kinds of virtual disk formats. There are ‘VBoxManage’, ‘qemu-img’, ‘vdfuse/virtualbox-fuse’ for example. Personally I’d prefer using qemu-nbd as you can mount the VHD/VHDX image as block device and let partclone read an image from there. See this example:

          # load network block device kernel module
          $ modprobe nbd max_part=16
          # connect your image as a nbd device (kind of like loop mount)
          $ qemu-nbd -c /dev/nbd0 -f VHDX <your-vhdx-image-file>
          # let the kernel find your partitions
          $ partprobe /dev/nbd0
          # check which filesystem you have on the partition(s)
          $ blkid -po udev /dev/nbd0p1 | grep FS_TYPE
          ID_FS_TYPE=ntfs
          # read from first partition and write (compressed) partclone image
          $ partclone.ntfs -c -s /dev/nbd0p1 -o - | gzip -c -4 > /images/FOO/d1p1.img
          # same for the remaining partitions
          $ blkid -po udev /dev/nbd0p2 | grep FS_TYPE
          $ partclone.ntfs -c -s /dev/nbd0p2 ...
          ...
          

          As well you need to create a backup of the MBR (d1.mbr), the partition layout files (d1.partitions) and other info files depending on what your have on your VHD(X)! So this ist just the start. Give it a try and see how far you get. Examine the files you have in other image directories. If you need further assistance just let us know.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator
            last edited by

            I guess I would have to ask the question to which way is faster?

            1. Just boot the vhd image into pxe boot and capture the image. Deploy and test the image.

            2. Copy the vhd image to the fog server. Mount it with qemu, convert the image to partclone format, test deploy the image.

            My guess is the copy, mount, convert steps will be much slower than the boot, capture. And there is no guaranty that the conversion will work correctly.

            With that said, it would be interesting to know if it actually worked. Especially if you had a fast linux box running with SSD drives the performance may not be too bad, but you still will be limited by the speed of the GbE network adapter for transfer rates when you use the conversion process.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            1 Reply Last reply Reply Quote 0
            • Wayne WorkmanW
              Wayne Workman @A Former User
              last edited by

              @loosus456 While it may be possible, I wouldn’t recommend it.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
              Daily Clean Installation Results:
              https://fogtesting.fogproject.us/
              FOG Reporting:
              https://fog-external-reporting-results.fogproject.us/

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              182

              Online

              12.0k

              Users

              17.3k

              Topics

              155.2k

              Posts
              Copyright © 2012-2024 FOG Project