6

I know that there is a way in which, one can install Linux or Ubuntu on Windows easily but, what about installing Windows on Linux or Ubuntu i.e If I have a machine with only Ubuntu, how can I install Windows on it without removing Ubuntu?

I don't want to do this in a Virtual Machine. I just want to have two OS in a single hard drive.

6
  • 1
    No that's not even possible, you DO need a Virtual machine here. Dec 10, 2011 at 8:35
  • 2
    Windows does not let you do this. Windows needs to be on the 1st part of your HDD so you either reinstall it all or add a 2nd harddisc where you install windows.
    – Rinzwind
    Dec 10, 2011 at 8:58
  • 1
    I find the question misleading, first he asks to install Windows inside Linux then he goes on to say he has to have both OS in a single hard drive aka Dual boot... so which one is it?. Dec 10, 2011 at 9:15
  • 3
    The question is mostly clear, but it presents 3 problems, not 1. I.e., 1) Install windows from within Linux, 2) run windows natively from that installation, and 3) run Linux and Windows without the requirement for an extra drive (or partition?) from that installation. "sdadsadsa" just wants Wubi to work the other way around.
    – Barbarrosa
    Dec 10, 2011 at 23:23
  • The Windows installer makes many assumptions and overwrites many things when you install it, and the only way I've ever had success is to install windows first, then install linux. Jun 28, 2012 at 14:27

7 Answers 7

3

You can install Windows from inside Linux onto your physical hard drive, but you need separate partition as NTFS or FAT32. Below is a way to use a virtual machine to do the actual installation, but it's performed on your hard drive.

  1. Prepare a new partition onto where you want to install Windows.
  2. Start the Windows installation with a Qemu virtual machine and your physical hard drive mapped (target partition can't be mounted):

    qemu -hda /dev/sda -cdrom winxp.iso -m 1G -boot d --enable-kvm
    
  3. Install Windows on the partition you created.

  4. Reinstall Grub (if partition isn't first, you need to do a trick with mapping hd's, its working for me).
2
  • 2
    Is that even safe to do when you Ubuntu installation is also on /dev/sda and running?! And will Windows be able to boot? I've seen cases in which Windows will error out with a BSOD once it's booted up on different hardware (and the change from a Qemu/KVM virtual machine to the physical one is quite drastic).
    – gertvdijk
    Jan 29, 2013 at 23:26
  • May also want to use "-m 2048" to give the emulatad computer 2GB memory
    – Puggan Se
    Dec 17, 2014 at 21:34
2

You will need:

  • CD or USB stick containing GParted (see below)
  • Windows DVD or USB stick (of course)
  • Ubuntu Live CD or Live USB, version 10.04 or later

First use GParted to free some space to host Windows:

Install Windows as usual selecting the space you just created using GParted. This will "activate" only Windows and Ubuntu will not be accessible at this point. To make Ubuntu accessible again, take the Ubuntu Live CD and follow this guide (or see this question or this or that help wiki page.).

3
  • 2
    People who read this answer should be warned: You may risk data loss when using GParted to resize a Windows drive. I recommend using the tools provided within Windows instead (if they are available for your version of Windows). Howto provided here: howtogeek.com/howto/windows-vista/…
    – Barbarrosa
    Dec 10, 2011 at 23:30
  • 1
    You're right about the risks, but resizing a partition is impossible to do 100% safely, doesn't matter the software you are using. I adviced GParted because in normal conditions I know it works for sure, having done exactly the same procedure I described.
    – oidualc
    Dec 14, 2011 at 19:09
  • You can get away with just one USB stick for ubuntu AND windows with github.com/ventoy/Ventoy . Just install ventoy onto your stick, copy the ubuntu-live.iso and the windows.iso into the folder and boot from the stick. Windows 10 installation worked flawlessly in my case.
    – adabru
    May 9, 2021 at 12:48
1

This is hardly a complete answer, but it may help. I have a development machine here with Windows 7 and Kubuntu; I used a 128 GB SSD for Windows (the whole thing) and have Kubuntu dominant on my other three hard drives, with a limited partition made for media files in Windows. Any time I do have to reinstall Windows, I simply pull out the SATA cables from the back of my other hard drives first. After the install, I power down, plug them back in, power up, and set up Windows to use the proper directories (on the other hard drives) for user documents. I've done this more than once and it's yet to give me any trouble. GRUB even recognized it after a quick device scan.

I understand that you're trying to do this on a single hard drive, but everyone else has already highlighted the issues behind this (mostly with Windows being a complete #$%@&* about having to share). If you can get a cheap SSD or even HDD, and plug it in in parallel, then keep your more-responsible OSes on the major drives, it should make the process simple. You won't even have to worry about partitioning.

(I will also say that if you do do it this way, you'll save yourself a lot of trouble by keeping every drive either MBR or GPT; try not to mix and match. It makes booting more complicated than anyone wants to deal with.)

Best of luck!

0

You cant install easy like wubi in windows. Yo have to create virtual machine of windows. If you have iso file for windows os, you follow the bellow,

Download VirtualBox, and you will get the deb file, use Ubuntu software center to install. After install it,

  1. Select "NEW" enter image description here

  2. Name OS, enter image description here

  3. Select RAM size, enter image description here

  4. select Hardrive type, enter image description here

  5. Select VDI, enter image description here

  6. Select Dynamically allocated(for using available free space) else select fixed size(it's not recommended by me), enter image description here

  7. Select Hard Disk size enter image description here

  8. Your virtual machine is ready, enter image description here

  9. To start it, Go to settings --> Storage, Here select iso file you have stored in system enter image description here

  10. Click ok, and select start. enter image description here

0

The easiest way I found to install windows on a ubuntu or any linux only pc is as follows -

  1. Download and Extract the entire Windows ISO to any of your drive partition. Just make sure it's preferably an NTFS partition and is not the target partition in which you want to install windows and also don't put all the files inside a folder, just extract in like, say (hd0,5)/.

  2. Now open /boot/grub/grub.cfg in any text editor (with root access) and paste it -

menuentry 'Windows 10' {
set root=(hd0,5)
insmod ntldr
ntldr /bootmgr
}

Now change (hd0,5) to the partition where you have extracted the ISO image. Reboot your computer and choose windows 10 from boot menu.

Windows is Like Blind about ext3 or ext4 partition so you don't have to worry about deleting it accidentally. Once you have installed Windows, you can always install grub to revive your lost ubuntu partition.

I have made a video to show How to install Windows 10 from ISO image in linux GRUB

-1

Impossible As far as I know. First If you use Linux native partitioning, windows will not access it and hence NOT install anything. Also, even if it installs, there is issue of mbr, which will take you into complexities of overwriting each other. So it is practically bad decision and to my knowledge impossible!

What is so hard/wrong with putting them in separate partition?

1
  • -1 from me. I think OP doesn't object to creating a new partition. The wording was changed as time went by, please don't mind me pushing this answer to the bottom.
    – adabru
    May 9, 2021 at 12:39
-2

I think know what your trying to say I think you mean install Windows over Ubuntu. Just put your windows Operating System Disk in you PC and just install it over Ubuntu. But I don't know if you have important files on your Ubuntu OS so save all your usb,sd, or a disk.

1
  • 2
    The question specifically says they want to have two OSes on the one drive.
    – Sparhawk
    Apr 12, 2014 at 2:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .