[Cialug] tips for sharing files inside a VM

Matthew Nuzum newz at bearfruit.org
Thu Mar 10 17:41:42 CST 2011


I gave NFS a try, it works. Need to tweak the permission settings now but
this will do and I can script it along with starting and stopping of the VM.
Thanks for the help.

By the way, VBoxManage is a fun little command line app for controlling
Virtual Box VMs.

# launch the VM headless mode (so no window pops up)
VBoxManage startvm --type headless "Drupal Dev Server"
# grab the IP address of the server
VBoxManage guestproperty get "Drupal Dev Server"
"/VirtualBox/GuestInfo/Net/0/V4/IP"
# shut it down
VBoxManage controlvm "Drupal Dev Server" poweroff

There is even a way to do two-way communication, though I haven't tried it
yet. I think that would be good for updating the permissions for the nfs
share to only allow the host to access it.

With the above I can launch the VM, grap the IP, mount the nfs server,
update /etc/hosts if I want and when I'm ready, shut down the VM again.

On Thu, Mar 10, 2011 at 12:08 PM, Josh More
<MoreJ at alliancetechnologies.net>wrote:

>  I agree with Dave.  Use NFS and just export two filesystems.
>
> -Josh
>
>
>
>
> -----Original Message-----
> From: Matthew Nuzum [newz at bearfruit.org]
> Received: Thursday, 10 Mar 2011, 11:44
> To: Central Iowa Linux Users Group [cialug at cialug.org]
> Subject: Re: [Cialug] tips for sharing files inside a VM
>
>
>
>  On Thu, Mar 10, 2011 at 11:40 AM, David Champion <dchamp1337 at gmail.com>wrote:
>
>> I'm confused as to why you need a symlink?
>>
>> Host: create a share, i.e. /share, share it with nfs or samba or
>> whatever...
>>
>> VM: mount the share in /mnt/share, or /home/matthew/share or
>> /var/www/mysite.
>>
>>
>  My folder structure lays out like this, roughly:
>
>  /srv/file-uploads/
> /srv/code-branch/ (this is the mounted filesystem)
> /srv/code-branch/file-uploads/ -> link to /srv/file-uploads/
>
>  Maybe I'm barking up the wrong tree here and need to just get less
> complex. It just seemed like such a good solution until I bumped into the
> error creating the symlink.
>
> --
> Matthew Nuzum
> newz2000 on freenode, skype, linkedin, identi.ca and twitter
>
> "An investment in knowledge pays the best interest." -Benjamin Franklin
>
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
>


-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin, identi.ca and twitter

"An investment in knowledge pays the best interest." -Benjamin Franklin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cialug.org/pipermail/cialug/attachments/20110310/5074e53d/attachment.html>


More information about the Cialug mailing list