windowsFromLinux.md (1694B)
1 # Windows Install from Linux 2 3 https://serverfault.com/questions/1191017/how-to-make-windows-10-11-usb-flash-install-media-from-linux/1191018#1191018 4 5 https://nixaid.com/archive/article/bootable-usb-windows-linux?era=ghost 6 7 How to make a USB drive with a Windows ISO, that can install Windows, from a Linux system. You can use WoeUSB or Ventoy but this is the lower-level, fewer-dependancies way of doing it 8 9 Note that while this works to get a bootable USB, often the USB can't see my drives and asks for extra drivers. This seems to be a problem with Windows USBs made from Linux, so it's still best to make them from Windows where possible. 10 11 ## Partition Setup 12 13 `sudo fdisk /dev/<drive>` 14 15 ``` 16 o 17 w 18 ``` 19 20 `sudo fdisk /dev/<drive>` 21 22 ``` 23 n 24 p 25 1 26 <enter> 27 +1G 28 n 29 p 30 2 31 <enter> 32 <enter> 33 w 34 ``` 35 36 `sudo mkfs.fat -F32 -n "BOOT" /dev/<drive>` 37 `sudo mkfs.ntfs -Q -L "INSTALL" /dev/<drive>` 38 39 ## Mount ISO 40 41 `sudo modprobe loop` 42 `mkdir isomount` 43 `sudo mount windows.iso isomount/` 44 45 https://askubuntu.com/questions/634501/cant-mount-iso-file-as-loop-device-error-failed-to-setup-loop-device 46 47 ## BOOT Partition 48 49 `sudo mount -o rw,users,umask=000 /dev/<drive>1 usbmount/` 50 51 Copy all but `sources/` 52 53 `cp -r isomount/boot isomount/efi isomount/support isomount/autorun.inf isomount/bootmgfw.efi isomount/bootmgr isomount/bootmgr.efi isomount/__chunk_data isomount/setup.exe usbmount/` 54 55 Then copy only `boot.wim` from `sources/` 56 57 `mkdir usbmount/sources` 58 `cp isomount/sources/boot.wim usbmount/sources` 59 60 `sudo umount usbmount/` 61 62 ## INSTALL Partition 63 64 `sudo mount /dev/<drive>2 usbmount/` 65 `cp isomount/* usbmount/` 66 `sudo umount usbmount/` 67 68 `sudo umount isomount/` 69 70 `sync` 71 72 `udisksctl power-off -b /dev/<drive>`