{"id":180,"date":"2012-01-09T19:20:38","date_gmt":"2012-01-09T18:20:38","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?page_id=180"},"modified":"2014-03-14T01:02:05","modified_gmt":"2014-03-14T00:02:05","slug":"how-to-create-an-image-of-a-running-windows-2003-xp-and-up-and-boot-it-on-san-using-an-iscsi-target-and-gpxe","status":"publish","type":"page","link":"https:\/\/labalec.fr\/erwan\/?page_id=180","title":{"rendered":"How to create an image of a running windows (xp, 2003 and up) and boot it on SAN using an ISCSI target and gPXE"},"content":{"rendered":"<p>Steps:<br \/>\n1.Setup pxe server with gpxe<br \/>\n2.Setup iscsi target<br \/>\n3.Install new OS, or transfer existing OS, to a volume that will be shared over iscsi.<br \/>\n4.Install iscsi boot support<br \/>\n5.Boot over iscsi !<br \/>\n6.Summary :<\/p>\n<p>Lets start!<\/p>\n<p><strong>1.Setup bootstrap loader with gpxe<\/strong><br \/>\nusing gpxe boot strap loader (for sanboot option) <\/p>\n<p>Here below I use <a href=\"https:\/\/erwan.labalec.fr\/pxesrv.zip\" target=\"_blank\">Tiny Pxe Server<\/a>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/pxe_setup2.png\" alt=\"\" name=\"Image1\" width=\"470\" height=\"817\" align=\"LEFT\" border=\"0\" \/><\/p>\n<p><br clear=\"LEFT\" \/><\/p>\n<p>The root path : iscsi:192.168.1.100:tcp:3260:0:test<br \/>\ndhcp extra option : 175.6.1.1.1.8.1.1<br \/>\nwe set keep-san=1 (in case we want to install directly to san) and dhcp priority=1 to over rule any dhcp server on your lan.<\/p>\n<p>recommended: do not fill the router field due to a bug within ms iscsi initiator and the gateway (see <a href=\"http:\/\/reboot.pro\/15965\/\" target=\"_blank\">here<\/a>)<\/p>\n<p>Note : as an option, you can skip the dhcp\/tftp server by using a boot disk (floppy or cdrom) made by gpxe.<\/p>\n<p>Go there <a href=\"http:\/\/rom-o-matic.net\/gpxe\/gpxe-git\/gpxe.git\/contrib\/rom-o-matic\/\" title=\"rom-o-matic.net\" target=\"_blank\">Rom-o-matic.net<\/a>,<br \/>\n-choose floppy image as output format (or cdrom),<br \/>\n-choose \u00ab\u00a0all-drivers\u00a0\u00bb as NIC Type,<br \/>\n-tick time_cmd and digest_cmd,<br \/>\n-and use the following embedded script :<\/p>\n<p>#!gpxe<br \/>\necho \u00ab\u00a0Greetings! Hit Ctrl-C to bail out.\u00a0\u00bb<br \/>\nsleep 5<br \/>\necho \u00ab\u00a0Going to DHCP on primary network adapter\u00a0\u00bb<br \/>\nifopen net0<br \/>\ndhcp net0<br \/>\nclear net0.dhcp\/gateway:ipv4<br \/>\nsanboot iscsi:192.168.1.100::::xp<\/p>\n<p>Use the generated boot disk on your physical computer or in your virtual image.<\/p>\n<p><strong>2.Setup iscsi target <\/strong><\/p>\n<p>&#8211;<a href=\"http:\/\/www.iscsicake.com\/\" target=\"_blank\">iscsi cake<\/a> can mount any thing like vhd, vmdk, disk, etc.<br \/>\n&#8211;<a href=\"http:\/\/www.rocketdivision.com\/wind.html\" target=\"_blank\">rocket division startwind<\/a> can mount image files,disks, etc.<br \/>\n&#8211;<a href=\"http:\/\/www.openfiler.com\/\" target=\"_blank\">openfiler<\/a> \/ <a href=\"http:\/\/www.freenas.org\/\" target=\"_blank\">freenas<\/a> can also act as iscsi target but can \u00ab\u00a0only\u00a0\u00bb create disks, not mount them.<\/p>\n<p>The iscsi target can be used either during the installation or for the transfer of an existing windows installation to an iscsi volume.<\/p>\n<p>Here below a screenshot of one xp disk mounted in Starwind (free for one connection).<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/starwind.jpg\" alt=\"\" name=\"Image2\" width=\"803\" height=\"291\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p><strong>3.Install new OS, or transfer existing OS, to an image that will be shared over iscsi.<\/strong><\/p>\n<p>Installation choices : <\/p>\n<p>-(1) install directly to an iscsi target (vista, windows 2008 or windows 7). <a href=\"https:\/\/labalec.fr\/erwan\/?page_id=113\" target=\"_blank\">see howto<\/a><\/p>\n<p>-(2) have a vmdk point to a blank img file (monolithic vmdk option) and install thru vmware. See below how to.<\/p>\n<p>Here below vmware settings to install xp on a physical device (choice 2 above).<br \/>\nNote that \\\\.\\physicaldrive1 is actually a vmdk pointing to my disk image file (which we will use later in starwind).<br \/>\nSee lower in that page on how to make that vmdk.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/vmware.gif\" alt=\"\" name=\"Image3\" width=\"621\" height=\"471\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p>-(3) install to a local physical disk and clone it to an img file afterwards. See below how to.<\/p>\n<p>If you have an existing windows, transfer it to an image file using a one to one disk cloning software.<br \/>\nGet clonedisk here : <a href=\"https:\/\/erwan.labalec.fr\/clonedisk\" target=\"_blank\">https:\/\/erwan.labalec.fr\/clonedisk<\/a><br \/>\nBackup the physical drive, not the logical drive \/ partition.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/\/clonedisk.png\" alt=\"\" name=\"Image4\" width=\"469\" height=\"260\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p>Note1 : CloneDisk can create a vmdk file for you, pointing to the image file of your disk.<br \/>\nYou may even be able to boot on your image file from within vmware server.<br \/>\nIf so, dont forget to install the scsi vmware driver before cloning and to restart in safe mode on the target vm guest.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/clonedisk2.png\" alt=\"\" name=\"Image4\" width=\"469\" height=\"260\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p>Note2 : QEMU can also use the raw image file.<br \/>\nThen apply this http:\/\/support.microsoft.com\/kb\/314082 before launching in QEMU to avoid a 0x7b BSOD.<\/p>\n<p><strong>4.Install iscsi boot support in your operating system (before cloning\/transfer)<\/strong><\/p>\n<p>For xp : <a href=\"http:\/\/etherboot.org\/wiki\/sanboot\/winnt_iscsi\" target=\"_blank\">http:\/\/etherboot.org\/wiki\/sanboot\/winnt_iscsi<\/a><br \/>\nNote : once the iscsi initiator installed on XP, dont forget to run the SAN Boot Configurator (<a href=\"http:\/\/www.etherboot.org\/wiki\/sanboot\/winnt_iscsi_sanbootconf\">http:\/\/www.etherboot.org\/wiki\/sanboot\/winnt_iscsi_sanbootconf<\/a>)<\/p>\n<p>for w2k3: <a href=\"http:\/\/etherboot.org\/wiki\/sanboot\/win2k3\" target=\"_blank\">http:\/\/etherboot.org\/wiki\/sanboot\/win2k3<\/a><\/p>\n<p>Not needed for W2k8, Vista and Windows7 as they support natively iscsi boot.<br \/>\nNote : you have to set the msiscsi service to start=auto (and possibly to add the target to the iscsi initiator?).<br \/>\n(sc config MSiSCSI start= auto)<\/p>\n<p><strong>5.Boot over iscsi !<\/strong><\/p>\n<p>If not done yet, setup your iscsi target (see step 2) with a prepared image file.<\/p>\n<p>Unless you have an hba with iscsi support or network card with gpxe built in, setup your pxe server (step 1).<\/p>\n<p>Lets test it in vmware.<\/p>\n<p>See below the vm settings (diskless!)<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/vmware_diskless.gif\" alt=\"\" name=\"Image5\" width=\"623\" height=\"473\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p>see below the disk seen from Windows , once booted over iscsi.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/images\/xp_iscsi.gif\" alt=\"\" name=\"Image6\" width=\"803\" height=\"602\" align=\"LEFT\" border=\"0\" \/><br \/>\n<br clear=\"LEFT\" \/><\/p>\n<p>Constraint : network card needs to be the same before\/after in order to boot.<br \/>\nYou can add another network card before migrating to another computer, see here <a href=\"http:\/\/etherboot.org\/wiki\/appnotes\/port_winnt_sanboot\" target=\"_blank\">http:\/\/etherboot.org\/wiki\/appnotes\/port_winnt_sanboot<\/a> .<\/p>\n<p><strong>6.Summary :<\/strong><\/p>\n<p>-we have setup a pxe server (dhcp &amp; tftp &amp; gPXE)<br \/>\n-we have setup a scsi target<br \/>\n-we have installed windows to a flat file and served that file thru the iscsi target (in a vmware guest)<br \/>\n-we have setup iscsi boot support in our windows<br \/>\n-we have started a diskless computer (in a vmware guest)<br \/>\n-we have booted on san using the iscsi protocol thanks to gPXE<\/p>\n<p>possible improvements:<\/p>\n<p>-flash your network card with gPXE, turning it into a boot on san device.<br \/>\nsee <a href=\"http:\/\/www.etherboot.org\/wiki\/romburning\" target=\"_blank\">http:\/\/www.etherboot.org\/wiki\/romburning<\/a><br \/>\nIn that case you dont need a pxe server anymore, config (target and rootpath) is saved directly in the network card.<\/p>\n<p>-flash your motherboard network rom with gPXE.<br \/>\nsee <a href=\"http:\/\/www.etherboot.org\/wiki\/biosext\" target=\"_blank\">http:\/\/www.etherboot.org\/wiki\/biosext<\/a><br \/>\nSame idea as above.<\/p>\n<p>-Use a gpxe nic rom in vmware to skip the dhcp\/tftp part (nbios.filename vmx parameter).<br \/>\nSame idea as above but virtual&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Steps: 1.Setup pxe server with gpxe 2.Setup iscsi target 3.Install new OS, or transfer existing OS, to a volume that will be shared over iscsi. 4.Install iscsi boot support 5.Boot over iscsi ! 6.Summary : Lets start! 1.Setup bootstrap loader with gpxe using gpxe boot strap loader (for sanboot option) Here below I use Tiny <a href='https:\/\/labalec.fr\/erwan\/?page_id=180' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"categories":[16,10,45,28],"tags":[],"class_list":["post-180","page","type-page","status-publish","hentry","category-boot","category-iscsi","category-pxe","category-tinypxe-server","category-16-id","category-10-id","category-45-id","category-28-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=180"}],"version-history":[{"count":29,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/180\/revisions"}],"predecessor-version":[{"id":962,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/pages\/180\/revisions\/962"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}