Posts Tagged ‘Insert’

How to Create the Latest Windows 10 / 11 Installation Media from Linux OS

Monday, April 20th, 2026

create-a-windows-installation-flash-drive-from-linux-logo-howto-create-windows-media-os-installer

Creating a Windows 10 installation USB from a Linux system is entirely possible and surprisingly straightforward once you know the few steps process and using few Linux tools. Whether you're preparing a dual-boot setup, fixing a broken Windows machine OS onplace, or re-installed Windows, installing fresh from scratch, is an useful skill every self-respecting sysadmin should be aware of.

Why Create Windows Installation Media from Linux ?

Even a hardcore Linux sysadmin / Desktop users need Windows for specific software, gaming, or troubleshooting, or for deployment of Windows installs for non-IT professionals, friends or company environments.
Having a Windows installable ISO by downloading and using Windows Media Creation Tool is an easy trivial task for those with Windows but is a problem especially for GNU / Linux users like me who don't own a computer with Microsoft Windows, but have Debian / Ubuntu / Fedora in place
Microsoft’s official media creation tool is made to only runs on Windows OS, fortunately there is a few ways to have an installable USB drive prepared even on Linux.

The main challenge lies in properly formatting the USB flash drive and handling large Windows image files, especially the install.wim, which can exceed FAT32 file size limits.

What You’ll Need

Before starting, make sure you have:

  • A USB drive (at least 8GB sized recommended)
  • A Linux system (Ubuntu, Fedora, Arch Linux etc.)
  • The latest Windows 10 ISO file (downloaded locally)

1. Download the Windows 10 ISO

Go to Microsoft’s official website and download the latest Windows 10 ISO. You can do this directly from Linux using your browser.

  1. Go to the Official Windows 10 Download Page.
  2. On Windows: Press F12 (Dev Tools), click the Device Toolbar icon (mobile/tablet icon), and refresh the page. This tricks Microsoft into thinking you are on a Mac or Linux machine.
  3. Select the edition and language, then click Confirm.
  4. Right-click the 64-bit Download button and select Copy link address.
  5. In your terminal, use wget. Note: You must wrap the URL in double quotes because it contains special characters:


Use wget with  a direct copy of download link like for example:

$ wget https://www.microsoft.com/software-download/windows10.iso -O windows10.iso

Make sure the ISO is fully and correctly downloaded before proceeding further.

2. Install Required Tools

On Debian / Ubuntu deb-based distros. You’ll need few utilities:

# apt update # apt install wimtools ntfs-3g p7zip-full

On Fedora:

# dnf install wimlib ntfs-3g p7zip

These tools help extract and handle Windows image files properly.

3. Prepare the USB Drive

Insert your USB drive and identify it:

# lsblk

Look for something like /dev/sdb (be careful, as this will erase all data on the drive).

Partition and Format

Use fdiskor parted:

# fdisk /dev/sdb

  • Create a new partition table (GPT or MBR)
  • Create one primary partition
  • Set type to NTFS or FAT32

Then format it:

# mkfs.ntfs -f /dev/sdb1

 

NTFS is recommended because it supports large files.

4. Mount ISO and USB

Create mount points:

mkdir ~/winiso mkdir ~/winusb

Mount the ISO:

# mount -o loop windows10.iso ~/winiso

Mount the USB:

# mount /dev/sdb1 ~/winusb

5. Copy Files of ISO to Flash drive

Copy all files from the ISO to the USB:

# rsync -avh –progress ~/winiso/ ~/winusb/

This may take several minutes.

6. Handle Large install.wim File (If Needed)

If you formatted your USB as FAT32 and encounter issues with large files:

Split the WIM file:

# wimlib-imagex split ~/winiso/sources/install.wim ~/winusb/sources/install.swm 4000

Then remove the original:

rm ~/winusb/sources/install.wim

This step ensures compatibility with FAT32 file size limits.

7. Safely Unmount

Once everything is copied, make sure to:

# umount ~/winiso # umount ~/winusb

Now your USB is ready.

! NB ! Ensure Boot Files Exist

Double-check this path exists (on the new created Flash stick):

/EFI/BOOT/bootx64.efi

If this file is missing, the USB will fail to boot Windows 11 OS Installer.

8. Boot from fresh created USB drive

Insert the USB flash drive into the target machine, reboot, and enter BIOS / UEFI (usually by pressing F2, F12, DEL, or ESC).

Select the USB drive as the boot device / Save settings, reboot and the Windows OS installer screen should appear.

9. Troubleshooting Tips and Common Pitfalls (Especially with Windows 11)

  • USB not booting ? – Ensure your system is set to boot in UEFI mode if your USB is GPT formatted.
  • Missing drivers ? – Try recreating the USB using NTFS instead of FAT32.
  • Secure Boot issues ? – You may need to disable Secure Boot in BIOS.

9.1. USB Not Booting

  • Try use FAT32 instead of NTFS
  • Ensure UEFI mode is enabled

9.2. “File Too Large” Error

  • Very likely you forgot to split install.wim (as prior described)

9.3. Installer Refuses to Continue

  • Windows 11 require:
    a.TPM 2.0
    b. Secure Boot

10. Alternative GUI Linux Tools to use WoeUSB-ng / Ventroy

