WSL2 移動至其它硬碟 Posted on 2023-05-05 Edited on 2026-04-29 In Linux Word count in article: 159 Reading time ≈ 1 mins. 列出已安裝的 Linux 發行版 執行下方命令 1wsl -l -v 遷移 WSL2 至磁碟機 D 1234567891011121314151617# 導出已安裝的 Linux 發行版壓縮檔wsl --export "Ubuntu-22.04" d:\ubuntu.tar# 移除 WSLwsl --unregister "Ubuntu-22.04"# 建立解壓縮的目錄mkdir d:\Ubuntu# Linux 發行版壓縮檔解壓縮至新目錄後加入 WSLwsl --import "Ubuntu-22.04" d:\ubuntu d:\ubuntu.tar# 刪除 Linux 發行版壓縮檔del d:\ubuntu.tar# 因重新建立 WSL 會以 root 為預設帳戶,需重新設定預設帳戶ubuntu2204.exe config --default-user ubuntu 📜 參考資料 匯入任何要與 WSL 搭配使用的 Linux 發行版本