{"id":237,"date":"2019-06-19T13:41:22","date_gmt":"2019-06-19T11:41:22","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=237"},"modified":"2019-06-19T13:41:22","modified_gmt":"2019-06-19T11:41:22","slug":"make-xen-disk-image-to-raw-disk-image","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=237","title":{"rendered":"Make xen disk image to raw disk image"},"content":{"rendered":"<p>What if you want to migrate a VM that\u2019s been living on Citrix Xenserver to a different linux machine running vanilla Xen? The process isn\u2019t as straightforward as you might think. Fortunately thanks to Eriklax over at github there is a fairly easy way to convert xenserver\u2019s .xva virtual machines to other formats, via\u00a0<a href=\"https:\/\/github.com\/eriklax\/xva-img\">xva-img.<\/a><\/p>\n<p>The first step is to download and install xva-img from github.<\/p>\n<p>wget\u00a0https:\/\/github.com\/eriklax\/xva-img\/archive\/master.zip unzip master.zip cd xva-img-master cmake . sudo make install<\/p>\n<p>When trying to compile this on my Linux Mint Cinnamon machine I ran into the following errors:<\/p>\n<p>CMake Error: your CXX compiler: &#8220;\/usr\/bin\/c++&#8221; was not found. \u00a0 Please set CMAKE_CXX_COMPILER to a valid compiler path or name.<\/p>\n<p>xva-img-master\/src\/sha1.cpp:20:25: fatal error: openssl\/sha.h: No such file or directory #include &lt;openssl\/sha.h&gt;<\/p>\n<p>I had to install the\u00a0build-essential and libssl-dev packages\u00a0in order to successfully compile and install xva-img.<\/p>\n<p>Now that it\u2019s installed, create a directory and extract your .xva file into it.<\/p>\n<p><code>mkdir my-virtual-machine tar -xf &lt;.xva file&gt; -C my-virtual-machine chmod -R 755 my-virtual-machine <\/code><\/p>\n<p>Once that\u2019s finished (it might take a while \u2013 it took over an hour for me) the last step is to convert the extracted directories into a raw disk file.<\/p>\n<p><strong>Note:<\/strong>\u00a0 when you extract your VM tar creates subfolders for each hard disk attached to the VM. You will have to run this command for each Ref folder that was generated as part of the image extraction process.<\/p>\n<p><code>xva-img -p disk-export my-virtual-machine\/Ref\\:1\/ disk.raw <\/code><\/p>\n<p>It took a while for some reason, but it did eventually generate the desired image.<\/p>\n<p>Now that I have a raw disk image I can transfer it to an LVM partition for use with xen:<\/p>\n<p>sudo dd if=win8.1.img of=\/dev\/desktop-xen\/Win8.1 bs=64M<\/p>\n<p>Success.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What if you want to migrate a VM that\u2019s been living on Citrix Xenserver to a different linux machine running vanilla Xen? The process isn\u2019t as straightforward as you might think. Fortunately thanks to Eriklax over at github there is a fairly easy way to convert xenserver\u2019s .xva virtual machines to other formats, via\u00a0xva-img. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-tips"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=237"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}