Page 1 of 1

Veracrypt mount from shared folder

PostPosted: 29. Dec 2017, 17:41
by michburt
Hello,

since the update to Virtualbox 5.2 I cannot mount a veracrypt container from a shared folder. Also if I want to create a new one I get the same error.

Veracrypt Error Message:

Code: Select all   Expand viewCollapse view
Input-/Output error:
/dev/mapper/veracrypt1

The drive is damaged (there is a physical defect on it) or a cable is damaged, or the memory is malfunctioning.

Please note that this is a problem with your hardware, not with VeraCrypt. Therefore, please do NOT report this as a bug/problem in VeraCrypt and please do NOT ask for help with this in the VeraCrypt Forums. Please contact your computer vendor's technical support team for assistance. Thank you.

Note: If the error occurs repeatedly at the same place, it is very likely caused by a bad disk block, which should be possible to correct using third-party software (note that, in many cases, the 'chkdsk /r' command cannot correct it because it works only at the filesystem level; in some cases, the 'chkdsk' tool cannot even detect it).

VeraCrypt::File::ReadAt:306


The same was working without any problems in Linux guests (e.g. Ubuntu 17.10) with Virtualbox 5.1 and it is also still working in Windows guests with Virtualbox 5.2.
So this problem seems to be a regression in Linux Guests with Virtualbox 5.2 only.

Re: Veracrypt mount from shared folder

PostPosted: 29. Dec 2017, 20:13
by socratis
You didn't adequately specify your Host, your Guest and your VirtualBox version; there is no 5.2 version, there is 5.2.0, 5.2.2, and 5.2.4 released versions, or you could be running a test build, I don't know. It's better if you use the complete version numbers (including the build numbers) to identify software:
  • "OSX" isn't enough, "OSX 10.9.5 build 13f1911" is much better.
  • "Win10" isn't enough, "Win10 1607, build 14393.969" is much better.
  • "Ubuntu" isn't enough, "Ubuntu 16.04, 4.4.0-59-generic #80-Ubuntu SMP" is much better.
  • "The latest VirtualBox" isn't enough, "VirtualBox 5.1.22 r115126" is much better.
Keep also in mind that VirtualBox shared folders present a very simplified file system implementation, just enough to read/write files from/to the guest. Many applications can error when using shared folders, because they expect advanced features, like file locking or access controls, which don't exist for shared folders.

Re: Veracrypt mount from shared folder

PostPosted: 31. Dec 2017, 19:17
by michburt
Ok, here is the detailed version overview as requested regarding mounting or creating Veracrypt containers from shared folders:

Host System: Linux Mint 18.3 64 bit

Guest system: Windows 10 1703 64 bit:
Virtualbox 5.1.30: working
Virtualbox 5.2.4: working

Guest system: Ubuntu 17.10 64 bit:
Virtualbox 5.1.30: working
Virtualbox 5.2.4: not working (see error message from first post)

Thanks for the info regarding the limitations. But as it was working with Linux guests in 5.1.30 and it is still working in Windows guests this is probably only a small issue.

Re: Veracrypt mount from shared folder

PostPosted: 1. Jan 2018, 11:33
by socratis
Could you give me a small step-by-step set of instructions, so I can try and replicate this? For example, did you create the VeraCrypt volume in the guest or in the host? What version of Veracrypt did you use? Include any other important details/steps as well.

Re: Veracrypt mount from shared folder

PostPosted: 4. Jan 2018, 19:31
by DarthDalek
I'm running Linux Mint 18.3 on both host and guest. I'm running Veracrypt 1.21 on both host and guest. I'm running VirtualBox 5.2.2 r119230 (Qt5.6.1) on the host (and same version of guest additions on guest).

The reproductions instructions are fairly straight forward. I bumped into the problem and tried several variations on it to find out what triggered the problem. Basically, the problem occurs when the Veracrypt on the guest tries to write to a shared folder. I do not have a problem when I copied my Veracrypt file from the share onto a local virtual hard drive on the guest. I created a Veracrypt file locally within the guest without a problem. However, if I try to create (or use) a Veracrypt file in the shared folder itself, I get the error that michburt described. The Veracrypt file can be small. I reproduced it with only a 25 MB file. You can probably even go smaller.

Hope this helps you find the exact problem.

