User Tools

Site Tools


virtualization:microsoft:hyper-v-usb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
virtualization:microsoft:hyper-v-usb [2012/09/15 12:47]
gcooper
virtualization:microsoft:hyper-v-usb [2019/05/20 11:32] (current)
gcooper
Line 1: Line 1:
 ====== Run Microsoft Hyper-V Server From USB ====== ====== Run Microsoft Hyper-V Server From USB ======
  
-FIXME Gave up trying to get Hyper-V Server 2012 to work...+See also **[[https://virtualarchitects.com/wiki/doku.php?do=search&id=start&q=hyper-v|more Hyper-V pages]]**
  
-http://blogs.technet.com/b/klince/archive/2010/09/13/booting-hyper-v-r2-from-a-bootable-usb.aspx+FIXME I'm not really sure how well this works because it was so slow to boot up that I decided I'd rather use a 32GB SSD and Velcro...
  
-http://www.itstuff.ca/2009/12/create-bootable-usb-drive-for-hyper-v.html+http://technet.microsoft.com/en-us/library/ee731893%28WS.10%29.aspx
  
   * Boot Hyper-V Server from USB flash devices   * Boot Hyper-V Server from USB flash devices
   * Saves hot-swap drive bay for storage   * Saves hot-swap drive bay for storage
   * 16GB Flash device recommended   * 16GB Flash device recommended
 +    * The following example sizes the VHD file for a 16GB flash drive
     * Get the fastest one you can     * Get the fastest one you can
-    * This device **will** be wiped and any data lost+    * This device **will** be wiped and any data on it lost
  
 ==== On a Windows 7 Technician Workstation ==== ==== On a Windows 7 Technician Workstation ====
Line 17: Line 18:
 :!: During this procedure, carefully keep track of the disk numbers, partition numbers and drive letters.  A mistake can ruin your whole disk! :!: During this procedure, carefully keep track of the disk numbers, partition numbers and drive letters.  A mistake can ruin your whole disk!
  
-<note>G: = Hyper-V Server Install DVD +<note> 
-C: = Drive on which we create and prepare the VHD file +G: = Mounted Hyper-V Server install DVD 
-X: = Mounted VHD file+R: = Mounted VHD file
 Z: = Mounted USB flash drive Z: = Mounted USB flash drive
-1 = Disk number of VHD +1 = Disk number of 16GB USB flash drive 
-2 = Disk number of 16GB USB flash drive +2 = Disk number of VHD
 1 = Partition number on VHD 1 = Partition number on VHD
-1 = Index number of the image within install.wim (there is only one image within the Hyper-V Server install.wim)</note>+1 = Index number of the image within install.wim (there is only one image within the Hyper-V Server install.wim) 
 +</note>
  
 1) Download and install WAIK: http://www.microsoft.com/en-us/download/details.aspx?id=5753 1) Download and install WAIK: http://www.microsoft.com/en-us/download/details.aspx?id=5753
Line 30: Line 32:
 2) Download the Hyper-V Server .iso file 2) Download the Hyper-V Server .iso file
  
-3) Mount the Hyper-V Server .iso file (G: used here for mounted .iso file)+3) Mount the Hyper-V Server .iso file
  
   * [[http://www.slysoft.com/en/virtual-clonedrive.html|Free tool]] to mount .iso files   * [[http://www.slysoft.com/en/virtual-clonedrive.html|Free tool]] to mount .iso files
  
-4) Create, mount and prepare the VHD (virtual hard disk) that will become your bootable USB flash drive.  Open a command prompt as administrator:+4) Insert the 16GB USB flash drive 
 + 
 +5) Create, mount and prepare the VHD (virtual hard disk) 
 + 
 +:!: Windows will prompt you to format the VHD; just click 'Cancel' 
 + 
 +Open a command prompt as administrator:
  
 <file> <file>
 +mkdir c:\hvvhd
 diskpart diskpart
