43

I did the dd method and it wrote the iso to the USB drive, but I'm not sure that's all I have to do because it is Windows and may not have GRUB and I'm not sure so I'm asking the experts.

winusb does not work for Windows 10 so this is different from earlier questions.

Zanna
  • 70,465

8 Answers8

40

I tried all the ways in this thread and none worked (and seriously, the question is about specifically writing to an USB key, why would people propose copying the ISO to another partition instead ??).

The solution that did the trick for me (assuming your USB drive is /dev/sdc):

  • Run gparted
  • Create a new partition table on sdc, type msdos
  • Create a NTFS partition, set the boot flag on it
  • Extract the iso (can be done with 7z x windows10.iso)
  • Copy the content (via cp, rsync, a GUI, whatever) to the mounted NTFS partition (certainly /dev/sdc1)

  • The last, critical step, taken from this post : https://superuser.com/a/817656/248812 is :

    sudo ms-sys -7 /dev/sdc.

    ms-sys is available in a ppa : https://launchpad.net/~lenski/+archive/ubuntu/ms-sys

Without ms-sys, blinking cursor on boot when the USB key is inserted.

With it, windows logo shows up.

15

You don't need a USB, DVD or other external medium to install a Windows 10 Install Disk (ISO) starting from a Ubuntu only installation. It is possible to extract the image or ISO file to a partition of one your hard disks, preferable not the one your will use for a new Windows installation, and use it.

For the following steps, a working GRUB configuration should be present:

  1. Make sure you have a bootable and formatted NTFS partition present. Below, the partition will identified by (hd0,5) where hd0 is the containing hard disk with MSDOS or MBR partition table layout.

  2. Mounting the image will make it easier to extract it's contents. If Disk Image Mounter refuses to mount the iso file you can always use this command to mount any iso file:

    sudo mount -o loop [Image_Path] [Mount_Point]
    
  3. Copy the contents of new loop device to the NTFS partition.

  4. Now add a GRUB entry for Windows 10. This will make it possible for the bootloader GRUB to find install disk contained in the partition. Open /boot/grub/grub.cfg in text editor as root and add these lines

    menuentry 'Windows 10 Install Disk' {
    set root=(hd0,5)
    insmod part_msdos
    insmod ntfs
    insmod ntldr
    drivemap -s (hd0) ${root}
    ntldr /bootmgr
    }
    

    change the root if needed, accordingly.

  5. Save and restart computer. Boot into the right item of your updated GRUB menu.

Watch this Youtube tutorial https://youtu.be/1Y4JXv9r5Ug

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Suman
  • 167
  • 1
  • 3
  • It will not work if you're installing to the same partition or drive that you're booting from. – Conor Patrick Jul 03 '16 at 19:40
  • 5
    @ThisNameBetterBeAvailable How is this the correct answer? It doesn't even put the data on USB. – jbo5112 Sep 14 '16 at 23:08
  • @jbo5112 The answer mentions that extracting to a USB is unneccessary, and that extracting directly to a partition on the hard drive works too, as long as the correct code is added to grub.cfg – x13 Sep 15 '16 at 06:37
  • 7
    @ThisNameBetterBeAvailable How is extracting to a USB unnecessary to "burn the Windows 10 ISO to a USB," as the original asker was requesting. They might be wanting to use this on multiple computers. – jbo5112 Sep 16 '16 at 05:02
  • 1
    @jbo5112 That wasn't mentioned in the question, so assuming his goals and trying to help him with that is what happened. – x13 Sep 16 '16 at 06:33
  • 5
    @ThisNameBetterBeAvailable It's in the title of the question. – jbo5112 Sep 17 '16 at 11:13
  • @Sumna: I followed the instructions, all fine until , on the "step 1 - Select the driver to install" of the installation, an error message pops up: "A media driver your computer needs is missing". Apparently, it refuses to use the data from the hard disk, wants a USB or DVD. – tokland Nov 01 '16 at 17:09
  • that's a solution I didn't think about and actually shortcuts the way to a windows installation and hence that's what we actually want, it's a viable answer. I also can reuse this last partition of the drive everytime I need – sgohl May 05 '18 at 07:06
