Error code: Wsl/Service/CreateInstance/MountVhd/HCS/E_ACCESSDENIEDntVhd/HCS/E_ACCESSDENIED

Benjamim C.S 35 Reputation points
2024-06-17T01:54:51.4933333+00:00

I'm trying to run wsl after importing my Ubuntu's virtual disk (wsl --import-in-place) from my other drive but i'm getting this error:

PS> wsl
Failed to attach disk 'J:\WSL\System\Ubuntu-22.04-***\ext4.vhdx' to WSL2: Access is denied.
Error code: Wsl/Service/CreateInstance/MountVhd/HCS/E_ACCESSDENIED
  • I'm using Windows 10 Pro.
  • Not working with Administrator permissions
  • ext4.vhdx permissions: Modify, Read & Execute, Read, Write
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Benjamim C.S 35 Reputation points
    2024-06-18T20:30:51.11+00:00

    After sady days away from my GNU/Linux i found this Issue on WSL's repo. Not surprisingly was something related with the ownership of the ext4.vhdx file which was set to another user, probably my old user from the previous Windows i had, the one i formated (forgot about that in the description, sorry).

    So just change the owner to your current user:

    Right Click > Properities > Security > Advanced > Change Owner

    Thanks to this guy. I'll close the question.

    3 people found this answer helpful.

  2. Neuvi Jiang 1,540 Reputation points Microsoft External Staff
    2024-06-19T07:39:30.9066667+00:00

    Hi Benjamim C.S,

    Thank you for posting in the Q&A Forums.

    I'm glad you've resolved the problem you encountered, and you can still come to the forums for advice if the problem resurfaces in the future. Have a great day.

    Best regards

    NeuviJ

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.