Creating a bootable windows USB from Linux

Creating a bootable windows USB from Linux

Preface
In these time, CD/DVD drives are becoming non-necessary part of a PC.
Net-Book like PC's usually will not have any CD/DVD drive.

New Operating systems like Windows 7/8 also targeting these systems.
So there are official way to install a fresh copy of OS from USB drive.

Situation
I am Linux user and currently there is no Windows* PC s available to me .
I just want to experience the Windows 8
I have a Windows 8 Image/files
I have a running Ubuntu PC
I have an 8 GB USB disk
I want to install Windows in a old PC which doesn't have support for UEFI boot.

Solution
  • Prepare the USB drive
    • Enable the boot flag on the target partition of the USB. It can be easily done with the use of the tool called "GParted". It is a GUI tool for drive partitioning .
  • Copy the files from installation files to USB
    • If the installation image is a ISO file, Mount it and access the files.
    • Copy the all files to root of USB drive
  • Make the USB Bootable 
    • Install GRUB to USB Drive.  
    • # grub-install --target=i386-pc --boot-directory="/media/user/boot" /dev/sdX
  • Configure GRUB to boot Widows .
    • Place the following file as "/boot/grub/grub.cfg" in the USB dirve
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    menuentry 'Install Windows 8' {
    ntldr /bootmgr
    }

              Comments

              1. I wasn't able to successfully install grub without adding "--force" to the grub-install options. For whatever reason, the drive I used (an 8GB flash drive) required the use of "blocklists" in order to install grub. The "--force" option makes using blocklists in the installation possible.

                Other than that, your directions worked great. Thanks!

                ReplyDelete
              2. I have Windows XP ISO.
                I have 4Gb USB Flash drive.
                I do everything like you said.
                And I got error: file '/bootmgr' not found.
                Changing ISO images or USB devices not helps.
                What I'm doing wrong?

                ReplyDelete
                Replies
                1. Hi Олег Горлатенко,

                  For this method to work, The operating system should support boot from usb by design.

                  Since Windows-8 etc directly targeting Netbook like devices, Windows-8 has this support. ( See preface section )

                  And I am not sure about the case of Windows-XP.

                  And there is a major change in boot-mechanism after Windows-XP and before XP. So this method will not work without some modifications

                  Delete
                2. Hi Олег Горлатенко,

                  For this method to work, The operating system should support boot from usb by design.

                  Since Windows-8 etc directly targeting Netbook like devices, Windows-8 has this support. ( See preface section )

                  And I am not sure about the case of Windows-XP.

                  And there is a major change in boot-mechanism after Windows-XP and before XP. So this method will not work without some modifications

                  Delete
              3. "Installing for i386-pc platform."

                That's all I see when I enter the grub-install command. The command has not returned yet, it's been like that for an hour now? Any ideas?

                ReplyDelete
              4. I'm such an idiot, I type "/media/user"...

                ReplyDelete

              Post a Comment

              Popular posts from this blog

              Calibrating PIC microcontroller internal oscillator