Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access was denied by the operating system (Fix found, recommending UI tweak) #663

Closed
GregariousJB opened this issue Jul 22, 2020 · 3 comments

Comments

@GregariousJB
Copy link

Image

Clicking "Format" invokes the following error:

Access was denied by the operating system

Possible cause: The operating system requires that you have read/write permission (or administrator privileges) for certain folders, files, and devices, in order for you to be allowed to read and write data to/from them. Normally, a user without administrator privileges is allowed to create, read and modify files in his or her Documents folder.

Source: volTransformThreadFunction:2757

This error happens when the folder is created manually by the user while selecting a location for the encrypted volume. In other words, creating a "C:/encrypted" folder manually and then using "C:/encrypted" in VeraCrypt will cause this error. Unbeknownst to me, the user needs to select a folder that doesn't already exist, or a file that will be overwritten.

This issue caused me to ragequit VeraCrypt a few years ago with a different, new SSD drive because of how the program process works. I decided to try it again recently, ran into the error again (after having forgotten how I did it first time, meaning I hit the same error twice doing the same thing without realizing it), but kept messing with the program and Googling to try and troubleshoot why it wasn't working. This keeps coming up in Google results but no one seems to know why it happens, and it's commonly assumed it's a drive error that might be fixed using chkdsk.

Here is the problematic VeraCrypt step:

Image

Problem 1: The "WARNING" paragraph seems to hint at this issue, but because of the line 'the file will be deleted and replaced with the newly created VeraCrypt container', it sounds like VeraCrypt won't lock up with an unrelated error message and will simply handle the folder as needed, even if the user was the one that created it. This is what I assumed, and I suspect many others judging by the above Google results.

Problem 2: The "Select File" operation is confusing to new users such as myself. Even a journalist over at howtogeek.com couldn't explain this adequately. His example used "C:/mysecretfiles", which looks like a folder name. Even the first paragraph in that Volume Location section of VeraCrypt says "A VeraCrypt volume CAN reside in a file", implying that it doesn't need to and it could also be a folder. After I clicked "Select File" and wasn't able to select my newly created folder, I simply copy/pasted the folder location into the VeraCrypt window, sealing my fate.

A few things I recommend that might be better:

  • "A VeraCrypt volume MUST reside in a file, not a folder", or including somewhere on that setup page something like "If you select a pre-existing folder, VeraCrypt will not work".
  • Something after the "Format" button is pressed, like 'The selected volume location already exists as a folder. Please select a file in the previous step.'
  • Handle the user selecting a folder by turning it into a file automatically and then VeraCrypt can continue unhindered without any user intervention or error messages (aside from the usual "This folder/file will be overwritten", probably).

Thank you.

@idrassi
Copy link
Member

idrassi commented Jul 26, 2020

Thank you for this report. There is indeed a usability issue here and I understand that can cause to users especially that the beginner's tutorial uses a file name without extension ("My Volume") .

To fix this problem, the step of "Volume Location" must check that the selected path doesn't correspond to an existing folder. Currently it doesn't do any checks.

I will implement a check in this step so that the "Next" button is disabled if the path entered correspond to an existing folder.

Also, I will modify the tutorial in the documentation in order to use a file name with the .hc extension in order to avoid any confusion about the nature of the file container.

idrassi added a commit that referenced this issue Jul 28, 2020
…d of "My Volume" for file container name in order to avoid confusion about nature of file nature for beginners who expect a file to always have an extension (cf #663) Update screenshots to reflect changes in VeraCrypt UI
@idrassi
Copy link
Member

idrassi commented Aug 3, 2020

The fix for not allowing the path to correspond to an existing folder was done in commit c9b5c10

@idrassi idrassi closed this as completed Aug 3, 2020
@James-P-Bennett
Copy link

James-P-Bennett commented Mar 19, 2023

So, I was still having this issue on Windows 11 running version 1.25.9
I circumvented the issue by creating the folder manually, selecting the target folder in the application and then deleting the target folder before proceeding with the Volume Format.

Another way to get around it is related to permissions on the drive. Here's how you can modify the permissions to potentially resolve the issue on any edition of Windows 10/11:

  1. Open File Explorer and locate your external drive (D:).

  2. Right-click the drive and select "Properties."

  3. Navigate to the "Security" tab.

  4. Click "Edit" to change permissions.

  5. In the "Group or user names" section, select your user account.

  • If you don't see your user account listed, click "Add" to add it:
  • Click "Add," then click "Advanced," and then "Find Now."
  • Select your user account from the search results, click "OK," and then click "OK" again.
  • With your user account selected, grant "Full control" by checking the "Allow" checkbox next to it.
  1. Click "Apply" and then "OK" to close the Permissions window.

  2. Click "OK" again to close the Properties window.

  3. Restart your computer and try using the application to access and modify the contents of the external drive again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants