Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My host is Windows 7, and VM is Ubuntu 12.04. I use it for web development and I need to make Git repo from virtual HDD visible for the host OS to edit files on the host. What is the best way to do it?

share|improve this question

2 Answers 2

Right click the virtual machine in VirtualBox and select Settings. You'll see the dialog below with a button to add a shared folder.

enter image description here

share|improve this answer
    
Thank you for your comment, but this solution doesn't preserve file permissions, because files are located at NTFS partition. I need another solution on the guest side. –  Sergey Filkin Jan 7 at 6:08
1  
In that case, you're talking about normal networking and virtualization is irrelevant. You might want to simply use Samba. –  Jo-Erlend Schinstad Jan 7 at 22:40

There are two straight forward ways to accomplish this that are independent of the virtualization software that you are using.
1. set up a samba share folder on the guest and then add it like a shared network folder on the host. 2. Share a folder on the Windows host and then use samba to open/map it on the Ubuntu guest.

Virtual box, and I believe VMWare have an option to share folders between guest and host that uses this underlying setup but is all done through the gui of the virtualization software.

To be more specific I would need to know what path you would like to take. Option 1 would best match the paradigm of guest to host.

share|improve this answer
    
Unfortunately, SAMBA share from Virtualbox's GUI doesn't preserve file permissions because all files are located at NTFS drive. If I do git diff, I get many messages about file permission changes. Thus I need some solution on the guest side. –  Sergey Filkin Jan 7 at 6:07
1  
It looks like you will have to set up a samba share on the guest then. Here is a link that covers the basic install of samba and configuration of a shared folder: help.ubuntu.com/10.04/serverguide/samba-fileserver.html watch out for this line in the instructions as ti will kill the permissions and I dontt think it is necessary $sudo chown nobody.nogroup /srv/samba/share/ –  Evan Jan 7 at 19:57
    
Evan, thank you very much! –  Sergey Filkin Jan 8 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.