lsweb.euhttps://blog.lsweb.eu/blog/2024-03-28T16:02:30+00:00Weblog by Lars SteinkeHow to dual-boot Windows physically and virtually2010-11-30T09:22:55+00:002024-03-28T16:02:30+00:00Lars Steinkehttps://blog.lsweb.eu/blog/author/lss/https://blog.lsweb.eu/blog/how-to-dual-boot-windows-physically-and-virtually/<p>While this is no longer possible with Windows Activation Technologies in Win 7, Windows XP allows using Hardware Profiles for a shared installation that can be run either physically or virtually (e.g. using the KVM virtualization stack built into recent Linux kernels, which is a lot more convenient than VMWare Player with its kernel module dependencies, at the price of 3D graphics acceleration).<br/> <br/> The recommended sequence for such a setup:</p>
<ol>
<li>Install Windows XP physically (where applicable, using the IDE mode of your SATA host controller)</li>
<li>Create a second Hardware Profile for virtualization, reboot using that new Hardware Profile and let hardware detection run its course</li>
<li>Swap the hard disk controller drivers to VirtIO (for KVM) and AHCI (if you have a SATA host controller, that is)<br/><b>The Details:</b><br/><br/>
<ol>
<ol>
<li>Installing Windows using the standard IDE driver allows for being able to boot the same installation in KVM as well.</li>
<li>The separate Hardware Profile ensures that Windows doesn't go through lengthy hardware detection after each switch from physical to virtual boot-up and back.</li>
<li>The somewhat tricky bit is swapping to the right hard disk controller drivers afterwards, for decent I/O performance. For KVM VirtIO that is relatively easy - simply add a small VirtIO device to the configuration and let hardware detection install the drivers from the KVM driver vfd floppy image at <a href="http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/">Fedora</a>.<br/> You may then use <code>virsh edit</code> to change the original disk configuration from <code><target dev='hda' bus='ide'/></code> to <code><target dev='vda' bus='virtio'/></code> (and drop the dummy device).<br/>
<p><br/> Switching the physical Windows setup from IDE to AHCI cannot be achieved in that easy way, if you have an AMD SB800 south bridge that has different PCI device IDs for IDE (4390) and AHCI (4391) mode (consequently thwarting parallel installation). There, some registry <a href="http://www.wikihow.com/Install-Ahci-Support-for-Ati-Sb600-Sata-Controllers-on-Existing-Windows-Installations">tweaking</a> is required after you have copied <code>ahcix86.sys</code> from the unpacked AMD driver package to <code>system32/drivers</code>:<br/> <code><br/> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_1002&dev_4391]<br/> "Service"="ahcix86"<br/> "ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}"<br/> <br/> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ahcix86]<br/> "Type"=dword:00000001<br/> "Start"=dword:00000000<br/> "ErrorControl"=dword:00000001<br/> "Tag"=dword:00000021<br/> "ImagePath"="system32\\drivers\\ahcix86.sys"<br/> "Group"="SCSI Miniport"<br/> "DisplayName"="ATI AHCI Compatible RAID Controller"<br/> <br/> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ahcix86\Parameters\PnpInterface]<br/> "5"=dword:00000001<br/> </code><br/> With the AHCI driver thus enabled, you may reboot and switch the BIOS SATA setting from IDE to AHCI without facing the typical "Unknown boot device" BSOD in result.</p>
</li>
</ol>
</ol>
</li>
</ol>How to boot a real harddisk in VMWare2007-01-08T19:53:00+00:002024-03-28T09:44:04+00:00Lars Steinkehttps://blog.lsweb.eu/blog/author/lss/https://blog.lsweb.eu/blog/how-to-boot-a-real-harddisk-in-vmware/<p>The knack is to install the VMWare SCSI driver (included with VMWare Tools) <u>before</u> booting the SATA or PATA harddisk.</p>
<p>Then configure it in the VMX config file as follows:<br/> <code><br/> scsi0:0.present = "TRUE"<br/> scsi0:0.fileName = "win_raw.vmdk"<br/> scsi0:0.deviceType = "rawDisk"<br/> scsi0.present = "TRUE"<br/> scsi0.virtualDev = "buslogic"<br/> </code>Here's the contents of <code>win_raw.vmdk</code> for my harddrive:<br/> <code><br/> # Disk DescriptorFile<br/> version=1<br/> CID=adf9ef51<br/> parentCID=ffffffff<br/> createType="fullDevice"<br/> <br/> # Extent description<br/> RW 625142448 FLAT "/dev/sda" 0<br/> <br/> # The Disk Data Base<br/> #DDB<br/> ddb.virtualHWVersion = "3"<br/> ddb.geometry.cylinders = "38913"<br/> ddb.geometry.heads = "255"<br/> ddb.geometry.sectors = "63"<br/> ddb.geometry.biosCylinders = "38913"<br/> ddb.geometry.biosHeads = "255"<br/> ddb.geometry.biosSectors = "63"<br/> ddb.adapterType = "buslogic"<br/> ddb.toolsVersion = "6404"<br/> </code><br/> And how to get those parameters? Exents und geometry can for instance be deduced from <code>hdparm /dev/sda</code>:<br/> <code><br/> /dev/sda:<br/> IO_support = 0 (default 16-bit)<br/> readonly = 0 (off)<br/> readahead = 256 (on)<br/> geometry = 38913/255/63, sectors = 625142448, start = 0<br/> </code></p>