I am running Ubuntu 21.04 on VirtualBox, and I have set up a shared folder to my Windows 10 host machine. I have set this folder to be writable, permanent and auto-mounted.
The folder works fine in most cases. I have added myself to the vboxsf group within the guest VM, and I can amend files within the new directory, create new files etc., and these changes are saved on both machines.
However, I am running into an issue with trying to run a terraform plan. This is definitely due to the shared folder setup, as when I clone the relevant repo and run the exact same command in a directory local to the VM it works fine.
The command I am running is:
bin/terraform.sh -c main_vpc -e $SCAFFOLD_ENV -r $SCAFFOLD_REGION -p $SCAFFOLD_PROJECT -a plan
(the environment variables used here are definitely correct).
The output I am getting when trying to run within the shared folder (with sensitive info anonymised) is:
<installed terraform before this>
Installation of terraform v0.11.3 successful. To make this your default version, run 'tfenv use 0.11.3'
Setting up S3 remote state from s3://*********.tfstate
Initializing modules...
- module.vpc
Getting source "../../modules/vpc"
Error downloading modules: Error loading modules: error downloading 'file:///media/sf_repos/terraformscaffold/modules/vpc': symlink /media/sf_repos/terraformscaffold/modules/vpc .terraform/modules/2e7b10981a760a8b10620993999c2: operation not permitted
ERROR: Terraform init failed
/media/sf_repos is the shared directory on the guest OS. I should mention that the related folder on the host machine has also got a symlink directory in WSL2, which is installed on the Windows 10 host and which I also use alongside VirtualBox on occasion. So this folder is referenced across 3 OS' - Windows 10, WSL2, and Ubuntu on VirtualBox. This has worked fine until the above example. Any advice on what could be causing the error would be much appreciated.
Edit: I have also followed the instructions here and manually enabled symlinks, and am running VirtualBox as an administrator, but I am still seeing the same error.