Sharing drives or folders

Discussions about using Linux guests in VirtualBox.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

In the guests terminal.

Code: Select all

sudo apt-get --purge remove virtualbox-ose
You may need to reinstall the guest additions.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

(1) I uninstalled:

Code: Select all

$ sudo apt-get --purge remove virtualbox-ose
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package virtualbox-ose is not installed, so not removed
The following package was automatically installed and is no longer required:
  libvncserver0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
(2) Reinstalled Guest Additions.
(3) Mounting did not work (both auto and manual):

Code: Select all

$ sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Documents /mnt/documents
/sbin/mount.vboxsf: mounting failed with the error: No such device
(4) Reinstalled VBox Software
(5) Reinstalled Extension Pack
(6) Mounting still does not work (both auto and manual):

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Documents /mnt/documents
/sbin/mount.vboxsf: mounting failed with the error: No such device
How can I fix this? Thx
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

does /mnt/documents exist? Remember Linux is case sensitive too.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

yes it does:
Attachments
New Picture.jpg
New Picture.jpg (121.42 KiB) Viewed 5280 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

From the hosts terminal/command window type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use "" if the name has a space in it.

Note if the host is Windows you need to be in the directory that has VBoxManage.exe for the command to work.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

When I created the VM in the GUI of the VB Software, I chose "Ubuntu 10.10 64bit" as a name. This is what it shows under "Name" of the "General" tab right after startup of the VB Software. Is that the name I have to put in the command line, because when I do:

Code: Select all

VBoxManage showvminfo <"Ubuntu 10.10 64bit"> --details
from windows in the directory where the VBoxManage.exe is located at, I get

Code: Select all

The system cannot find the file specified.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Take the < > off. This is standard notation of a content and is not to be actually used.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

output is attached
Attachments
out.txt
(3.54 KiB) Downloaded 123 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Your share name is documents

Code: Select all

Name: 'documents', Host path: 'C:\Users\Andreas\Documents' (machine mapping), writable
But you are using Documents

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Documents /mnt/documents
As I said Linux is case sensitive
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

my share name in windows is Documents. the folder name in Linux is /mnt/documents. With the mnt command, I have specified that the Windows "Documents" folder should be shared under the Linux "/mnt/documents" folder. I tried any combination of capital and small letters. Same result.

Anyhow, I have renamed the folder to /mnt/Documents and did

Code: Select all

andreas@Ubuntu-VirtualBox:/$ sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Documents /mnt/Documents
/sbin/mount.vboxsf: mounting failed with the error: No such device
Same error. There is something else going on.

In your opinion, how should the command look now?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 documents /mnt/documents
What is going on is you are lacking in Linux experience IMHO (Not a problem but you need to listen). Plus I guess there must be some kind of language barrier as I showed you the error in my last post but you fail to see it.

This is what your vm has in the settings. I have made bold the share name and left it out of code blocks so you can actually see it.

Name: 'documents', Host path: 'C:\Users\Andreas\Documents' (machine mapping), writable
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Code: Select all

$ sudo mount -t vboxsf -o rw,uid=1000,gid=1000 documents /mnt/documents
/sbin/mount.vboxsf: mounting failed with the error: No such device
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Only thing that I have left is the guest must be borked with all the changes. Installing VBox program in the guest and everything else that you have done.
Here are the prerequisites for a new guest and the shared folders.

(1) Install all packages needed to be able to build external kernel modules in the guest
sudo apt-get install dkms build-essential linux-headers-generic
(2) Install the guest additions (in the guest)
(3) Reboot the guest.
(4) set up the shared folders using a name that you can remember easily including the case. (documents)
(5) start the guest and open a terminal window and input the following using documents as your share name and /mnt/documents as the mount point
sudo mkdir /mnt/documents
sudo mount -t vboxsf -o rw,gid=1000,uid=1000 documents /mnt/documents.

Note the o is the letter o for option and not a zero
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Code: Select all

$ sudo apt-get install dkms build-essential linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
dkms is already the newest version.
dkms set to manually installed.
linux-headers-generic is already the newest version.
The following package was automatically installed and is no longer required:
  libvncserver0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
My packages are up-to-date and I have already done the steps you are describing above a couple times.

The original problem occured after I follwed the steps of the user manual on page 64, section 4.3.2:
To change the mount directory to something other than /media, you can set the guest
property /VirtualBox/GuestAdd/SharedFolders/MountDir
.

and a little further above:
... to Change that guest property see chapter 4.6, Guest properties, page 66 for details.
which told me to use VBoxManage and VBoxControl. And to use those I installed "virtualbox-ose" and from there my problems started.

I do not understand why the Manual tells to do so, if its wrong to do.

Also with "borked" you mean my guest OS is broken?
So your suggestion is to reinstall the VBox Software and to install a new/different guest?
I wont be able to get it to work in the current guest?

I am sorry, but this is unacceptable as I have lots of software installed on the guest and lots of files which I need to share with the host.
Last edited by anfho on 16. Mar 2011, 20:32, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Do you know how to fix the Linux guest?
It is repairable, but I don't know if it is within your relm and I can't do it remotely.
Do you know someone locally that is familiar with Linux that you can ask to come over and help you?
Post Reply