Welcome to http://www.marssoft.de/
Sunday, 28th February 2021 07:11:20 (GMT+1) 

Installation of Windows from Linux

(1) Installation by just copying over an existing Windows

The easiest way to remotely install Windows is to just copy it to the new computer. Windows XP and 2003 don't mind being copied from NTFS to FAT32 or vice versa, and they don't mind if you change the disk or partition it's on.

Important: Windows does mind when you have chipset (or similar) drivers installed that are not needed for the new comupter. So uninstall all drivers!

Important: Of course you need a license for the second Windows as well, so eighter uninstall your home copy of Windows afterwards, or add a new license key to the remote installation.

Step 1: Prepare Windows

  • Set the Network Options to DHCP so the new computer will get an ip on booting.
  • If you want to install on a remote computer, enable Remote Desktop, and install an VNC Server so you can login later.
  • Test the VNC Server, try to login!
  • Uninstall all hardware drivers.
  • Go to the System Manager, and remove the audio and video cards, as well as most add-on cards like network cards and similar.

Step 2: Prepare the new computer

Create an empty new partition, type 'c' for FAT32 LBA.

fdisk /dev/sda

Format the newly created partition with mkdosfs

mkdosfs -F 32 /dev/sda3

Install a FAT32 boot record on the Windows partition, using the tool 'ms-sys'. These steps are for Windows NT, 2000, XP and 2003 Server:

apt-get install ms-sys
ms-sys --mbr     /dev/sda      # write the MBR
ms-sys --fat32nt /dev/sda3     # write the FAT32 partition boot record
ms-sys -p        /dev/sda3     # write partition info and drive id to partition

You then need to tell Windows the disk and partition it is on, and you're all set.

nano /mnt/win32/boot.ini

Mine is on the first disk, third partition, so boot.ini reads like this:

cat /mnt/win32/boot.ini
[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Windows" /noexecute=optout /fastdetect

Change the bootloader's (grub) menu.lst so you'll be able to reboot into Windows and back. By setting 'default saved', you can later call 'grub-set-default 1' so that the next reboot boots into Windows. The reboot after Windows will boot Linux again, because both Linux and Windows set grub's 'savedefault 0'. There is also a 'fallback 0' in order Windows might not boot at all.

default         saved
fallback        0
timeout         1

title           Linux
root            (hd0,0)
kernel          (hd0,0)/vmlinuz-2.6.15-1-k7 root=/dev/md1 ro
initrd          (hd0,0)/initrd.img-2.6.15-1-k7
savedefault     0

title           Windows
root            (hd0,2)
chainloader     +1
savedefault     0

(Re-)Install grub to boot Linux as well as Windows:

grub-install --recheck --no-floppy /dev/sda

Now whenever you want to boot Windows, do a:

grub-set-default 1
shutdown -r now
guides/windowsremoteinstall.txt · Last modified: 2014/04/02 22:39 (external edit)