How to install Windows 7 from Ubuntu without burnning a disc

This post was written by admin on February 7, 2010
Posted Under: General

If you’re running on ubuntu and want to install Windows 7 without burning a disc,you can try following steps to install Windows 7 with the iso file.

Step1:Download grub4dos from:http://download.gna.org/grub4dos/grub4dos-0.4.4-2009-06-20.zip Decompress the grub.exe and put this file into root directory of Ubuntu partition (“/”).

Step2:Create a 4GB ntfs partition and paste all files from Windows7 iso into this partition.(use this GUI tool:sudo apt-get install gparted ntfsprogs.launch from system->administrator menu).
use this command to mount the Win7 iso(change “/path/to/your/iso”):

sudo mount /path/to/your/iso /mnt -o loop

then cope all files in /mnt and paste them into root directory of previous created ntfs partition.

Step3:
For Ubuntu 9.10 (use grub2):
run:

sudo gedit /etc/grub.d/40_custom

paste following into the end:

menuentry "Grub for Dos" {
insmod ntfs
set root=(hdx,y)
linux /grub.exe
}

Note:here “set root=(hdx,y)” need change,my ubuntu was installed in /dev/sda11,so it should be “set root=(hd0,11)”
then,run:

sudo update-grub

For ubuntu 9.04 and old versions(use old grub boot loader):
run:

sudo gedit /boot/grub/menu.lst

add following:

title grub4dos
root (hdx,y)
kernel /grub.exe
boot

Note:“root (hdx,y)” is different to previous one,my ubuntu partition:/dev/sda11,and here it should be “root (hd0,10)” (without quotes).

Step4:Reboot and there is a new entry in grub:”Grub for Dos”or”grub4dos”.Select it and press c to access to grub>,then:

grub>find --set-root /bootmgr
grub>chainloader /bootmgr
grub>boot

Now,we get into Win7 installation guide interface.Press Shift+F10 to cmd command line,and run following in X:/sources loation to start:

setup.exe