If you prefer Linux GUI tools for preparation of Installation USB drive Media , consider downloading WoeUSB or Ventroy:

  • WoeUSB – specifically designed for creating Windows bootable USBs from Linux
  • Ventoy – allows you to copy multiple ISOs to a single USB and boot from a menu

10.1 Install WoeUSB-ng

Easiest and perhaps most straight forward way is to install it via git and pip python.

$ git clone https://github.com/WoeUSB/WoeUSB-ng.git

$ cd WoeUSB-ng

$ sudo pip3 install .

10.2. Install Ventroy and deploy Windows installer on USB Drive

 

a) Prepare the USB Drive in Linux

b) Add the Windows ISO 

c) Install Windows ISO

1. Download it : Get the ventoy-x.x.xx-linux.tar.gz file from the Ventoy website.

2. Extract : Open a terminal and extract: tar -xvf ventoy-*.tar.gz.

3. Locate USB: Run lsblk to identify your USB drive (e.g., /dev/sdb).

4. Install: Run the script (replace /dev/sdb with your drive):

# sudo ./Ventoy2Disk.sh -i /dev/sdb

 

Once installed, the USB will have a large partition named "Ventoy".


5. Copy, paste Windows ISO file: (Windows 10 or 11) onto this USB drive. 

 

6. Insert the USB,  into the target computer.

7. Reboot PC:  and enter the BIOS/boot menu (e.g., F2, F12) to boot from the USB.

Sum it up

Creating Windows 10 installation media from Linux might seem tricky at first, but with the right approach, it’s completely manageable, it is also a nice one if you need to create multiple flash drives, and you need to automate the process of Windows installable USB drive creation for multiple windows setups that needs to get reinstalled on place simultaneously.
Once you’ve done it once, it becomes a quick and reliable process you can reuse anytime.

Whether you're a Linux enthusiast or just working across systems, this method ensures you're never stuck without a Windows installer at hand, even without owing a Windows OS.

How to make GRE tunnel iptables port redirect on Linux

Saturday, August 20th, 2011

I’ve recently had to build a Linux server with some other servers behind the router with NAT.
One of the hosts behind the Linux router was running a Window GRE encrypted tunnel service. Which had to be accessed with the Internet ip address of the server.
In order < б>to make the GRE tunnel accessible, a bit more than just adding a normal POSTROUTING DNAT rule and iptables FORWARD is necessery.

As far as I’ve read online, there is quite of a confusion on the topic of how to properly configure the GRE tunnel accessibility on Linux , thus in this very quick tiny tutorial I’ll explain how I did it.

1. Load the ip_nat_pptp and ip_conntrack_pptp kernel module

linux-router:~# modprobe ip_nat_pptp
linux-router:~# modprobe ip_conntrack_pptp

These two modules are an absolutely necessery to be loaded before the remote GRE tunnel is able to be properly accessed, I’ve seen many people complaining online that they can’t make the GRE tunnel to work and I suppose in many of the cases the reason not to be succeed is omitting to load this two kernel modules.

2. Make the ip_nat_pptp and ip_nat_pptp modules to load on system boot time

linux-router:~# echo 'ip_nat_pptp' >> /etc/modules
linux-router:~# echo 'ip_conntrack_pptp' >> /etc/modules

3. Insert necessery iptables PREROUTING rules to make the GRE tunnel traffic flow

linux-router:~# /sbin/iptables -A PREROUTING -d 111.222.223.224/32 -p tcp -m tcp --dport 1723 -j DNAT --to-destination 192.168.1.3:1723
linux-router:~# /sbin/iptables -A PREROUTING -p gre -j DNAT --to-destination 192.168.1.3

In the above example rules its necessery to substitute the 111.222.223.224 ip address withe the external internet (real IP) address of the router.

Also the IP address of 192.168.1.3 is the internal IP address of the host where the GRE host tunnel is located.

Next it’s necessery to;

4. Add iptables rule to forward tcp/ip traffic to the GRE tunnel

linux-router:~# /sbin/iptables -A FORWARD -p gre -j ACCEPT

Finally it’s necessery to make the above iptable rules to be permanent by saving the current firewall with iptables-save or add them inside the script which loads the iptables firewall host rules.
Another possible way is to add them from /etc/rc.local , though this kind of way is not recommended as rules would add only after succesful bootup after all the rest of init scripts and stuff in /etc/rc.local is loaded without errors.

Afterwards access to the GRE tunnel to the local IP 192.168.1.3 using the port 1723 and host IP 111.222.223.224 is possible.
Hope this is helpful. Cheers 😉

How to add a new MySQL user to have INSERT,UPDATE,DELETE permissions to a Database

Tuesday, October 25th, 2011

I needed to add a newly created MySQL user with no access to any database with no special permissions (user is created from phpmyadmin) with some permissions to a specific database which is used for the operation of a website, here are the MySQL CLI client commands I issued to make it work:

# mysql -u root -p
mysql> GRANT ALL ON Sql_User_DB.* TO Sql_User@localhost;
mysql> FLUSH PRIVILEGES;

Where in the Example Sql_User_DB is my example database to which the user is granted access and my sample user is Sql_User .
Note that without FLUSH PRIVILEGES; new privileges might not be active. 

To test further if all is fine login with Sql_User and try to list database tables.

$ mysql -u Sql_User -p
password:
mysql> USE Sql_User_DB;
mysql> SHOW TABLES;
...