Create a Bootable Windows 10 USB in Linux With Ubuntu/Debian GUI nixCraft

I am a Linux user and sysadmin. However, I need to install a couple of Windows 10 enterprise or MS-Windows 10 LTSB on a desktop system for developers. How do I create a bootable Windows 10 USB in Linux with GUI tools on an Ubuntu Linux 18.04 or Debian Linux 9.x?

Introduction: There are two methods to install Microsoft Windows 10 enterprise, pro or LTSB ( long-term servicing branch) on a USB pen drive. The first method includes installing an app called woeusbgui and writing an ISO image using that app to the USB pen drive. The second method use a bash shell script. The third method involves typing the various command at the Linux shell prompt and recommended for advanced users. Let us see how to create a bootable Windows 10 enterprise or LTSB USB in Linux with the CLI and GUI methods. You need the following:

  1. Linux distro such as Debian or Ubuntu or Linux mint
  2. Windows 10 enterprise/ltsb client ISO (download link). The following instuctions should work with Windows 7/8/10 pro or home edition too.
  3. woeusb and releated commands from source code
  4. GNU compiler collection
  5. A USB pen drive (usb hard disk or usb stick) with at 4 Gb or more free disk space

Warning: Writing or selecting the wrong kind of boot record to a device (USB/hard disk) might destroy partition information or file system or data forever. Be careful with partition and disk names.

Method 1. Create a Bootable Windows 10 USB in Linux with woeusbgui GUI app

This method is recommended for all new Linux users as it requires less typing at the CLI and easy to use. WoeUSB is a simple Linux program to create a Windows 10 USB stick installer from a real Windows DVD or ISO image. From the Github page:

WoeUSB is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. It is a fork of Congelli501’s WinUSB. This package contains two programs:

  1. woeusb: A command-line utility that enables you to create your own bootable Windows installation USB storage device from an existing Windows Installation disc or disk image
  2. woeusbgui: A GUI wrapper of woeusb based on WxWidgets

It supports Windows Vista, Windows 7, Window 8.x, Windows 10. All languages and any version (home, pro, ltsb, …) and Windows PE.

Clone WoeUSB

Type the following git command
git clone https://github.com/slacka/WoeUSB.git
Set the application version string:
cd WoeUSB/
./setup-development-environment.bash

Install WoeUSB’s build dependencies on a Debian or Ubuntu Linux using the apt-get command or apt command
sudo apt-get install devscripts equivs gdebi-core
mk-build-deps
sudo gdebi woeusb-build-deps_*.deb
dpkg-buildpackage -uc -b
sudo gdebi ../woeusb*.deb

Install WoeUSB to create usb stick windows 10 installer from iso image on Linux
Install WoeUSB to create usb stick windows 10 installer from an iso image on Linux

Make a Bootable Windows 10 USB from Linux

Simply type the following command to completely WIPE the entire USB storage device (called /dev/sdc), then build a bootable Windows USB device from scratch:
sudo woeusb --device win_10.iso /dev/sdc
Not a fan of the CLI? Try gui version:
woeusbgui
Create a Bootable Windows 10 USB in Linux With WoeUSB Ubuntu or Debian GUI app
The progress:
Windows 10 writing to usb pen drive on Linux
Wait for some time. You should get a confirmation box as follows:
Installation done for Windows 10 on Linux
Remove USB pen from Linux. Go to your desktop/laptop. Insert USB pen. Boot up the system and make sure bios set to boot from USB. You should see Windows blue logo soon on the screen when installer boots from USB pen drive.
Windows logo - Booting from USB pen drive created on Ubuntu Linux
Now just follow on screen instructions to install Windows 10 Entperise client or LTSB edition on your desktop/laptop.

Method 2. Bash shell script to create a bootable Windows 10 USB device from one ISO file

Install it as follows from the Github:
sudo apt install extlinux
mkdir ~/bin/
cd ~/bin/
curl -L https://git.io/bootiso -O
chmod +x bootiso

