Ubuntu burn windows iso to usb

I want to burn a Windows ISO to a USB device in Ubuntu. How do I do this? I know how to burn a Ubuntu ISO into a USB device, but with a Windows ISO it's not the same.

If you boot with UEFI (not BIOS or UEFI with BIOS compatibility mode (a.k.a. CSM)) all you’ll need is GParted and a file manager.

The ISO must be configured for UEFI boot for this to work. I’ve successfully done this with both Windows 8.1 and Ubuntu 14.04, but I can’t vouch for any other OS. (Edit: I just tried this with Windows 10 without success. Don’t know why, but WinUSB worked so I didn’t investigate further.)

This is what I do to create a bootable USB drive for UEFI firmware:

  1. Create a GPT partition table on your USB drive. In GParted, chose «Device» and then «Create partition table…». Choose gpt in the dropdown.
  2. Format a partition on the USB drive to FAT32 using GParted. All UEFI compliant firmwares must support FAT12, FAT16 and FAT32, so any of these should be fine, but NTFS will not work.
  3. Mount the USB drive like you would any other external storage so you can access the filesystem on the partition you created.
  4. Mount the ISO you wish to add to the USB drive so you can access the files in there.
  5. Now, when you have access to both the ISO and the USB drive as filesystems in your file manager (Nautilus or whatever) just copy and paste all files in the ISO to the USB drive.
  6. Add the ‘boot’ flag to the partition you’ve created and added the files to. In GParted, right click the partition, choose «manage flags» and then check the «boot» option.

(While testing this I couldn’t mount the USB drive anymore after setting the boot flag. I don’t know why, but GParted could still see it and the end result was still a bootable USB drive, so I guess it doesn’t really matter.)

  1. Restart your computer and choose to boot from the USB drive.

Once again: Please note that for this to work, your computer’s firmware must be UEFI compliant and the ISO must be ready for UEFI boot.

If you find an EFI directory in the ISO that’s usually a good sign.

To see whether you’re currently using UEFI boot, run sudo efibootmgr -v in a terminal. If it lists a number of boot options you’re good to go. If you’re using BIOS compatibility mode you’ll see something like this:

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.

For more information on UEFI, please read this excellent essay on the subject: https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/

Also, I don’t think Ubuntu will work with Secure Boot enabled, so you’ll have to disable that to be able to use UEFI boot with Ubuntu.

Бывают случаи, когда вам нужно записать Windows на флешку в Linux, например, когда вы хотите поставить эту систему второй для использования специализированных программ, или вам нужно переустановить операционку своим знакомым. Или же есть пользователи Linux, которые решили вернуться на Windows, но единственную флешку уже перезаписали под Linux LiveUSB.

Загрузочная флешка Windows в Linux создается достаточно просто. Я предлагаю несколько способов решения этой проблемы. Все их я перечислил ниже.

Загрузочную флешку можно создать с помощью терминала или специальных графических утилит. Настоятельно рекомендую отформатировать флешку в Fat32 (или Exfat) перед использованием любого из предложенных методов. Форматирование можно выполнить через Gparted, сfdisk+mkfs или через usb stick formatter (форматирование USB флеш накопителя).

Способ 1. Утилита USB Image Write

Для создания флешки можно воспользоваться утилитой Запись образа на USB. В некоторых дистрибутивах она уже предустановленна (Ubuntu, Mint и др.):

Выбрать образ в графе Write image образ и в поле to выбрать флешку. Далее нажимаем Write.

Способ 2. Утилита WoeUSB

Пожалуй, это самый простой способ создания. Установка в Ubuntu выполняется с помощью таких команд:

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt update

sudo apt install woeusb

Откройте утилиту в меню приложений:


Интерфейс простой. Нажмите на кнопку Обзор со значком папки и выберите образ. Target device это флешка, на которую будет идти запись, если у вас их несколько выберите нужную. Ещё есть поле File system, где нужно выбрать какую файловую систему будете использовать. Рекомендую FAT. Затем нажмите Install и дождитесь окончания.

При появлении ошибки с кодом 256 Source media is currently mounted, размонтируйте образ ISO с Windows, если вы его смонтировали. При ошибке Target device is currently busy, извлеките флешку, затем снова подключите её. Если не сработало, попробуйте отформатировать её.

Способ 3. Терминал и Gparted

Положите образ в домашнюю папку и переименуйте его в windows.iso во избежание проблем с пробелами. Затем перейдите в терминале в домашнюю папку

cd ~

Запустите терминал через главное меню или с помощью сочетания клавиш Ctrl + Alt + T затем используйте команду dd для записи образа на флешку:

dd if=/windows.iso of=/dev/sdX

Замените X на букву вашей флешки! Узнать её можно через Gparted. В правом верхнем углу есть кнопка переключения дисков:

