1
0

bluestacksの.vhd(x)ファイルをマウントする

Last updated at Posted at 2023-11-28

概要

大した内容ではないです
windowsのGUI上でできるマウントの機能ではできなかったのと、調べ方が悪くて変に時間を取ったのでメモ

やり方

  1. WSL上にマウントする方法
    この方法だとMicrosoft Storeから入手したWSLである必要があるみたいです1

    wsl --mount /path/to/vhdfile --name android --vhd --partition 1
    

  2. Windows上にmountする方法(wslを使わない方法)
    まず以下をPowerShellで実行します
    bing aiに書いてもらっただけなのでスクリプトの内容は理解してないです

    $vhdxPath = "\path\to\vhdfile"
    $driveLetter = "X"
    
    Mount-DiskImage -ImagePath $vhdxPath
    $disk = (Get-DiskImage -ImagePath $vhdxPath | Get-Disk)
    $partition = ($disk | Get-Partition | Where-Object PartitionNumber -eq 1)
    $partition | Set-Partition -NewDriveLetter $driveLetter
    

    マウントしてもwindowsはext4のファイルシステムを扱えないので、そのままでは中身を見れません
    ext2fsdなどを使う必要がありますが、ここではやり方は省略します

その他

Mount-VHDを使ってマウントする方法もあるみたいですが、こちらはwindows homeでは対応していないみたいです
Windows 11 Homeであれば非公式(?)でインストールする方法はあるみたいです
https://qiita.com/masatonasou/items/7c5ca7be6f6b519f3d4b

  1. https://qiita.com/tamanobi/items/2883b8fbcee84a17a462

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0