How to install Windows 7 from Ubuntu without burnning a disc
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:
- How to restore Grub 2 after reinstalling Windows XP/Vista/Win7
- Install Ubuntu without burning LiveCD from Windows 7 dual-boot(not wubi)
- How to install ubuntu9.04 dual boot with Windows XP
- Install Ubuntu 9.10(Karmic) from Windows XP dual-boot system
- Add Windows into grub menu after install Ubuntu

Reader Comments
I love you guys!
So talented and smart!
Your knowledge is very appreciated.
[Reply]
I’m from Indonesia,
thanks bro . . .
how about install windows xp from ubuntu??
thanks for tutor . . .
[Reply]
Very useful tuto, thanks!
Should we use this how to on installing Windows XP ?
Regards,
Budiarno
[Reply]
I am really grateful to you …..
Thanks man
Great tut…..
Also,I did not required step 4
[Reply]
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]
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:
January 9th, 2011 at 4:21 pm
I am stuck at this stage too! Help us!
[Reply]
Shaun Reply:
February 11th, 2011 at 10:58 pm
HELP!! same problem!
[Reply]
landon Reply:
July 23rd, 2011 at 8:15 pm
it’s find –set-root /bootmgr there are two dashes befor set not one.
[Reply]
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]
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]
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:
July 7th, 2011 at 12:52 pm
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:
November 1st, 2011 at 6:32 pm
Thanks to the tutorial writer and the above comment. Worked with Ubuntu 11.
[Reply]
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]
I must say this is the most accurate and usefil article i have found.
[Reply]
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:
August 3rd, 2011 at 11:03 pm
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]
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]
try
search –set=root /bootmgr
[Reply]
Magic!!! Thanks a lot for the help! You are masters!
[Reply]
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]
hey guys, installed ubuntu on my machine but cant install any thing else. some one out there to help? thx.peter,Uganda
[Reply]
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]
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]
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]