7

You can copy all the ISO contents to the flash drive and make it bootable.

So, first of all, install GParted from software center or from terminal:

sudo apt-get install gparted

Then, open it from dash or terminal:

gksudo gparted

After that, choose the flash drive from the menu in top right corner. There should be one partition. If you haven't any data to backup, reformat it as ntfs (bootmgr doesn't work right on fat32), click Apply (the tick in the header menu). Right-click the partition, choose Manage flags and check boot.

Then, you can mount it through your file manager (nautilus is default for GNOME and Unity).

Mount the ISO file:

sudo mount -o loop [path to iso] [mountpoint]

Then, you can copy all contents from the ISO mountpoint to the flash drive via the file manager.

Reboot your computer and set the USB Flash Drive to boot first.

Zanna
  • 70,465
aastefanov
  • 1,391
  • 12
  • 16
4

I managed to do this with WoeUSB. To install the WoeUSB command line tool snap package in all currently supported versions of Ubuntu open the terminal and type:

sudo snap install --edge woe-usb  
sudo snap connect woe-usb:removable-media

To launch the woe-usb snap package command line tool run the following command:

/snap/bin/woe-usb.woeusb

If you get a permission denied error click the Permissions button on the woe-usb screen in Ubuntu Software and toggle the permissions options from OFF to ON as shown in the below screenshot.

woe-usb Permissions

karel
  • 114,770
2

The ms-dos package is quite old an unmaintained. It does not load on ubuntu 16-04. Instead use the syslinux package which most likely already is installed: http://ubuntuhandbook.org/index.php/2013/08/repair-windows-mbr-from-ubuntu/

Also cp to an ntfs partition is slow. Extract the iso directly to sdc1

  • Run gparted
  • Create a new partition table on sdc, type msdos
  • Create a NTFS partition, set the boot flag on it
  • Copy the iso

    sudo dd of=/dev/sdc1 if=Win10_1703_English_x64.iso bs=4M

  • Create MBR

    sudo dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sdc

  • worked perfectly, should be the accepted answer. Thanks. –  Jan 30 '18 at 16:06
  • I just tried this (using Win10_1709_Dutch_x64.iso downloaded from MS) and it did not work for me. Booting the resulting USB stick failed with Missing operating system (which I think is printed by the MBR), booting on an actual system shows a similar message from the BIOS (which probably hides the MBR message). I wonder how this is supposed to work? A .iso does not contain NTFS? – Matthijs Kooijman Mar 29 '18 at 14:29
  • Should be an accepted answer - it is the easiest and does not require any external dependencies. dd'ing the .iso did not work for me though - it still created ufs filesystem instead of existing NTFS, but simple cp followed by dd'ing MBR worked like a charm – avtomaton Nov 15 '22 at 21:17
1

I tried with the ms-sys, it ran but I could not get the USB to boot. However, this worked:

sudo apt install woes
sudo woeusb --target-filesystem NTFS --device Win10.iso /dev/sdX

where the /dev/sdX must be your USB key.

1

If you weren't sure, then how can you say that the dd method worked? Also, that ain't the way. You have to use Rufus to make the USB drive bootable;not that I discourage the dd practices, since it is Windows we are talking about, I believe it is best to use Rufus to handle this for you.

If you have a Windows installation already, then boot into it and follow the steps below or else, use virtualbox.

PROCEDURE:

According to: http://www.cnet.com/how-to/how-to-install-windows-10-technical-preview-from-a-flash-drive/

you'll need at least 4GB flash drive (8GB for 64-bit).

--> Download and run Rufus, then insert your flash drive, making sure it doesn't contain any important data. (It's about to get wiped.) Rufus should automatically detect the drive and list it in the Device field. (If not, select the drive manually.)

