Install Windows 10/7 without USB or DVD from Linux

I am often asked help for installing Operating System, and this is a new way I have not tried before.
Supposed you have a empty NTFS partition, say /dev/sda4, and a windows iso file, say windows.iso. And you have a GRUB boot menu.
Note: The /dev/sda4 should be larger than the size of windows.iso. This partition can be used as windows installation partition or just for bootable windows installation partition. If you use /dev/sda4 just for boot windows installation program, you need to create another empty NTFS partition for Windows system.
Installation steps:
1. Use mount -o loop windows.iso /mnt to mount windows.iso in folder /mnt, so you can access files in windows.iso;
2. Use cp -pr /mnt/* /path/to/sda4/mount/folder to copy all windows installation to a new partition;
3. Edit GRUB menu:

# Add the following to /boot/grub/grub.cfg
   menuentry "Windows 10" {
       insmod part_gpt
       insmod ntfs
       insmod search_fs_uuid
       insmod chain
       search --fs-uuid --no-floppy --set=root partition-uuid
       chainloader (${root})/efi/boot/bootx86.efi
   }

Note: The above example is for GPT partition table with UEFI boot program, if you are using MBR partition table, you should change /efi/boot/bootx86.efi to /bootmgr and change insmod part_gpt to insmod_msdos.
4. After the above steps, you should be able to see a Windows 10 boot entry in GRUB menu. Just following the installation guide as usual.
5. After installing Windows, you may be unable to see GRUB boot menu again, so you may need to fix it.
Another
Boot from Windows 7 from grub2(windows 7.iso is extracted to a partition, USB disk in this case)

    insmod part_msdos
    insmod ntfs
    insmod ntldr
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 1EA0019AA0017A13
    ntldr ($root)/bootmgr

You can get UUID using ls -l

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值