Help with Shared folders

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Help with Shared folders

Post by Redgeko »

Sorry to bug but have been trying for a couple of hours to get the "guest" to be able to access folders on the "Host"

I have Win 2k as the guest, Xandros as the host. I have installed guest additions. I have gone to the folder in the Host and tried to make it sharing
I have 3 options
Mount Network Share
Windows Sharing
NFS Sharing
I did allow Windows sharing? Not sure if this is right..

I also tried this command
VBoxManage sharedfolder add "Win2K" -name "d" -hostpath "D:\spotsforsale"

Get this error
irtualBox Command Line Management Interface Version 1.3.8
(C) 2005-2007 InnoTek Systemberatung GmbH
All rights reserved.

[!] FAILED calling machine->CreateSharedFolder(Bstr(name), Bstr(hostpath)) at line 5533!
[!] Primary RC = 0x80070057
[!] Full error info present: true , basic error info present: true
[!] Result Code = 0x80070057
[!] Text = Shared folder path 'D:\spotsforsale' is not absolute
[!] Component = SharedFolder, Interface: ISharedFolder, {8b0c5f70-9139-4f97-a421-64d5e9c335d5}
[!] Callee = IMachine, {fd443ec1-0009-4f5b-9282-d72760a66916}


Win2k the name of my VB, spotsforsale is the name of the folder.
I am not good at networking anyways and have attempted everything in the instuctions. Ihave attempted more things to extenisve to type
Can anyone help make this work? and in fairly simple terms... thanks!
Corisa
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

You should read the manual about shared folders. Your mistake is to pass a windows style path as the host path. And your host is Linux.
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Post by Redgeko »

Thank you very much for replying as stated above, I spent an hour reading and re reading the manual and the chapter called "Shared Folders", and obviously don't understand the correct command, can ANYONE help me? I am an extreme nob to linux and am barely making it by in consule
Cogar
Posts: 40
Joined: 12. May 2007, 04:21

Post by Cogar »

A few points to consider:

1. When setting up the shared folder in a Linux host, forget anything to do with Windows. (Remember, guests can be Linux or Windows and have no effect on setting up the shared folder in the host.)
2. The shared folder in the host must be a regular "Linux" folder like any other directory in a Linux machine. It should not be a "Windows Sharing" folder (for example).
3. This folder should have vboxusers as the group, and vboxusers must have write access. If you do not know what these are or what they mean, google for the commands chgrp and chmod. It describes how they work and what permissions they control. Incidentally, you need to know these because Linux is not a "wide open" system that lets anyone do what they want. It is one of many reasons that Linux is not plagued by viruses and other security issues like Windows.
4. The user (the person who will be running the VirtualBox program) must be added to the group vboxusers.
5. You need to define the host path in Linux terms. Something like /home/spotsforsale is a legitimate Linux path.
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Post by Redgeko »

Thanks for the reply...
When setting up the shared folder in a Linux host, forget anything to do with Windows. (Remember, guests can be Linux or Windows and have no effect on setting up the shared folder in the host.) .
How do you acutally do this?
The shared folder in the host must be a regular "Linux" folder like any other directory in a Linux machine. It should not be a "Windows Sharing" folder (for example).
ok, how does one tell if it is a linux folder?
This folder should have vboxusers as the group, and vboxusers must have write access. If you do not know what these are or what they mean, google for the commands chgrp and chmod. It describes how they work and what permissions they control. Incidentally, you need to know these because Linux is not a "wide open"
II did not see any options when I click on a folder to have vboxusers. It just asks for anyone or a specifc user? I totoally Agree I need to know these things.... but sometimes the writers of manuals assume expert experience. That is what forums are for I hope to help explain things....

Thanks Again for any future help in getting this working! So far i do like this one better than Vitrual Server the interface seems freindly even, if the manual is hard to understand!
Corisa
Cogar
Posts: 40
Joined: 12. May 2007, 04:21

Post by Cogar »

OK. Maybe I made it appear too complicated. Although it is probably possible to do this using the GUI, I do not have a copy of Xandros handy to confirm the menu options. Therefore, I am going to tell you how to get started using the command line. :shock:

Let's say you are using Xandros and want your shared folder in your home directory, and you want to call it "spotsforsale." Before getting started, back up any files in your shared folder and then delete the folder you already created. Now, start up a terminal window, and you will have some prompt text that ends with $. Depending on the configuration of your machine, you may or may not have permission to create directories. I will assume that you do in your /home directory. Therefore, to make a directory you would enter the following:

Code: Select all

mkdir spotsforsale
The directory will be created. This is all you need for a shared folder--what I called a regular Linux folder. Now, you can list what you have with the following command:

Code: Select all

ls -l
It will list the subdirectories and files in your current directory. One of them will look something like this:

Code: Select all

drwxrwxr-x    2    your_username    your_username    64    May 21 16:01    spotsforsale/
The first letters list the permissions, the third and fourth columns list the owner and group of the directory. Now you want to change the group. You will probably need to be root for this so enter:

Code: Select all

su
It will then prompt you for a password. It is looking for the root password. It will not respond as you type, but will change from a $ to a # if you are successful.

Then you change the group:

Code: Select all

chgrp vboxusers /spotsforsale
I strongly recommend that you read up on the commands chgrp and chmod before trying this, since if you type something wrong, you need to know what to type to undo it. Further, I am composing it as though I know what you will see, but I am not at your computer and things may work differently. :) Still, that should help you get started. Using this example, you want to end up with something that looks like this:

Code: Select all

drwxrwxr-x    2    your_username    vboxusers    64    May 21 16:02    spotsforsale/
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Ok this is wierd

