I am trying to create a LUKS encrypted file in a VirtualBox image. It works fine unless the encrypted file resides in a VirtualBox shared folder.The error output is:10+0 records in10+0 records out10485760 bytes (10 MB) copied, 0.945147 s, 11.1 MB/sWARNING!========This will overwrite data on test.tomb irrevocably.Are you sure? (Type uppercase yes): YESEnter passphrase: Verify passphrase: Enter passphrase for test.tomb: mke2fs 1.42.12 (29-Aug-2014)Creating filesystem with 8192 1k blocks and 2048 inodesAllocating group tables: done                            Writing inode tables: done                            Creating journal (1024 blocks): doneWriting superblocks and filesystem accounting information: donemount: /dev/mapper/tomb is write-protected, mounting read-onlymount: wrong fs type, bad option, bad superblock on /dev/mapper/tomb,       missing codepage or helper program, or other error       In some cases useful info is found in syslog - try       dmesg | tail or so.It is easily reproducible in Vagrant.Vagrantfile:# -*- mode: ruby -*-# vi: set ft=ruby :Vagrant.configure(2) do |config|  config.vm.box = debian/jessie64  config.vm.synced_folder 'tombs', '/tombs'  config.vm.provision shell, inline: <<-SHELL    apt-get update    apt-get install -y cryptsetup    mkdir -p /media/tomb    cat > /test.sh <<-EOF#!/bin/bashcd \$1dd if=/dev/urandom of=test.tomb bs=1M count=10cryptsetup -y luksFormat test.tombcryptsetup luksOpen test.tomb tombmkfs.ext4 -j /dev/mapper/tombmount /dev/mapper/tomb /media/tombls /media/tombumount /media/tombcryptsetup luksClose tombEOF  SHELLendSetup Vagrant:mkdir tombsvagrant plugin install vagrant-vbguestvagrant upvagrant sshTest it:sudo su -bash /test.sh /root  # works finebash /test.sh /tombs # does not workmount | grep tombs shows:tombs on /tombs type vboxsf (rw,nodev,relatime)dmesg shows:[  267.574832] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)Is this a known restriction when the LUKS file is in a shared folder? If not, what could I be doing wrong?
How to create a LUKS encrypted file in a vboxsf mountpoint?
virtualbox;luks