Тот диск который соответствует размеру вашей флешки и есть ваша флешка. В моем случае флешка на 32 гб это /dev/sdb. Значит команда будет иметь вид:

dd if=/windows.iso of=/dev/sdb

Дождитесь окончания записи и извлеките флешку.

Выводы

Как видите, создание загрузочной флешки Windows в Linux не представляет сложности. Это были все способы, которые я знаю. Если они вам помогли, напишите об этом. Если вы знаете еще способы, обязательно напишите о них в комментариях!

Creative Commons License

Статья распространяется под лицензией Creative Commons ShareAlike 4.0 при копировании материала ссылка на источник обязательна .

Об авторе

Здравствуйте, я изучаю Linux и обладаю хорошими знаниями английского.

Learn how to create a bootable Windows 10 USB on Ubuntu and Linux Mint using a free application called ‘WoeUSB’ in this guide.

While I don’t use Windows 10 as my primary OS I do know, every now and then, need to. And should I need to create a bootable Windows 10 USB to install the system from I like do it from my Ubuntu desktop.

There are several ways to perform this particular task, but the steps in this post walk through what I consider to be the easy way to create a bootable Windows 10 USB (one that actually boots).

Ready to learn more?

create windows 10 usb on Ubuntu linux
Windows 10

WoeUSB is the (oddly named) app to use to make a bootable Windows 10 USB stick on Ubuntu. A fork of an earlier tool called WinUSB, WoeUSB is free open source software and is available as a graphical app (GUI) and a command-line only (CLI) client.

In this tutorial we focus on using the WoeUSB GUI app.

So what does it do?

Related Guide

How to Install WSL 2 on Windows 10

Well, WoeUSB lets you make a bootable USB for various Windows releases, including Windows Vista, Windows 7, Window 8, and Windows 10. 

All languages and all variants of Windows, including Pro, Home, N, 32-bit, and more. are supported, and the tool works with both ‘legacy’ and ‘UEFI’ bootmodes, too.

For advanced use cases I recommend using the WoeUSB CLI as it has all sorts of flags and switches to curate custom installs with specialist needs.

But for everyone else the WoeUSB GUI client is all that’s needed.

Before we begin make sure you have all of the following to handy, as all are required to create a bootable Windows 10 USB on Ubuntu:

  • WoeUSB app
  • USB flash drive (4GB minimum)
  • Windows 10 .iso file

Remember: you can download Windows 10 disc images from the Microsoft website. If you don’t currently have one you should go there to grab one. You do need a valid Windows license to activate and use most versions of Windows, but you don’t need one to create an installable USB of Windows or perform the install.

1. Install WoeUSB on Ubuntu

WoeUSB launcher
Getting the WoeUSB app

First the drawback: WoeUSB is not longer actively maintained upstream, meaning you can no longer download the tool direct from its original GitHub page.

However, since the tool is so useful the community has stepped in to fork the app and continue development. They have also created personal package archive (PPA) for users to install WoebUSB on Ubuntu 18.04 LTS through 20.04 LTS.

To add the WoeUSB PPA to your software sources run the following two commands from a terminal emulator of your choice:

sudo add-apt-repository ppa:tomtomtom/woeusb
sudo apt update && sudo apt install woeusb-frontend-wxgtk

If you use a 32-bit version of Ubuntu 16.04 LTS you can download a Ubuntu 32-bit WoeUSB installer.

2. Run WoeUSB

The WoeUSB tool on Ubuntu desktop
The WoeUSB GUI

With WoeUSB installed on your system the next step is to open it. Go to your preferred application menu (on Ubuntu press the Super key) and find ‘WoeUSB’.

The app is quick to open and is easy to use.

First, select a valid Windows 10 .ISO image using the file selector button, then select the USB drive you want to install it to from the ‘Target device’ section.

If you don’t see your USB device listed in the ‘Target device’ section first make sure it’s plugged in correctly and then click the ‘refresh’ button to update the list of attached devices.

3. Create Windows 10 Bootable USB

The WoeUSB tool on Ubuntu desktop
Installing…

Before you go ahead and hit ‘install’ to create your bootable Windows USB please, please double-check that you’ve selected the correct drive first. The install process will wipe the contents of the selected USB drive. You will lose any data stored on it.

Other than that, the tool does the rest so just let it run its course

Once flashing is complete you’ll see a small notification. Close WoeUSB, safely eject the USB drive you’ve created, and use it as a boot device elsewhere to install Windows 10.

