Sharing Folder Question - Windows 7 Host - CentOS 6.3 Guest

Discussions related to using VirtualBox on Windows hosts.
Post Reply
esend7881
Posts: 4
Joined: 28. Jul 2012, 02:28

Sharing Folder Question - Windows 7 Host - CentOS 6.3 Guest

Post by esend7881 »

I am running the latest version of VirtualBox on a Windows 7 Pro Host with CentOS 6.3 as the guest. I have installed the Guest Addons and I am able to share a folder between the Host and Guest, but there is a problem.

The files on the shared folder are protected and given a usergroup of vboxsf and I am unable to edit them. Further, I am actually trying to symlink my shared folder to my /opt/lampp/htdocs folder so I can view it as a web page, but the permissions won't allow me to view the files in a web browser.

How can I make the files in my shared folder have Read/Write access across my GuesOS (at least the root account and whatever account is used to see web pages)?

Here is my end goal:
1- Create a virtual linux web server with VirtualBox + CentOS
2- On my Host PC, edit my PHP & HTML files with eclipse in a workspace directory that is shared with my Guest OS
3- Symlink that shared folder to a spot in my /opt/lampp/htdocs folder
4- Be able to view my progress on any computer in my LAN with http://192.168.1.X/MyPage

I have done #1 and #4, partial #2 and #3. I just can't set the permissions right.

Oh, and chmod doesn't do anything. Even tried 777. It doesn't edit the files or folders at all... It stays at 755 (I believe its 755) As an aside, at my work computer where I use VMWare Player, each file has 777 on them. Appreciate any help!

EDIT:
Here is what the ll of the the file looks like:
-rwxrwx---. 1 root vboxsf 9 Aug 12 00:22 index.html
And here is the error I get when trying to view that in the browser:
Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

192.168.1.107
Mon 13 Aug 2012 07:02:33 PM PDT
Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1
esend7881
Posts: 4
Joined: 28. Jul 2012, 02:28

Re: Sharing Folder Question - Windows 7 Host - CentOS 6.3 Gu

Post by esend7881 »

Solved it!

The virtualbox method was going about it all wrong.

What I had to do what

1 - Set up samba with the following command yum install samba samba-common samba-client
-- Note, the required me to update the file /etc/yum.repos.d/dropbox.repo and take the word $release and replace it with the number 13 (searched online for it. if you have the problem of the yum not working, try googling and you may see it. I think this issue was specific to CentOS
2 - On windows, share the wanted folder
3 - Type in this command: mount -t cifs //192.168.1.222/PHPWorkspace /media/PHPMount/ -o user=Eric

That last step tripped me up, I had to supply my username to the windows share. Anyway, doing all that now gives me a share that I was able to symlink to my htdocs folder and view the pages just fine on my web browser! Thank you google, I think I went through 50 different pages before finding the right combination of commands to get this going! Funny how simple it turns out...
Post Reply