--> Notice the check box marked, "Create a bootable disk using." Click the drive icon at the far right, then navigate to wherever you saved the Windows 10 ISO file. Select it, and then click Start. (All the other default settings in Rufus should be fine.)

--> This will take some time, perhaps as long as 20-30 minutes. Don't be alarmed (or confused) if an Explorer window appears for the flash drive; just leave it alone until Rufus reports "DONE." Then you can close the program and drive window and remove the drive.

--> Now it's time for the old PC. Plug the flash drive into a USB port, then power up the system. Most likely, it won't be configured to boot from an external drive by default, so you may need to jump into a startup menu or the BIOS during the POST. Ultimately, you need to force the machine to boot from the flash drive. Once you've done that, reboot, then follow the Windows installation instructions.

All the best!

  • but I don't have windows. the reason i want windows 10 is because my windows 7 doesn't work so I can't burn with rufus. is what i did ok? – SakuraKaminari Mar 22 '15 at 04:05
  • Then, install Windows in VirtualBox. Or, download WinUSB as suggested in: http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu

    The link shows how to regarding Windows 8 but I bet it would work with Windows 10.

    – Surya Teja Karra Mar 22 '15 at 04:10
  • well it seems that winusb didnt work reliably and idk ill try it but – SakuraKaminari Mar 22 '15 at 04:15
  • Well, then it is best to use VirtualBox now. If you are trying to use Windows, then it is best to host Windows (virtually for the time being). – Surya Teja Karra Mar 22 '15 at 04:17
  • I got this from WinUSB: Installation failed ! Exit code: 256 Log: Formating device... Error: /dev/sdf: unrecognised disk label – SakuraKaminari Mar 22 '15 at 04:21
  • i have no idea how to run windows virtually :/ – SakuraKaminari Mar 22 '15 at 04:21
  • It is very simple. Open the terminal (Ctrl+Alt+T) and type: sudo apt-get update && sudo apt-get install virtualbox-qt -y.

    After the installation is successful, type 'virtualbox' WITHOUT sudo.

    Now, create a virtual machine in the virtualbox and place a Windows installation disc into the DVD Drive of the laptop (OR) the windows 10 preview iso would suffice.

    Now follow the on-screen instructions and create the virtual machine. On first time run, it will prompt the CD/DVD source. IF you had the disc in DVD drive, choose it or browse for the Windows 10 ISO file.

    – Surya Teja Karra Mar 22 '15 at 04:26
  • I got from VM on first boot: Failed to open a session for the virtual machine Windows 10. AMD-V is disabled in the BIOS (or by the host OS). (VERR_SVM_DISABLED). – SakuraKaminari Mar 22 '15 at 04:58
  • It says the error right. Reboot the PC, enter the BIOS setup and look for anything which starts with "Advanced" except in Power management or with anything of such context.

    "Virtualisation" should be the word you would be looking for and any option you find relating to that would suffice! Just be careful not to tamper any OTHER settings.

    – Surya Teja Karra Mar 22 '15 at 10:58
  • I'll try that if nothing else works but i'd rather not mess with bios – SakuraKaminari Mar 22 '15 at 15:16
  • @Surya:You cannot install Windows that way. Windows pairs with hardware as soon as you install it. No-DRM OSes work just fine. I have transerred Ubuntu installation twice from a virtual machine. – Erkin Alp Güney Mar 22 '15 at 17:16
  • @erkin you don't understand, I asked the OP to install Windows( if he doesn't have it) so that he could run rufus. – Surya Teja Karra Mar 23 '15 at 17:29
  • I understand from my own experience that Rufus is the best tool on windows. But this is not the best answer as it’s best to solely use Ubuntu to get the work done. Ubuntu may be running on old hardware, which makes the use of VirtualBox totally irrelevant. – tno2007 Dec 28 '17 at 03:53
1

Found a much easier solution. Mount the ISO with loop etc and -t udf. Copy everything in a spare NTFS partition. Mark this partition as boot in gparted. Run sudo update-grub and reboot.

Zanna
  • 70,465
d3rdon
  • 194