- +create vdisk file=c:\hvvhd\hyperV.vhd maximum=12288 type=fixed 
-create vdisk file=c:\virtualharddisk.vhd maximum=6000 type=fixed +select vdisk file=c:\hvvhd\hyperV.vhd
-select vdisk file=c:\virtualharddisk.vhd+
 attach vdisk attach vdisk
-list disk 
-select disk 1 (select the newly created VHD) 
 create partition primary create partition primary
-select partition 1 +assign letter=r 
-active +format quick fs=ntfs label=hyperV
-format fs=ntfs quick +
-assign letter=+
-list volume+
 </file> </file>
  
-5) Apply the install image to the VHD. Leave the "diskpart" window open and open another command prompt as administrator.+6) Apply the install image to the VHD. 
  
-  * Change into the appropriate directory (''x86'' or ''amd64'') based on the architecture of your technician workstation+Leave the "diskpart" window open and open another command prompt as administrator. 
 + 
 +:!: Change into the appropriate directory (''x86'' or ''amd64'') based on the architecture of your technician workstation
  
 <file> <file>
 cd "C:\Program Files\Windows AIK\Tools\<arch>\" cd "C:\Program Files\Windows AIK\Tools\<arch>\"
-imagex.exe /apply g:\sources\install.wim /check 1 x:\+imagex.exe /apply g:\sources\install.wim /check 1 r:\
 </file> </file>
  
-6) After that finishes, switch back to the "diskpart" command window (where ''diskpart'' is still running) to prep the USB flash drive:+7) After imagex finishes, switch back to the "diskpart" command window (where ''diskpart'' is still running) to prep the USB flash drive
  
 <file> <file>
-list disk (to determine the disk number of the USB flash drive - '2' used here) +detach vdisk 
-select disk 2+</file> 
 + 
 +Determine the disk number of the USB flash drive and prepare it: 
 + 
 +<file> 
 +list disk 
 + 
 +select disk 1
 clean clean
 create partition primary create partition primary
Line 74: Line 86:
 </file> </file>
  
-7) Switch back to the "imagex" window and copy 'boot' files from the VHD to the USB target disk:+8) Switch back to the "imagex" window and copy the VHD to the USB target disk: 
 + 
 +copy c:\hvvhd\hyperV.vhd z: 
 + 
 +9) Prep the boot sector of the USB flash drive: 
 + 
 +<file> 
 +cd /d "c:\program files\Windows AIK\tools\PETools\<arch>"  
 +bootsect /nt60 z: /force /mbr 
 +</file> 
 + 
 +10) Switch back to the "diskpart" window, mount the VHD file on the USB flash drive: 
 + 
 +<file> 
 +select vdisk file=z:\HyperV.vhd  
 +attach vdisk 
 +</file> 
 + 
 +11) Back in the "imagex" window, make the USB flash drive bootable: 
 + 
 +<file> 
 +bcdboot r:\windows /s z: /v 
 +</file> 
 + 
 +12) Disable paging.
  
 <file> <file>
-bcdboot x:\Windows /s z: /v+reg load HKLM\HyperVTemp r:\windows\system32\config\system 
 +reg add "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "" /f 
 +reg delete "HKLM\HyperVTemp\ControlSet001\Control\Session Manager\Memory Management" /v ExistingPageFiles /f 
 +reg unload HKLM\HyperVTemp
 </file> </file>
  
-8) Switch back to the "diskpart" window and dismount the VHD file:+13) Switch back to the "diskpart" windowdismount the VHD file and exit ''diskpart'':
  
 <file> <file>
Line 87: Line 126:
 </file> </file>
  
-9) Safely Remove the USB flash drive from the technician workstation and test.+14) Safely Remove the USB flash drive from the technician workstation and test.
virtualization/microsoft/hyper-v-usb.1347734824.txt.gz · Last modified: 2012/09/15 12:47 by gcooper