Related posts:

  1. How to restore Grub 2 after reinstalling Windows XP/Vista/Win7
  2. Install Ubuntu without burning LiveCD from Windows 7 dual-boot(not wubi)
  3. How to install ubuntu9.04 dual boot with Windows XP
  4. Install Ubuntu 9.10(Karmic) from Windows XP dual-boot system
  5. Add Windows into grub menu after install Ubuntu

    Reader Comments

    I love you guys!
    So talented and smart!
    Your knowledge is very appreciated.

    [Reply]

    #1 
    Written By Nicole on March 20th, 2010 @ 11:05 am

    I’m from Indonesia,
    thanks bro . . .
    how about install windows xp from ubuntu??
    thanks for tutor . . .

    [Reply]

    #2 
    Written By zhen on July 12th, 2010 @ 6:33 pm

    Very useful tuto, thanks!

    Should we use this how to on installing Windows XP ?

    Regards,
    Budiarno

    [Reply]

    #3 
    Written By Budiarno on October 28th, 2010 @ 6:41 pm

    I am really grateful to you …..
    Thanks man
    Great tut…..
    Also,I did not required step 4

    [Reply]

    #4 
    Written By Naveen on October 30th, 2010 @ 10:50 am

    Amazing piece of code. Well it is,I am a dentist and so I dont understand any of it. It worked, hence it is great. Thanks a lot!

    [Reply]

    #5 
    Written By Mandros on December 25th, 2010 @ 3:45 pm

    I am stuck in the last part…
    When I use this line

    grub>find –set-root /bootmgr

    it says find command can’t be found. What should I do?

    [Reply]

    Buckwheat Reply:

    I am stuck at this stage too! Help us!

    [Reply]

    Shaun Reply:

    HELP!! same problem!

    [Reply]

    landon Reply:

    it’s find –set-root /bootmgr there are two dashes befor set not one.

    [Reply]

    #6 
    Written By Rafal on December 30th, 2010 @ 5:30 pm

    Me too… !!! I thought this would be sweet. I spent more time on this than 100 DVD’s would buy me. Ha ha.

    And no follow up?

    [Reply]

    #7 
    Written By PissAnt on January 10th, 2011 @ 7:40 am

    Well maybe it’s this line with your root directory that is weird? I did this:

    root (hdx,y) = hd1,3

    as my root is on /dev/sdb3.

    is this correct? it was not easy to figure out the logic, as a noob.

    [Reply]

    #8 
    Written By Pissant on January 10th, 2011 @ 7:48 am

    If find –set-root /bootmgr is not working your you then try this:

    grub> search.file /bootmgr
    You will get an output similar to hd0,msdos1. You need to enter the output in the next step.

    grub>set root=hd0,msdos1
    grub>chainloader +1
    grub>boot

    [Reply]

    Philippe Reply:

    find is not working for me and when i try search.file /bootmgr i get the following error: no such device: /bootmgr. can you help me?

    [Reply]

    Nick Reply:

    Thanks to the tutorial writer and the above comment. Worked with Ubuntu 11.

    [Reply]

    #9 
    Written By LinuxFreak on March 21st, 2011 @ 6:06 pm

    Hi

    I tried the above steps and am unable to boot thru.

    I have 2 ubuntu installations on my m/c- a desktop version one /dev/sda1 and server version on /dev/sda6.

    I created a NTFS partition as instructed (its on /dev/sda3.

    I went thru the steps to add the menu item as well.

    All of if works except – search.file /botmgr command does not return anything.

    a couple of Q’s :
    1. does grub.exe need to have execute permission on it ?

    2. what is the /bootmgr file – i guess my copy of files to NTFS partition is not good !! since I could not find it in the NTFS partition.

    Any help will be appreciated.

    Thanks in advance.

    [Reply]

    #10 
    Written By trivedis on April 5th, 2011 @ 2:42 am

    I must say this is the most accurate and usefil article i have found.

    [Reply]

    #11 
    Written By Namish Saxena on April 16th, 2011 @ 5:10 pm

    Use this method, everything seemed to work okay, install begun, system rebooted -> last steps…after the second reboot I again get the “install screen” again….

    tried it anonther time, same result…

    after the install finished ; i go back to the first install screen…

    any solutions for this problem ?

    ???

    [Reply]

    Adam Schacher Reply:

    I had a similar problem. After the Windows installer came up a second time, I pulled up the partition menu. From there, I deleted the partition that contained the installer. There might be another method that’s less caveman-like, but this worked for me.
    Awesome write-up!!! Thank you ubuntuguide.net!!!

    [Reply]

    #12 
    Written By tjeerdoo on June 3rd, 2011 @ 10:03 am

    These instructions worked brilliantly! I thought all hope was lost, but this method pulled through for me. As a bonus, I learned a little bit of how some of the Linux commands work. Thank you very much!

    [Reply]

    #13 
    Written By Charles on June 25th, 2011 @ 10:53 pm

    try
    search –set=root /bootmgr

    [Reply]

    #14 
    Written By nyymi on August 27th, 2011 @ 7:17 am

    Magic!!! Thanks a lot for the help! You are masters!

    [Reply]

    #15 
    Written By Marcio on October 6th, 2011 @ 7:36 pm

    who has issues mounting the ISO try this way since it has a UDF stuff

    mount -t auto -o loop “/path to your iso/” /put the path where to mount the iso/

    [Reply]

    #16 
    Written By Pedro on October 10th, 2011 @ 7:56 pm

    hey guys, installed ubuntu on my machine but cant install any thing else. some one out there to help? thx.peter,Uganda

    [Reply]

    #17 
    Written By peter on December 6th, 2011 @ 5:37 am

    Hey y’all,

    Great idea.

    Somebody (possibly someone who got this t’work) should rewrite these instructions in English (less terse/more detailed instruction). Seems like that’s the problem quite a few were havin’ and that means the same’ll be true for many more to come.

    Anywaaayyy… couple guys named Zhen & Niggle asked if this would work for XP. The answer to that is – No (Yes, I know it was almost 2 years ago). But I’ve been tryin’ to get it to work for an XP image on-’n'-off for a few days now and ain’t got it t’work yet. I’m combinin’ steps 1-3 above with info gleaned from the “Grub4dos Guide” found here:

    http://diddy.boot-land.net/grub4dos/Grub4dos.htm

    and will post the outcome (good-’r-bad) here when I’m done.

    Much obliged.

    [Reply]

    #18 
    Written By andy on December 23rd, 2011 @ 6:25 pm

    Hey all,

    Here’s my update.

    I attempted two different methods to get this process to work using a Windows XP .iso.

    a. I have a laptop with a 100gb IDE hard drive with a Zorin distro on it. The hard drive was originally divided into two partitions, a 1gb extended partition that held the swap space, and the rest of the space was formatted as an ext4 primary partition.

    b. I booted the laptop from a USB flash drive containing a copy of a Zorin “Live” distro.

    c. I used the GParted tool included within the Zorin Live to further partition the IDE hard drive by creating a 40gb ntfs partition as the first primary partition on the IDE drive.

    d. Then I shut down the computer and removed the flash drive.

    e. I rebooted the laptop to make sure the Zorin OS residing on the IDE drive still worked.

    f. I downloaded an XP .iso file.

    g. I extracted the files and folders from the image to my Desktop (so I can check its integrity if necessary).

    h. I then dragged-and-dropped the files and folders into the 40gb ntfs partition.

    FYI: I use Daemon Tools and Winrar to extract and unpack images from downloaded .iso’s and cd’s. The XP .iso I used contained these folders: DOCS; DOTNETFX; I386; SUPPORT; VALUEADD; and [BOOT]; and these files: AUTORUN.INF; README.HTM; SETUP.EXE; SETUPXP.HTM; WIN51; WIN51IC; and WIN51IC.SP3. These are what I chose to use. Your downloaded .iso or cd may contain different items, such as if you have an OEM cd.

    i. That brought me to Step 3 of Admin’s instructions, which is self explanatory and I followed except, according to the Grub4dos Guide (See parenthetical remark in the first “Note” under “Boot Options” section), the last command line (the word “boot”) is not needed and is to be excluded from a text file. Therefore, I changed this:

    title Grub for Dos
    root (hdx,y)
    kernel /grub.exe
    boot

    to this:

    title grub4dos
    root (hdx,y)
    kernel /grub.exe

    j. Step 4 of Administrator’s instructions requires one to access the “chainloader” function of Grub4dos and for Windows 7 the correct command should rightly point to the “bootmgr” function of 7, but for XP either the “setupldr.bin” or the “winnt.exe” functions (as best I can determine) should be invoked. So first I tried this:

    grub>find –set-root /setuptldr.bin
    grub>chainloader /setupldr.bin
    grub>boot

    k. And then I tried this:

    grub>find –set-root /winnt.exe
    grub>chainloader /winnt.exe
    grub>boot

    Neither of which worked. So, either:

    A. one of these two files is the wrong invocation, or
    B. both of them are wrong, or
    C. the find –set-root command isn’t working, like some had pointed out.

    I’m off to seek a solution and will post another update.

    Have a good one.

    [Reply]

    #19 
    Written By andy on December 26th, 2011 @ 2:01 pm

    One more method:
    unpack Win iso to flash drive (/dev/sdX), and:
    ms-sys -7 /dev/sdX
    (May be also you’ll need: lilo -M /dev/sdX )

    [Reply]

    #20 
    Written By Deniz on January 24th, 2012 @ 7:55 pm

    Add a Comment

    required, use real name
    required, will not be published
    optional, your blog address