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

Benjamim C.S 5 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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,030 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,984 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Benjamim C.S 5 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.


  2. Neuvi Jiang 465 Reputation points Microsoft Vendor
    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