Contents

  1. Create a Windows install drive
  2. If you have not yet …

    1. … downloaded an iso file

      1. Download a 64-bit Windows 7—10 iso file
    2. … created a mountpoint and loop mounted the iso file

      1. Create a mountpoint
      2. Loop mount the iso file
      3. Check the size of the biggest file
    3. … downloaded the correct compressed image file

      1. Download the following compressed image file
  3. Create the partition table and file systems

    1. Install mkusb if you want to clone safely and easily (optional)
    2. Clone ‘grub-win-ntfs-install.img.xz’ to the target drive

      1. Use mkusb or Disks
      2. Use dd to clone in a risky way
      3. Use Win32 Disk Imager to clone in Windows
    3. Mount partitions on the target drive

      1. Create mountpoints
      2. Mount the partitions on the USB pendrive or memory card
  4. Copy the content from the iso file to the target partition

    1. rsync
    2. Alternative 1
    3. Alternative 2
  5. Flush the buffers
  6. Now you have a Windows install drive :-)

    1. Unmount the partitions on the target drive and unplug it
  7. Continue if you wish

    1. Modify the partition table

Return to the main diy page


Create a Windows install drive

These instructions can help you create a USB pendrive, that can install Windows from an iso file, which contains a file that exceeds the 4 GiB limit for the FAT32 file system.

  • The size of the USB pendrive should be at least 8 GB
    • If you have a custom iso file, that needs more space than provided by the NTFS partition of the compressed image file, you should delete the NTFS partition and create a new partition using all the drive space behind the FAT partition
  • The method is tested with 64-bit systems
  • The install drive works both in UEFI mode and BIOS mode (alias CSM alias legacy mode) including secure boot. Grub is used to boot in BIOS mode, and it comes with the compressed image file.

If you have not yet …

… downloaded an iso file

Download a 64-bit Windows 7—10 iso file

You find Windows iso files via Microsoft’s web pages (and you need a license key to use it later on).

… created a mountpoint and loop mounted the iso file

Create a mountpoint

Create the mountpoint only once.

sudo mkdir -p /mnt/lp1

Loop mount the iso file

sudo mount -o loop file.iso /mnt/lp1

for example

sudo mount -o loop Win10_1809Oct_EnglishInternational_x64.iso /mnt/lp1

Check the size of the biggest file

When you have loop mounted a Windows iso file, you should check the size of the biggest file, often ‘install.wim’. If it is > 4GiB, you need an ntfs partition. You can look for the biggest file with the following command line,

find /mnt/lp1 -ls|sort -nk7|tail -n1

Convert from bytes to MiB (you can divide by 2^30 in bc).

You can find all files that exceed the limit directly with the following command line,

find /mnt/lp1 -size +4G -printf "%11s %pn" | sort -n

If a file exceeds the limit, you should download and use a compressed image file, that provides two partitions, one with the file system FAT16 and one with NTFS, that can manage the big file(s).

… downloaded the correct compressed image file

Download the following compressed image file

You may want a higher level of security. This file is signed with gpg and you can verify it according to the following commands.

gpg --keyserver keyserver.ubuntu.com --recv-keys EB0FC2C8
gpg --verify grub-do-it-yourself.img.xz.md5.asc 

The warning «was NOT verified» means that there is no chain of trusted keys between your computer’s keyring and the key, that was used to sign the checksums (the key of sudodus). Check that the result matches with the following output, when you verify it,