To list your usb pen drive run:
~/bin/bootiso -l
To write create a bootable Windows 10 USB from an ISO image named ~/Downloads/win-10-ltsb.iso, run:
~/bin/bootiso -p ~/Downloads/win-10-ltsb.iso
~/bin/bootiso ~/Downloads/win-10-ltsb.iso

Create a Windows 10 USB bootable device from an ISO image
Create a Windows 10 USB bootable device from an ISO image using a bash shell script

Once created a bootable Windows 10 USB. Unplug it from the Linux computer. Turn on computer. Boot from USB and install Windows 10 enterprise client.

Method 3. Create a Bootable Windows 10 USB in Linux with CLI apps only

First you need to install a tool called ms-sys. It is a Linux cli app for writing Microsoft compatible boot records. This program does the same as Microsoft “fdisk /mbr” to a hard disk except that it does not copy any system files, only the boot record written.

Download and install ms-sys

Grab the latest version from this page. Use the wget command or curl command to grab the file:
cd /tmp/
wget https://nchc.dl.sourceforge.net/project/ms-sys/ms-sys%20development/2.5.2/ms-sys-2.5.2.tar.gz

Untar the tar ball named ms-sys-2.5.2.tar.gz using the tar command:
tar -zxvf ms-sys-2.5.2.tar.gz
If you do not have gnu gcc c/c++ compiler installed on a Debian or Ubuntu Linux, install it using the apt command or apt-get command:
sudo apt install build-essential
See the following links for more info:

Build and install it:
cd ms-sys-2.5.2
make
sudo make install

Create a ntfs partition

First, find out the usb device name using the lsblk command or lsusb command or dmesg command:
lsblk
lsusb
dmesg | more
## or use the grep command as follows ##
dmesg | sort| uniq | grep -A 6 usb-storage


I am going to use the /dev/sdc. Create a partition using the fdisk command:
sudo fdisk /dev/sdc
Create a partition as follows:
Creating a ntfs parition on usb pen using the fdisk on Linux
Format /dev/sdc1 to ntfs:
sudo mkfs.ntfs -f /dev/sdc1
mkfs.ntfs output on Linux

Linux create windows 10 Bootable USB by coping installer files

You need copy files from Windows 10 ISO image to usb disk. Create a folder on Linux using the mkdir command
sudo mkdir /mnt/win10/
Mount Windows 10 ISO image in Linux using the mount command:
sudo mount -t udf -o loop,ro,unhide {/path/to/win-10.iso} /mnt/win10/
## I got a win10 ltsb iso file in ~/Downloads/ ##
sudo mount -t udf -o loop,ro,unhide ~/Downloads/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X64FRE_EN-US.ISO /mnt/win10/

Mount usb pen drive too:
sudo mkdir /mnt/usb/
sudo mount /dev/sdc1 /mnt/usb/
df -h | grep '/mnt'

Ready to burn the Windows 10 ISO to a USB on Linux
Ready to burn the Windows 10 ISO to a USB on Linux

Copy files in Linux using the cp command or rsync command:
sudo cp -avr /mnt/win10/* /mnt/usb/
### OR use rsync ##
sudo rsync -avrP /mnt/win10/* /mnt/usb/

Use ms-sys command to write mbr to create a bootable Windows 10 pro usb in Linux

In order to burn the Windows 10 ISO to a USB and boot it, run:
sudo ms-sys -7 /dev/sdc
Sample outputs:

Windows 7 master boot record successfully written to /dev/sdc

Unmount /dev/sdc:
sudo sync
sudo umount /mnt/usb/

Now boot from USB pen and you should see Windows 10 installer as follows:
Windows 10 Booting from USB pen created on Linux

Conclusion

And there you have it. You just created a Windows 10 bootable USB stick on Linux using two different methods. Creating a Microsoft bootable Windows 10 USB stick from Linux is very simple, and I hope it helps you manage your enterprise workload without leaving Linux desktop.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Facebook Comments
Spread the love

Posted by News Monkey