Post by Redgeko »

thanks so much! ok now for the weirdness...

I turned on the VM and looked in Network places, and there was a new icon...double clicked on it and all the folders that I had been trying to get to show where there,,,,however, when I click on them it asked for a user name and password...I tried the root and the user passwords with no luck..
Then I saw your post and went back and create a new folder as per your instructions....
rebooted the VM double clicked on Network Places and now that folder is gone?

Forgot to mention, the new folder that I set up is also not visible

Did I do something right or wrong?
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Post by Redgeko »

I was able to get the command line

VBoxManage sharedfolder add "Win2K" -name "1working" -hostpath "/disks/D/1working"

to be accepted via the console! So how do I get it to show in the VM?
Thanks!!

Corisa
bodhi.zazen
Volunteer
Posts: 180
Joined: 17. May 2007, 16:02

Post by bodhi.zazen »

Redgeko wrote:I was able to get the command line

VBoxManage sharedfolder add "Win2K" -name "1working" -hostpath "/disks/D/1working"

to be accepted via the console! So how do I get it to show in the VM?
Thanks!!

Corisa
Boot your windows guest

Open the command line IN THE WINDOWS GUEST

Type:

Code: Select all

net use E: \\vboxsvr\1working
If is a virtual machine, is it still broken ?
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Post by Redgeko »

Thanks!! Finally something showed up!

another question.... I was trying to add more folders and cannot get any others to show up..but if I put things inside the folder ( 1working) that is showing fine.....it pops right up....

Is this the only folder I can use in the VM? Can I add others? Also I have a Slave Drive am using on the Host, I keep all my files in here...

It is called D in host....is there any way to get this to show? Or do I have to move all the files from the Host slave drive (d) into this one folder that was made called 1working?

Thanks again for taking the time to help me!!!!!!!
Corisa
bodhi.zazen
Volunteer
Posts: 180
Joined: 17. May 2007, 16:02

Post by bodhi.zazen »

Redgeko wrote:Thanks!! Finally something showed up!
LOL
another question.... I was trying to add more folders and cannot get any others to show up..but if I put things inside the folder ( 1working) that is showing fine.....it pops right up....

Is this the only folder I can use in the VM? Can I add others? Also I have a Slave Drive am using on the Host, I keep all my files in here...

It is called D in host....is there any way to get this to show? Or do I have to move all the files from the Host slave drive (d) into this one folder that was made called 1working?

Thanks again for taking the time to help me!!!!!!!
Corisa
I have not tried, but I see no reason you can not have more then one shared folder.

You will need a new drive letter for each share, so, on you Linux host

Code: Select all

VBoxManage sharedfolder add "Win2K" -name "2working" -hostpath "/disks/D"
And then , on the Windows guest,

Code: Select all

net use F: \\vboxsvr\2working
Just make sure your "hostpath" (I used /disks/D as an example) is correct :)
If is a virtual machine, is it still broken ?
Redgeko
Posts: 10
Joined: 20. May 2007, 05:30

Post by Redgeko »

SOLVED! Thanks I finally figured it out! Used the following code and got my slave to show up! Hurray! thanks for the help

VBoxManage sharedfolder add "Win2K" -name "D" -hostpath "/disks/D"
net use F: \\vboxsvr\D
blowhorn
Posts: 3
Joined: 4. Jun 2007, 10:53

Post by blowhorn »

it would be useful if you had a note about linux hosts ;)
and it doesn't explain what's -hostpath and its value in the manual.
bodhi.zazen
Volunteer
Posts: 180
Joined: 17. May 2007, 16:02

Post by bodhi.zazen »

blowhorn wrote:it would be useful if you had a note about linux hosts ;)
and it doesn't explain what's -hostpath and its value in the manual.
It is the same for Linux hosts.

Code: Select all

VBoxManage sharedfolder add "Name of guest"-name "Name of share" -hostpath "path"
Example :
VBoxManage sharedfolder add "Windows XP" -name "Share" -hostpath "/home/blowhorn/VboxSharedDirectory"
You need to install the additions in each GUEST (not host)

You then mount in the windows guest with :

Code: Select all

net use E: \\vboxsvr\Share
And a Linux Guest with :

Code: Select all

sudo mkdir /media/MySharedFolder
sudo mount -t vboxsf Share /media/MySharedFolder
* The exact command is distro dependent. If your Linux guest does not use sudo :

Code: Select all

su
mkdir /media/MySharedFolder
mount -t vboxsf Share /media/MySharedFolder
If is a virtual machine, is it still broken ?
edgar_ali
Posts: 13
Joined: 26. May 2008, 19:00

Sharing Ubuntu virtual Box

Post by edgar_ali »

I am having a similar proble of the above...only that my error is:

VirtualBox Command Line Management Interface Version 1.6.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling aVirtualBox->FindMachine(Bstr(argv[1]), machine.asOutParam()) at line 7155!
[!] Primary RC = 0x80070057
[!] Full error info present: true , basic error info present: true
[!] Result Code = 0x80070057
[!] Text = Could not find a registered machine named 'Windows'
[!] Component = VirtualBox, Interface: IVirtualBox, {2d3b9ea7-25f5-4f07-a8e1-7dd7e0dcf667}
[!] Callee = IVirtualBox, {2d3b9ea7-25f5-4f07-a8e1-7dd7e0dcf667}


My virtual machine says its name is "Windows"... why VBOX says it can not find a machine with that name???

Where can i get the real name of my machine?...what commands shoul i type in the terminal to fix this problem???
Post Reply