Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano deploy in Virtual Machne

I using Virtual box + gem Vagrant
One week before everything works well.
I had packaged my box. And now I've deployed the box again with the same project.

and Capistrano has outputted error:

*** [err :: 33.33.33.10] creating symbolic link `/vagrant/demoapp/current/log'
*** [err :: 33.33.33.10] : Read-only file system

https://gist.github.com/1746250 (error + deploy.rb)

I have set sudo chmod 777 -R 1vagrant/
But it still doestn't work.

What happen?

like image 235
itsnikolay Avatar asked Dec 27 '22 06:12

itsnikolay


2 Answers

There is a workaround to make symlinks in shared folders work on VirtualBox 4.1.8+ again. Basically you need to issue this command:

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

You can do this in the context of Vagrant by adding this to the Vagrant::Config.run block of your Vagrantfile:

config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME", "1"]

More information can be found on VirtualBox bug #10085.

Please note the commenter that shares the setextradata trick forgets to tell you the key name requires the SHARE_NAME. I found this out digging through the C code!

like image 61
schisamo Avatar answered Jan 10 '23 00:01

schisamo


Official answer of Vagrant gem's author:

The VirtualBox shared folder filesystem doesn't allow symlinks, unfortunately.

Your only option is to deploy outside of the shared folders.

https://github.com/mitchellh/vagrant/issues/713

like image 41
itsnikolay Avatar answered Jan 09 '23 23:01

itsnikolay