I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu?
1116 Answers
WinUSB is old, obsolete, and outdated. It can cause problems on newer systems. You should be using WineUSB or other software in place of WinUSB.
This answer is, however, left here as-is for historical purposes.
Create a bootable Windows USB (Vista and above) from Ubuntu through WinUSB software.
Ubuntu 12.04 through 15.04
Run the below commands on terminal to install WinUSB from a PPA,
sudo add-apt-repository ppa:colingille/freshlight
sudo apt-get update
sudo apt-get install winusbWarning for Ubuntu EFI:
installing WinUSB on EFI loaded Ubuntu will uninstall the grub-efi packages in order to install the grub-pc packages. It will make your system unbootable if you don't manually reinstall grub-efi package before rebooting.
To do the manual re-install do:
sudo update-grub
sudo grub-install /dev/sda
sudo update-grub
sudo reboot 39 Any Ubuntu version
even other Linux distros as long as GParted and GRUB are installed.
Install GParted, GRUB, 7z, and NTFS on Ubuntu with:
sudo apt-get install gparted grub-pc-bin p7zip-full ntfs-3gFor BIOS: MBR partition scheme
Using GParted, rewrite the USB drive's partition table as msdos, format it as NTFS, and then "Manage flags" and add the
bootflag.In GParted, right click the USB partition and select Information. Copy the UUID somewhere as you will need it.
Mount your Windows ISO or DVD and copy all its files to the USB drive.
Go to the USB drive, and if the folder named
boothas uppercase characters, make them all lowercase by renaming it.Install GRUB on the USB drive.
In the below command, replace
/dev/sdXwith the device (e.g./dev/sdb, not/dev/sdb1) and replace<USB_mount_folder>with the folder where you mounted the USB drive (which could be like/media/<username>/<UUID>).sudo grub-install --target=i386-pc --boot-directory="/<USB_mount_folder>/boot" /dev/sdXCreate a GRUB config file in the USB drive folder
boot/grub/with the namegrub.cfg.Write this into the file, replacing
<UUID_from_step_2>with the UUID you copied down in step 2.echo "If you see this, you have successfully booted from USB :)" insmod ntfs insmod search_fs_uuid search --no-floppy --fs-uuid <UUID_from_step_2> --set root ntldr /bootmgr bootUnmount the USB drive.
Now to use it, restart your PC, and boot from the USB drive.
For UEFI: GPT partition scheme *
* Older Windows versions / editions may not be properly supported or not supported at all. I suggest reading the Microsoft UEFI Firmware page.
- Using GParted, rewrite the partition table of the USB drive as GPT.
- Create a new primary partition and format it as FAT32.
- Mount your Windows ISO or DVD and copy all its files to the USB drive.
- Look on USB in the
efi/boot/folder. If there's a filebootx64.efi(bootia32.efi) then you're done. The USB is bootable. Skip to step 7. - Otherwise, open
sources/install.wimwith the Archive Manager (you must have7zinstalled) and browse to./1/Windows/Boot/EFI/. From here extractbootmgfw.efisomewhere, rename it tobootx64.efi(orbootia32.efifor supported 32 bits OS [?]) and put it on USB inefi/boot/folder. - If you're making a Windows 7 USB, copy the
bootfolder fromefi/microsoft/toefifolder. - Don't forget to unmount (safely remove) the USB drive.
- Select the proper EFI loader from your BIOS.
Source: My blog post about this can be found at Make a bootable Windows USB from Linux.
Note
When properly used with a compatible target operating system, both of these methods should get you a bootable USB drive. However this does not guarantee successful installation of Windows.
31Writing ISOs with WoeUSB (WinUSB fork)
Some answers are outdated, since WinUSB is not working anymore. But there is a working fork called WoeUSB.
Github:
TLDR:
sudo woeusb --target-filesystem NTFS --device /path/to/your.iso /dev/sdXInstallation
It does not uninstall grub-efi anymore!
☞ Ubuntu / Debian
sudo add-apt-repository universe # contains the p7zip-full dependency
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install woeusb☞ Arch
pacaur -S woeusb☞ Fedora
dnf install -y WoeUSB☞ OpenSUSE
zypper install WoeUSBIdentifying the USB stick (the /dev/sdX path)
GUI approach
Search for a programm called disks, or if you use gnome you can launch it by executing gnome-disks.
Command line approach
There are several commands available to list storage devices. You might try one of these:
sudo lsblk --scsi --paths
sudo lshw -class disk -shortIdentify your usb device and see which path it has (like /dev/sdX).
Writing the ISO
After installation, write the windows ISO to your storage device with the following command. In the command below replace the X in /dev/sdX with your usb device path (see above how to find it).
sudo woeusb --target-filesystem NTFS --device /path/to/your.iso /dev/sdXThe --target-filesystem NTFS flag is required if the installation image is greater than 4GB, which is the case for the current Windows 10 official ISO file.
WoeUSB is a tool for creating a bootable USB flash drive used for installing Windows. Native UEFI booting is supported for Windows 7 and later images. WoeUSB is an updated fork of the WinUSB project.
Some third-party installers feature Windows installation images (/sources/install.wim) greater than 4GB making FAT32 as target filesystem impossible. NTFS filesystem support has been added to WoeUSB 3.0.0 and later.
WoeUSB (GUI+CLI) installation
Ubuntu 18.04 and later
Visit the WoeUSB GitHub page and look for a file with the form woeusb-x.x.x.bash (example: woeusb-5.2.2.bash).
Download woeusb-x.x.x.bash (example:
wgetbut the latest version may be different from 5.2.2).Right-click the woeusb-x.x.x.bash file that you downloaded, select Properties, and under the Permissions tab put a check in the checkbox before where it says Allow executing file as program.
Open the terminal and change locations with
cdto the directory that contains woeusb-x.x.x.bash.Install wimtools.
sudo apt install wimtoolsInsert a USB flash drive. If there are any files on the USB flash drive back them up to a different device. Open the disks application and make a note of the Device to be used later in step 7. The device should have the form
/dev/sdXwhereXis a letter of the alphabet, and in step 7 you must replace theXwith the correct letter of the alphabet that you found in Disks.Run the woeusb-x.x.x.bash script.
sudo ./woeusb-x.x.x.bash --target-filesystem NTFS --device Windows10.iso /dev/sdX # for Windows 10or
sudo ./woeusb-x.x.x.bash --target-filesystem NTFS --device Windows11.iso /dev/sdX # for Windows 11The command for other versions of Windows has a similar form to the above two commands.
The USB drive with Windows installer boots in either UEFI mode or BIOS mode.
UEFI mode (also boots with Secure Boot enabled)
BIOS mode (may be called CSM or Legacy mode)
Ubuntu 14.04-18.04
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install woeusbThis will install the WoeUSB graphical interface and the WoeUSB command line tool. WoeUSB supports both UEFI and BIOS for FAT32/NTFS/ExFAT USB flash drives.
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-mediaTo launch the woe-usb snap package command line tool run the following command:
/snap/bin/woe-usb.woeusbIf 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.
The WoeUSB GUI is easier to use than the WoeUSB command line tool. Click the radio button to the left of where it says From a disk image (iso), browse to the location of the Windows .iso file, under Target device select a USB flash drive, open Disks application and check that the Device name in Disks matches the Target device in WoeUSB (it should be something like /dev/sdX where X is a letter of the alphabet), and click the Install button to install to create a bootable Windows installation media on the USB flash drive.
Windows USB drive from Ubuntu failing repeatedly
WoeUSB Issues
The current UNetbootin boot chain is not compatible with UEFI and computers that come with a pre-installed copy Windows 8
You can use dd instead, while being careful in what you are doing:
sudo dd if=/path/to/iso/windows.iso of=/dev/sdX bs=4M; sync- Replace
sdXwith the drive you want to use (in my case,sdg): - This requires that your motherboard is able to boot from CDROM-USB.
If you want still to use UNetbootin, there are 2 (3) things that you will need:
- Unetbootin
- Gparted
- Internet access to install all the above, the Windows ISO image and a USB stick with more than 4GB.
So, first, backup all the contents of your usb stick. Once that is done install gparted and unetbootin:
sudo apt-get install gparted unetbootinNow look for gparted in the Dash or type gparted in the terminal. Select your USB stick from the right dropdown list. In my case it's /dev/sdg, yours may be different. Remove all partitions and create a single big FAT32 partition with Gparted.
Once that is done, unplug and plug your USB stick so it gets mounted (you can also mount it from the same GParted), now execute Unetbootin, again, you can look in the dash or typing in the terminal. Select that you want to use an iso, look for the path your ISO is.
Mark the checkbox to see all devices, here you have to select the very same device you selected in Gparted, otherwise your data can be lost. Select continue. Wait for a moment and done. Restart your pc and select to boot from the USB.
11In Non-UEFI machines, we can use GRUB2 to make USB stick bootable. Then, we can use 'ntldr' command in the GRUB2 to boot Windows from USB.
- Enable the boot flag on the target partition of the USB drive. It can be easily done with the use of the tool called "GParted". It is a GUI tool for drive partitioning.
- If the installation image is an ISO file, mount it and access the files.
- Copy all the files to root of USB drive.
Install GRUB to USB drive:
sudo grub-install --boot-directory="/media/user/MyUSBDrive/boot" /dev/sdXConfigure GRUB to boot Windows by placing the following file as "/boot/grub/grub.cfg" in the USB drive:
set menu_color_normal=white/black set menu_color_highlight=black/light-gray menuentry 'Install Windows 8' { ntldr /bootmgr }
See complete answer at my blogCreating a bootable windows USB from Linux
6A simple 'Do it yourself' method
A rather simple 'Do it yourself' method is described at the following links. You can create Windows install drives that work in UEFI mode as well as in BIOS mode,
This method will work also with [new] versions of Windows 10, where there is a file,
install.wim, with a size > 4 GiB, so that the FAT32 file system cannot manage it, when extracted from the iso file. In this case there will be a small FAT32 partition and a bigger NTFS partition. It is tested with an early version of Windows 11, and works there too.
This 'Do it yourself' method is for you
- if you have a Windows iso file that contains a file,
install.wim, with a size > 4 GiB, or - if you don't like PPAs, or
- if you want to 'Do it yourself' and understand the details
mkusb version 12.5.6 and newer versions
This 'Do it yourself' method is implemented in mkusb-tow and available via mkusb version 12.5.6 (mkusb-dus) and mkusb-plug.
You get/update this new version of mkusb from the mkusb PPA via the following commands
sudo add-apt-repository universe # this line only for standard Ubuntu
sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb mkusb-plug
sudo apt-get install usb-pack-efi # only for persistent live drives- mkusb 12.5.6 - brief description
- mkusb - general description and manual
- mkusb-plug - description and manual
mkusb-nox and mkusb version 12 (old method for 32-bit systems)
This 'mkusb' method is for you
- if you run a 32-bit operating system, and other methods have problems that extracted files are truncated
- if you want to create a boot drive for Windows 7 or 8
- if you want to create a boot drive for [older] Windows 10 versions, where no file in the iso file exceeds 4 GiB.
It was difficult to find a linux tool that can create boot drives (USB sticks, memory cards ...) with Windows, so I added this feature to mkusb-nox and later on created mkusb version 12 with this feature. It works in all current versions of Ubuntu (and Ubuntu flavours: Kubuntu, Lubuntu ... Xubuntu) and with Debian 8-10. The created boot drive can boot 64-bit Windows in both UEFI and BIOS mode.
dus with guidus alias mkusb version 12:
winusb from the accepted answer is the only easy method I found.
However, there is no winusb package for saucy. You can however install the raring package by downloading it here and opening it with the software installer. It works with saucy.
2You can use WinUSB for that to install WinUSB on your Ubuntu follow these instruction.
Okey, if you are from Ubuntu 13.10,13.04,12.10,12.04, then run this in terminal:
sudo add-apt-repository ppa:colingille/freshlight
sudo apt-get update
sudo apt-get install winusband if you are from Ubuntu 14.04 then run this in terminal:
sudo add-apt-repository ppa:colingille/freshlight
sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/colingille-freshlight-trusty.list"
sudo apt-get update
sudo apt-get install winusbWinUSB comes with a simple GUI with minimal options to go with, here is how to use WinUSB to make bootable Windows USB from Ubuntu. You can use any Windows ISO may be for XP, Windows 7, Windows 8, Windows 8.1 or any other.
- Insert Flash Drive & Get your Windows ISO (I used Windows 10 Technical Preview) or insert the Windows CD/DVD
- Start WinUSB and, nothing else really needs to be explained.
- Select your Source, either ISO or CD Drive
- Pick your Target (USB) Device. If it doesn’t appear, hit refresh and make sure it’s mounted.
- Click on “Install” and enter your Password (required to mount devices and write directly to drives)
This is all you need to do to create a bootable Windows USB Stick
Source : How to install and use WinUSB in Ubuntu
1For any one getting file limit exception using woeUsb , use terminal command
sudo woeusb --device /home/uName/Downloads/Win10_1809Oct_English_x64.iso /dev/sdb --target-filesystem NTFSInstead of /home/uName/Downloads/Win10_1809Oct_English_x64.iso use your path to iso file and
Instead of /dev/sdb use your path do the flash drive .
Install VirtualBox and the VirtualBox Extension Pack found there.
Download the Windows image you want to install.
Create a Windows virtual machine, and set it up using the Windows ISO file you downloaded.
Plug in your USB drive, and expose it to the VM using the latter's
Devices/USBmenu.Run Microsoft's Media Creation Tool in the VM (you will only be directed to the right page if you access it from Windows). Use this tool to create a bootable Windows USB.
The advantage of this method is that it depends only on Microsoft's tool, which does the configuration for you. The latest Windows images contain a file above FAT32's size limit, which makes it a pain to create a bootable USB drive by hand. My WoeUSB-created drive wasn't recognized by my Dell XPS's UEFI.
2Installing Windows using mkusb-plug
Install mkusb: Can I install mkusb in Ubuntu live USB? Works on internal Ubuntu drives and on Live Ubuntu USB's
Click mkusb-plug icon to start and then proceed as follows:
Step 1
Step 2
Step 3
[]4]
Step 4
Step 5
Step 6
Step 7
Step 8
You should now have a USB installer ready to infect your computer with Windows
Windows2usb
Windows2usb is a perfect solution for creating a bootable USB flash drive of Windows 7/8/8.1/10 ISO in Ubuntu. This tool supports BIOS and UEFI (with Rufus driver), FAT32 and NTFS.
Simply download the AppImage and make it executable using your file manager or by entering the following command in a terminal:
chmod +x ./*.AppImageThen follow the following instruction below as your requirements.
BIOS Boot
BIOS Boot (Legacy Boot/UEFI-CSM) uses stock Windows 7 MBR and NTFS bootloader, courtesy of ms-sys project.
Use this mode if you have old computer without UEFI support or want maximum compatibility of installation media.
To burn ISO in this mode, run:
windows2usb <device> <windows iso> mbrUEFI Boot
UEFI Boot (gpt mode) creates FAT32 partition with stock Windows UEFI bootloader.
This mode will not work on old computers. Use this mode for new computers with UEFI support.
This mode supports UEFI Secure Boot.
To burn ISO in this mode, run:
windows2usb <device> <windows iso> gptUEFI Boot with NTFS Partition
UEFI Boot with NTFS partition uses uefi-ntfs bootloader from Rufus project.
This mode is made for custom installation disks with install.wim file greater than 4 GiB, which could be found on various torrent trackers. Windows2usb creates 2 partitions in this mode, small 1 MiB FAT32 partition with uefi-ntfs and huge NTFS partition with ISO data.
This mode does not support Secure Boot (uefi-ntfs bootloader is not signed by Microsoft or other trusted party).
To burn ISO in this mode, run:
windows2usb <device> <windows iso> gptntfsIf your ISO contains install.wim greater than 4 GiB, gpt mode will automatically detect that and terminate the writing process.
For the sake of completeness, let me add instructions on how to create a bootable USB-disk from ThinkPad's UEFI/BIOS update ISOs. None of the above answers worked for me. (Perhaps there are similar problems with other vendors.)
Create an img file with
geteltoritosudo apt install genisoimage geteltorito <image>.iso -o <image>.imgWrite the img file to disk. Using this exact block size is important.
sudo dd if=<image>.img of=/dev/sdX bs=512K && sync
Creating a Windows Bootable USB Stick using Ubuntu
Windows can be installed to boot in BIOS, (Legacy), mode or in UEFI mode. I will describe each method.
BIOS, (Legacy), mode, MSDOS Partition Table
Boot Ubuntu in Legacy mode.
Using GParted, create a 8GB NTFS partition for the installer and a 50GB or larger partition for Windows.
Mount the Windows ISO using
sudo mount -t udf /{Path to ISO}/Win.iso /media/iso, Copy the contents of/media/iso/to the 8GB partition.In Terminal run
sudo update-grubto add the Windows installer to Ubuntu's GRUB menu.Edit the grub.cfg Windows menuentry, to add
ntldr /bootmgron the line afterchainloader +1Reboot and select Windows Recovery Environment from the Boot menu.
Proceed with Windows 10 installation as normal.
UEFI mode, GPT Partition Table
Boot Ubuntu in UEFI mode.
Using GParted, create a 8GB NTFS partition for the installer and a 50GB or larger NTFS partition for Windows.
Mount the Windows ISO using
sudo mount -t udf /{Path to ISO}/Win.iso /media/iso, Copy the contents of/media/iso/to the 8GB partition.It should not be necessary to Update GRUB to boot in UEFI mode. (Please let me know if you find otherwise).
Reboot, The Windows installer should start. At this point you can close the installer to open the GRUB menu.
UEFI Notes:
UEFI properties may vary among vendors.
It may be necessary to add Windows Recovery Environment menuentry by hand.
Some instructions for installing Windows recommend the ISO be extracted to a FAT32 partition. If there are problems using the ISO extracted to NTFS see: , (thanks to oldfred).
I was not able to install as UEFI mode from Legacy Ubuntu on GPT disk.
20.04 ONLY, working as of 2/11/2021
Woeusb GUI will no longer install from the webupd8 PPA on 20.04 due to a dependency error
The following packages have unmet dependencies: woeusb : Depends: libwxgtk3.0-0v5 (>= 3.0.4+dfsg) but it is not installable
E: Unable to correct problems, you have held broken packages.To get it to work, download the dependency and install it libwxgtk3.0-0v5_3.0.4+dfsg-3_amd64.deb
wget
sudo dpkg -i libwxgtk3.0-0v5_3.0.4+dfsg-3_amd64.debThen install via the PPA
sudo add-apt-repository ppa:nilarimogard/webupd8 && sudo apt update
sudo apt install woeusb