$ gpg --keyserver keyserver.ubuntu.com --recv-keys EB0FC2C8
gpg: directory `/home/tester/.gnupg' created
gpg: new configuration file `/home/tester/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/tester/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/tester/.gnupg/secring.gpg' created
gpg: keyring `/home/tester/.gnupg/pubring.gpg' created
gpg: requesting key EB0FC2C8 from hkp server keyserver.ubuntu.com
gpg: /home/tester/.gnupg/trustdb.gpg: trustdb created
gpg: key EB0FC2C8: public key "Nio Sudden Wiklund (sudodus) <address@mailserver.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

$ gpg --verify grub-win-ntfs-install.img.xz.md5.asc 
gpg: Signature made sön  3 mar 2019 13:20:07 CET
gpg:                using RSA key 0303EA77E34C52F2295847C6BD43C742EB0FC2C8
gpg:                issuer "nio.wiklund@gmail.com"
gpg: Good signature from "Nio Sudden Wiklund (sudodus) <nio.wiklund@gmail.com>" [ultimate]

Then there is reason to trust that nobody else has written the checksums. The date of the signature will change at updates, and the text might be translated to your local language, but it should be clear that it is a ‘Good signature from «Nio Sudden Wiklund (sudodus)»‘.

If you have the compressed image file and the md5sum file in the same directory, you can use the md5sum program to check like this,

md5sum -c grub-win-ntfs-install.img.xz.md5.asc

tester@xenial32 ~ $ md5sum -c grub-win-ntfs-install.img.xz.md5.asc
grub-win-ntfs-install.img.xz: OK
md5sum: WARNING: 14 lines are improperly formatted

The ‘improperly formatted lines’ are the lines belonging to the gpg signature.

Create the partition table and file systems

Install mkusb if you want to clone safely and easily (optional)

https://help.ubuntu.com/community/mkusb

Clone ‘grub-win-ntfs-install.img.xz’ to the target drive

Normally you would clone grub-win-ntfs-install.img.xz to a USB pendrive or memory card, minimum size 8GB. The image extracts to 7743 MB. There is a margin for undersized 8 GB pendrives and cards. Please unmount all partitions on the target drive before cloning.

Use mkusb or Disks

Use mkusb or Disks to clone in a safe way, via the GUI or using mkusb-dus

dus grub-win-ntfs-install.img.xz

or

Use dd to clone in a risky way

Avoid this method if you can, because it is risky.

Identify the target drive. You can use lsblk without options or better, copy and paste the following command line

lsblk -d -o name,vendor,model,type,size,hotplug

and then use the correct drive letter in the cloning command line

xz -d —stdout grub-win-ntfs-install.img.xz | sudo dd of=/dev/sdX bs=4096

where X is the drive letter of the target drive. Check that the drive letter is correct, and double-check the details of the whole command line. A minor typing error might overwrite your family pictures.

Use Win32 Disk Imager to clone in Windows

Mount partitions on the target drive

Create mountpoints

Create mountpoints only once.

sudo mkdir -p /mnt/sd1
sudo mkdir -p /mnt/sd2

Mount the partitions on the USB pendrive or memory card

Identify the target drive. You can use lsblk without options or better, copy and paste the following command line

lsblk -d -o name,vendor,model,type,size,hotplug

or blkid, grep and cut, copy and paste the following command line

sudo blkid |grep WININSTFAT|cut -d ' ' -f 1-2
sudo blkid |grep WinInstNtfs|cut -d ' ' -f 1-2

and then use the correct drive letter in the mounting command line

sudo mount /dev/sdX1 /mnt/sd1

sudo mount /dev/sdX2 /mnt/sd2

where X is the drive letter of the target drive. Double-check that the drive letters are correct.

Copy the content from the iso file to the target partition

rsync

You can use rsync to perform the copy operations. First copy the files related to booting to the FAT partition. Then copy ‘everything’ to the NTFS partition. Some computers need the FAT partition to boot in UEFI mode. Some computers can boot directly from the NTFS partition.

(Grub is used to boot in BIOS mode, and it comes with the compressed image file, you need not worry about that.)

sudo rsync -r --info=progress2 --exclude=sources /mnt/lp1/ /mnt/sd1
sudo mkdir /mnt/sd1/sources
sudo rsync -r --info=progress2 /mnt/lp1/sources/boot.wim /mnt/sd1/sources
sudo rsync -a --info=progress2 /mnt/lp1/ /mnt/sd2

There might be some warning and error messages from the rsync copying process. Some links cannot be understood and some permissions cannot be preserved by the FAT32 file system in the target partition. But the result will still be a useful system in the drive.

I have seen cases, when running in some versions of 32-bit Ubuntu systems, where rsync does not copy all the files correctly. They are truncated (too small). When this happens the system in the drive will not work. rsync did not notice it; there was no warning or error message about this problem.

Alternative 1

You can use mkusb for the whole process instead. It is made and tested to manage these cases, where rsync truncates some files. But mkusb does not work (yet), if a file exceeds 4 GiB.

Alternative 2

You can try to extract the content from the iso file to the target partition with your favourite tool for compressed files, for example

1. 7z (via the package p7zip-full) in Ubuntu and

2. 7-zip in Windows.

Flush the buffers

Now you have a Windows install drive :-)

Unmount the partitions on the target drive and unplug it

Check that no partition on the target drive is mounted with

(and you can unmount the iso file too

sudo umount /mnt/lp1

but it is mounted read-only, and not dangerous to leave mounted)

In Windows you should eject the drive and wait until it is ‘safe to remove the device’.

or

Continue if you wish

Modify the partition table

  • If there is space enough (if the drive contains more than 8 GB), you can create a third partition. It is easy to use gparted to create the third partition.

  • If you have a custom iso file, that needs more space than provided by the NTFS partition of the compressed image file, you should delete the NTFS partition and create a new partition using all the drive space behind the FAT partition.

Return to the main diy page

Installation/iso2usb/diy/windows-installer-for-big-files (last edited 2021-07-24 18:32:08 by gm-andrade)

Понравилась статья? Поделить с друзьями:
  • Ubuntu boot repair legacy windows detected
  • Ubnt discovery скачать для windows 10
  • Ubnkern initrd ubninit что делать windows
  • Ubit unis скачать бесплатно для windows 10
  • Ubisoft connect скачать для windows 10