{"id":5360,"date":"2026-08-30T16:40:35","date_gmt":"2026-08-30T07:40:35","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/wsl2-usb-mount-usbipd-iso-dd-write-2\/"},"modified":"2026-08-30T16:40:36","modified_gmt":"2026-08-30T07:40:36","slug":"wsl2-usb-mount-usbipd-iso-dd-write","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/virtualization-container-wsl\/wsl2-usb-mount-usbipd-iso-dd-write\/","title":{"rendered":"How to Physically Mount a USB Flash Drive in WSL2 and Write an ISO Image"},"content":{"rendered":"<p>When writing ISO images to removable media such as USB flash drives on a Windows OS, dedicated GUI tools are typically used. However, in cases involving devices with special partition structures or operations restricted by the OS-standard disk management tool, Linux-standard command-line tools provide more reliable and flexible operations.<\/p>\n<p>This article explains how to bypass Windows-side restrictions and directly control a USB flash drive as a physical device within the Windows Subsystem for Linux 2 (WSL2) environment.<\/p>\n<h2>Bridging WSL2 and Physical Devices<\/h2>\n<p>By default, WSL2 limits access through the Windows-side file system and cannot directly recognize physical devices connected to the USB bus. The objective of this task is to use a third-party tool to pass through the USB device to WSL2, making it directly operable from the Linux kernel as \/dev\/sdX.<\/p>\n<p>As our target, we aim to write the ISO image accurately in block units using the <code>dd<\/code> command, completing the write process while maintaining data integrity.<\/p>\n<h2>Attachment Restrictions Due to Removable Attributes<\/h2>\n<p>WSL2 includes a command called <code>wsl --mount<\/code>, but this is primarily intended for VHDs (virtual disks) and fixed disks. Running this against &#8220;removable media&#8221; like a USB flash drive causes an error such as &#8220;The specified file was not found&#8221; or &#8220;The operation is not supported&#8221; due to Windows-side exclusive control, making it impossible to attach. This OS-layer restriction acts as a barrier to native Linux disk operations.<\/p>\n<h2>Installing usbipd-win and Executing Passthrough<\/h2>\n<p>To solve this issue, we will introduce <code>usbipd-win<\/code>, which utilizes the USB\/IP protocol to transfer devices.<\/p>\n<h3>Tool Installation and Initial Setup<\/h3>\n<p>In an administrator PowerShell on Windows, run the following command to install the tool. After installation, restarting PowerShell is required to apply the settings.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:\\\\&gt; winget.exe install usbipd\n\u65e2\u5b58\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u65e2\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8...\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\n\u898b\u3064\u304b\u308a\u307e\u3057\u305f usbipd-win &#x5B;dorssel.usbipd-win] \u30d0\u30fc\u30b8\u30e7\u30f3 5.3.0\n\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u6240\u6709\u8005\u304b\u3089\u30e9\u30a4\u30bb\u30f3\u30b9\u4f9b\u4e0e\u3055\u308c\u307e\u3059\u3002\nMicrosoft \u306f\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5bfe\u3057\u3066\u8cac\u4efb\u3092\u8ca0\u308f\u305a\u3001\u30e9\u30a4\u30bb\u30f3\u30b9\u3082\u4ed8\u4e0e\u3057\u307e\u305b\u3093\u3002\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e2d https:\/\/github.com\/dorssel\/usbipd-win\/releases\/download\/v5.3.0\/usbipd-win_5.3.0_x64.msi\n\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 4.29 MB \/ 4.29 MB\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u30cf\u30c3\u30b7\u30e5\u304c\u6b63\u5e38\u306b\u691c\u8a3c\u3055\u308c\u307e\u3057\u305f\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u958b\u59cb\u3057\u3066\u3044\u307e\u3059...\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f<\/pre>\n<h3>Identifying and Binding the Device<\/h3>\n<p>With the USB flash drive connected, display the list of devices using the following command.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:\\\\&gt; usbipd.exe list\nConnected:\nBUSID VID:PID DEVICE STATE\n1-8 8087:0032 \u30a4\u30f3\u30c6\u30eb(R) \u30ef\u30a4\u30e4\u30ec\u30b9 Bluetooth(R) Not shared\n4-1 046d:c548 Logitech USB Input Device, USB \u5165\u529b\u30c7\u30d0\u30a4\u30b9 Not shared\n4-3 0781:5580 USB \u5927\u5bb9\u91cf\u8a18\u61b6\u88c5\u7f6e Not shared\n\nPersisted:\nGUID DEVICE\nxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx USB \u5927\u5bb9\u91cf\u8a18\u61b6\u88c5\u7f6e\nxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx USB \u5927\u5bb9\u91cf\u8a18\u61b6\u88c5\u7f6e<\/pre>\n<p>Check the BUSID (e.g., <code>4-3<\/code>) displayed on the left side of the target USB flash drive (e.g., SanDisk USB Device). Next, perform a &#8220;bind&#8221; operation to make that device shareable.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">usbipd.exe bind --busid 4-3<\/pre>\n<h3>Attaching to WSL2<\/h3>\n<p>With your WSL2 (Ubuntu, etc.) instance running, execute the following command to connect the device to the Linux side.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:\\\\&gt; usbipd.exe attach --busid 4-3 --wsl\nusbipd: info: Using WSL distribution &#039;Ubuntu-22.04&#039; to attach; the device will be available in all WSL 2 distributions.\nusbipd: info: Loading vhci_hcd module.\nusbipd: info: Detected networking mode &#039;nat&#039;.\nusbipd: info: Using IP address 172.xx.xx.x to reach the host.<\/pre>\n<p>This disconnects the device from the Windows side and recognizes it as a physical device on the WSL2 side.<\/p>\n<h2>Writing on the Linux Side and Safe Removal<\/h2>\n<p>Switch to the WSL2 terminal and follow the steps below to write the ISO image.<\/p>\n<h3>Confirming the Device Name<\/h3>\n<p>Run the <code>lsblk<\/code> command to check the name of the newly recognized disk. Judging by the size, it should be displayed as something like <code>\/dev\/sde<\/code>.<\/p>\n<h3>Writing via the dd Command<\/h3>\n<p>Write the ISO image using the <code>dd<\/code> command to the confirmed device name (e.g., <code>\/dev\/sde<\/code>).<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\"># if=input file, of=output device, bs=block size, status=progress display\nsudo dd if=harvester-v1.7.1-amd64.iso of=\/dev\/sdf bs=4M status=progress conv=fdatasync\n7788822528 bytes (7.8 GB, 7.3 GiB) copied, 216 s, 36.0 MB\/s\n1859+1 records in\n1859+1 records out\n7798194176 bytes (7.8 GB, 7.3 GiB) copied, 343.974 s, 22.7 MB\/s<\/pre>\n<p>After writing is complete, be sure to run the <code>sync<\/code> command to completely flush the memory cache to the physical disk.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">sync<\/pre>\n<h3>Software Detachment<\/h3>\n<p>Once the write operation is finished, return to Windows PowerShell and detach the device from WSL2 using the following command.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">PS C:\\\\&gt; usbipd.exe detach --busid 4-3<\/pre>\n<p>This operation returns the device to a safely removable state.<\/p>\n<h2>Conclusion and Practical Insights<\/h2>\n<p>By combining WSL2 and <code>usbipd-win<\/code>, you can apply powerful Linux disk manipulation tools to USB media without being bound by the logical constraints of the Windows OS. Being able to create reliable images using the standard <code>dd<\/code> command without introducing dedicated writing software is an extremely effective method for server building and system maintenance.<\/p>\n<p>This technique can certainly be called one of the most reliable choices for OS installation work on specific hardware, such as turning a Surface Pro 5 into a server.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When writing ISO images to removable media such as USB flash drives on a Windows OS, dedicated GUI tools are t [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2758,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=2755","footnotes":""},"categories":[1171],"tags":[51,52,105,1005,365,10,275],"class_list":["post-5360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtualization-container-wsl","tag-git","tag-https","tag-linux","tag-windows","tag-wsl2","tag-server","tag-275","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5360"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5360\/revisions"}],"predecessor-version":[{"id":5363,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5360\/revisions\/5363"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/2758"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}