Veracrypt fails to mount any container

Getting an erorr when trying to mount VeraCrypt file containers. Most of the times the error reads Not enough data available.

Few times veracrypt returned Broken pipe VeraCrypt::File::Write:340

What I’ve tried:

  1. Reinstalling veracrypt
  2. Installing veracrypt-git
  3. Launching veracrypt with sudo
  4. Logging in as root and launching veracrypt
  5. Mounting file container in CLI
  6. Creating NEW file container and trying to mount it
  7. Rebooting the system

The only relevant post on the Internet with similar issue is dated 2017 and suggests that running veracrypt as root fixes the issue. It did not.

While trying to mount the container in CLI, the following error is shown

/usr/include/c++/12.1.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = char; _Alloc = std::allocator; reference = char&; size_type = long unsigned int]: Assertion ‘__n < this->size()’ failed.

System Details:

Kernel: 5.18.16-1-MANJARO
Branch: testing
DE: GNOME 42.3.1
Session type: wayland
Shell: zsh 5.9
Veracrypt version 1.25.9-3

All packages are up-to-date

Any ideas why would that happen and how to mount veracrypt file containers without the veracrypt itself? Is there a cryptsetup option for that?

Sure, just look at the manpage, specifically
https://man.archlinux.org/man/cryptsetup.8.en#TCRYPT_(TRUECRYPT_AND_VERACRYPT_COMPATIBLE)_EXTENSION
and
https://man.archlinux.org/man/cryptsetup-open.8.en#TrueCrypt_and_VeraCrypt

1 Like

Managed to mount veracrypt file container through cryptsetup using sudo cryptsetup open --type tcrypt --veracrypt ~/file/path veracrypt. The container shows up as loopback device with unknown content.

Mission failed successfully? The file container is known to be fully working. Any other suggestions?

While troubleshooting another issue, had to use xhost si:localuser:root. Veracrypt still fails to mount any file containers while running as user. Running veracrypt as root seems to work now.

I can’t find any mention of the --veracrypt part of that command in the cryptsetup manual page.
Perhaps it’s just:
sudo cryptsetup open --type tcrypt ~/file/path veracrypt
?

Forgot to mention that I did try it without --veryacrypt switch. The result is the same.

I’ve found --veracrypt in the arch wiki:

To mount a VeraCrypt cointainer, you must use the --veracrypt option alongside --type tcrypt

Typically, the opened container would show up under /dev/mapper/xyz
/dev/mapper/veracrypt here, probably
not in the loop device
Have you looked there?

Thanks, was able to mount the container through cryptsetup. The device was indeed in /dev/mapper/

Just letting everyone know that Veracrypt still fails to mount any container as user with the same error

Mounting containers after launching Veracrypt with sudo works ONLY AFTER setting xhost si:localuser:root

While mounting as root, veracrypt keeps spamming to stdout
(veracrypt:497552): dconf-WARNING **: 15:30:41.416: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=0656786ec708423786c0c707c178f4fd --binary-syntax --close-stderr”: Child process exited with code 1

I can only refer you to the same Arch wiki, section 8.

Off-topic:

There is the simple alternative of Veracrypt: SiriKali supports many different encryption algorithms for encrypted folders. Any volume size is flexible.

Fully updated system, with the latest stable and/or LTS kernel?

Any package/dependency conflicts?

Any straggler AUR orphaned packages?

Does this issue occur in a KDE environment? X11? (I see you’re using GNOME + wayland.)

Testing branch on latest stable non-LTS kernel 6.0.9, fully updated.

No conflicts in packages and dependencies.

Orphaned AUR Packages: acetoneiso2

Haven’t tried either X11 or KDE. Might give it a try later

I have been using veracrypt on Manjaro for years without problems. At least it’s not a general problem. It’s something with your configuration it seems.

1 Like

So I’ve tried running veracrypt on GNOME X11 session and KDE X11 session.
I’ve also tried creating new user and running veracrypt under GNOME X11 and GNOME Wayland.

The terminal still outputs to stdout

/usr/include/c++/12.1.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = char; _Alloc = std::allocator; reference = char&; size_type = long unsigned int]: Assertion ‘__n < this->size()’ failed.

and Broken pipe VeraCrypt::File::Write:340 error appears on the screen

Since the error points to /usr/include/c++ where gcc package is installed, I’ve also tried reinstalling the gcc package with issue still happening.

I can provide strace output if thats any good

I’m starting to think this is due to an orphaned package and/or something from the AUR.

Can you launch a live ISO session from the latest Manjaro ISO, then install and run VeraCrypt from within the live session?

Wait, you’re still on an EOL kernel?

:flushed:

I can’t believe I missed that the first time.

Update your system, and switch to either the latest stable kernel (6.0) or the latest LTS kernel (5.15).


EDIT: Time-travel shenanigans abound!

That was in August, now they mentioned that it is Kernel 6.0

Exactly, im using Veracrypt on the KDE Desktop with the GUI and the only problem that i have that the GUI Showed a assertion bug when i click on: Select Device.
I can still ignore this error and keep going on, everything else works as intended.

But on the other side, im not using this container files in Veracrypt.

No. Impossible. The only logical explanation is time-travel. I have perfect reading comprehension. I never make mistakes.


@nastyagrifon Did you try this yet?