• 在linux系统中使用WoeUSB工具制作U盘启动盘


    用WoeUSB在Linux上制作Win10启动盘

    工作中有时需要配置Windows的开发/测试环境,那么如何用Linux制作Win10启动盘呢?
    可以使用WoeUSB工具,这款工具是纯python开发的,可以安装在python虚拟环境里。制作U盘的过程可以是图形化也可以是命令行。
    所以非常方便

    安装WoeUSB

    这里我们需要用到的是一个叫WoeUSB的软件,有两种方式安装:

    复制代码
    #pre-install
    sudo apt-get install git p7zip-full python3-pip python3-wxgtk4.0 
    
    
    # install by pip3
    sudo pip3 install WoeUSB-ng  -i https://pypi.mirrors.ustc.edu.cn/simple/
    
    # install by source code
    git clone https://github.com/WoeUSB/WoeUSB-ng.git
    cd WoeUSB-ng
    sudo pip3 install .
    复制代码
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    制作U盘启动盘

    安装完成之后,可以选择UI方式安装,也可以选择command line的方式。

    By UI

    在Ubuntu的桌面上找到WoeUSB的图标

    后面的就比较傻瓜了,插好U盘,在UI里选择Windows的ISO文件,选择NTFS模式,选择好目标设备(也就是你插入的U盘),点击Install就可以了。

    # By Command line
    woeusb --device <Your_Win10_iso_path> <Your_USB_Strorage_Path_Default_/dev/sdb> --target-filesystem NTFS
    
    • 1
    • 2

    比如我想在Debian系统(Linux系统的一种)中制作windows server 2019的启动盘,使用如下命令

    woeusb --device /resources/ISO/cn_windows_server_2019_x64_dvd_4de40f33.iso /dev/sdb --target-filesystem NTFS
    
    • 1

    记录一下我的命令行返回:

    root@server001:~/WoeUSB-ng# woeusb --device /resources/ISO/cn_windows_server_2019_x64_dvd_4de40f33.iso /dev/sdb --target-filesystem NTFS
    WoeUSB v0.2.10
    ==============================
    Mounting source filesystem...
    Wiping all existing partition table and filesystem signatures in /dev/sdb
    /dev/sdb: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
    /dev/sdb: calling ioctl to re-read partition table: 成功
    Ensure that /dev/sdb is really wiped...
    Creating new partition table on /dev/sdb...
    Creating target partition...
    Making system realize that partition table has changed...
    Wait 3 seconds for block device nodes to populate...
    Cluster size has been automatically set to 4096 bytes.
    Creating NTFS volume structures.
    mkntfs completed successfully. Have a nice day.
    Mounting target filesystem...
    Copying files from source media...
    /bootmgr
    /boot/boot.sdi                        
    /boot/fonts/chs_boot.ttf            
    /boot/fonts/cht_boot.ttf            
    /boot/fonts/kor_boot.ttf             
    /boot/resources/bootres.dll          
    /efi/microsoft/boot/cdboot_noprompt.efi
    /efi/microsoft/boot/memtest.efi      
    /efi/microsoft/boot/fonts/chs_boot.ttf
    /efi/microsoft/boot/fonts/cht_boot.ttf
    /efi/microsoft/boot/fonts/kor_boot.ttf
    /sources/acmigration.dll             
    /sources/appraiser.dll               
    /sources/background_svr.bmp          
    /sources/boot.wim                    
    /sources/diagtrack.dll                
    /sources/gatherosstate.exe            
    /sources/install.wim                  
    /sources/mediasetupuimgr.dll           
    /sources/migapp.xml                 
    /sources/migcore.dll                
    /sources/migstore.dll               
    /sources/reagent.dll                
    /sources/setuphost.exe              
    /sources/setupplatform.dll          
    /sources/setupprep.exe              
    /sources/sflistrs1.dat              
    /sources/sflistw7.dat               
    /sources/sflistwb.dat               
    /sources/sflistwt.dat               
    /sources/sflistwt.woa.dat           
    /sources/spwizimg.dll               
    /sources/upgradeagent.dll           
    /sources/w32uires.dll               
    /sources/windlp.dll                 
    /sources/wpx.dll                    
    /sources/dlmanifests/printing-spooler-core-dl.man
    /sources/dlmanifests/microsoft-windows-iis-dl/iismig.dll
    /sources/migration/wtr/powershell_en-us_noloc.inf
    /sources/replacementmanifests/onecore_speechcommon-rep.man
    /sources/replacementmanifests/microsoft-windows-appmanagement-migration/appmanmigrationplugin.dll
    /sources/replacementmanifests/microsoft-windows-textservicesframework-migration/imjpmig.dll
    /sources/sxs/microsoft-windows-netfx3-ondemand-package~31bf3856ad364e35~amd64~~.cab
    /sources/zh-cn/setup_help_upgrade_or_custom.rtf
    /support/adprep/dca8f425-baae-47cd-b424-e3f6c76ed08b.dcpromo.csv
    Copied 4.7GiB from a total of 4.7GiB
    /support/samples/headlessunattend.xml
    Copied 4.7GiB from a total of 4.7GiBased with EFI support, applying workaround to make it support UEFI booting
    100%
    INFO: Detected existing EFI bootloader, workaround skipped.
    Installing GRUB bootloader for legacy PC booting support...
    正在为 i386-pc 平台进行安装。
    安装完成。没有报告错误。
    Installing custom GRUB config for legacy PC booting...
    Unmounting and removing /media/woeusb_source_1662701347_3445...
    Unmounting and removing /media/woeusb_target_1662701347_3445...
    You may now safely detach the target device
    Done :)
    The target device should be bootable now
    root@server001:~/WoeUSB-ng# 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77

    附录:常见问题

    如果报错:Target device is currently busy, unmount all mounted partitions in target device then try again.

    则需要unmount掉U盘已经挂载的分区,比如

    umount /dev/sdb1
    如果出现Remote end closed connection without response
    说明USB接口不稳定,U盘与电脑连接断了,重新制作一下。

  • 相关阅读:
    【CMU15-445数据库】bustub 项目介绍及环境配置
    SpringBoot 40 个常用注解:让生产力爆表!(荣耀典藏版)
    微信小程序
    LINUX进程如何管理控制(二)
    flutter 开发应用 上架到 testFlight 闪退崩溃
    【FAQ】【Push Kit】 华为怎么设置角标
    编译cef114.2 with h264
    移植BusyBox根文件系统到野火开发板
    Winform开发中使用下拉列表展示字典数据的几种方式
    锐捷OSPF基础实验配置
  • 原文地址:https://blog.csdn.net/qq_43626147/article/details/126781116