Re: Veracrypt mount from shared folder

PostPosted: 6. Jan 2018, 19:39
by saur
I've got the same problem, same errors, also occurred after upgrading.

5.2.4 r119785 (Qt5.6.2)

Windows 10 host.

Arch Linux Guest (have also tried a Debian guest and the problem remained).

Maybe Virtualbox needs to be added to a certain group?

Re: Veracrypt mount from shared folder

PostPosted: 6. Jan 2018, 20:36
by Martin
The shared folder feature is only implemented for very simple file copy actions between host and guest and lacks many advanced feature typically available in a (network) file system.
It is not designed to be used by programs. Veracrypt probably now needs some file access / locking features which are not available.

Re: Veracrypt mount from shared folder

PostPosted: 6. Jan 2018, 23:20
by saur
Could we give VeraCrypt these features e.i. add it to the __-group?

Re: Veracrypt mount from shared folder

PostPosted: 9. Jan 2018, 00:04
by Ice-9
Just wanted to add my voice to those encountering this error when attempting to mount a VeraCrypt volume from a shared folder after recent update.

Host: MacOS High Sierra Version 10.13.2
Guest: Debian 9.3 (Stretch)
VirtualBox Version 5.2.4 r119785 (Qt5.6.3)
VeraCrypt 1.21

I had been accessing VeraCrypt volumes with no problems at all since Debian Stretch came out in the Spring, and before that with a similar set up with Debian Jessie for the previous two years. The problem started after updating Debian earlier this week with the OS fix for the Meltdown issue version 4.9.65-3+deb9u2. I had to do an m-a prepare to get my guest additions working again, and then after that realized my VeraCrypt containers were no longer opening on shared folders. I can copy the container to a local directory, open it, and then copy it back to the shared folder. I simply can no longer open the container in place in the shared folder from the guest Debian like I've been doing for more than two years. Can access via Veracrypt on the Mac host on the shared folder just fine. Restoring this functionality from guest Debian would be greatly appreciated.

Can't write to encrypted USB

PostPosted: 11. Jan 2018, 19:58
by saur
Hello,

When I try to write to an encrypted USB 3 drive I get the following error.

Code: Select all   Expand viewCollapse view
Failed to create empty file "New Empty File".
Error opening file “/media/veracrypt1/New Empty File”: Permission denied.


Is this the same problem (newest Virtualbox not giving VeraCrypt low-level access) viewtopic.php?f=3&t=86050?

I can write if I run as root, but of course I wouldn't want to make that a habit. Maybe I need to give VeraCrypt write access, or something like this?

Re: Can't write to encrypted USB

PostPosted: 11. Jan 2018, 20:09
by socratis
saur wrote:Is this the same problem (newest Virtualbox not giving VeraCrypt low-level access)
Try it with a lower VirtualBox version. It seems to work with 5.1.30. Does it work with you?

I'm merging this with topic 86050, because I have the feeling that it's the same issue.

Re: Veracrypt mount from shared folder

PostPosted: 11. Feb 2018, 23:47
by radek
I have still this issue on VBox 5.2.6
Host win 7 x64 pro
Guest Ubuntu 16.04
Encrypted file is on host, veracrypt on guest access by shared folder to file,
on VBox 5.1.28 it was working well, now on VBox 5.2.6 not. :oops:

Re: Veracrypt mount from shared folder

PostPosted: 29. Jul 2018, 22:22
by wildfire
Downgrading VBox to 5.1.30 seems to have resolved for me. Does anyone know what broke in later versions? Is there a bug report for this?

Re: Veracrypt mount from shared folder

PostPosted: 22. Sep 2018, 14:12
by karlsson
VBoxGuestAdditions 5.1.38 CD working also fine with host 5.2.18. No need downgrade host software.

Re: Veracrypt mount from shared folder

PostPosted: 20. May 2019, 23:53
by phirestalker
I know this is an old thread, but this is mostly for the googlers.

I have found another possible solution to this problem. If you only need to access the veracrypt volume from the VM, then you can simply convert the raw image to a VDI or other VM disk image format. Once this is accomplished, you can add it as a drive in Virtualbox and mount it in veracrypt as a physical device.
I was able to copy many GB of files without issue between two veracrypt volumes using this trick.