We help IT Professionals succeed at work.

How do you get Virtual Box Shared Folders to work on Windows 7 / Fedora Core?

I am trying to get shared folders to work in Sun Virtual box in WIndows 7.  It seems that I am forced to put everything in C:\Program Files\Sun\Virtual Box or the application will not allow updates.  That is very frustrating.  Any way around that?

Second, I tried to mount the drive in Fedora Core by typing mount -t vboxsf share mountpoint and I had the error message that the mount point didn't exist.  I tried the Guest editions directions in Sun virtual box to do things like "Sudo apt-get install dkms" and I was told that apt-get didn't exist.  I'm not an expert Linux user so you may need to be a little patient with me.

Thanks ahead of time.

Awakenings
Comment
Watch Question

Commented:
There is some confusion in your post.

1. There hasn't been a "Fedora Core" since Oct 2006, since then it has been simply called "Fedora". The current version is Fedora 13. Are you sure you didn't install that one?

2. "apt-get install" is what you use on Debian based systems; on Red Hat based systems you use "yum install" to install software. You opened the wrong version of Vbox guest additions there, or at least read the wrong manual.

3. vboxfs is the root filesystem in a Vbox virtual machine; this is automounted on boot - otherwise the OS wouldn't be able to work. So you do not have to - and cannot - mount it again.

4. If what you wish to do is share files between your host and guest system, you need to make sure the correct GuestAdditions are installed, then you need to configure a shared folder in the 'Settings' dialogue of the VM, make sure that shared folder is also 'shared' in Windows, then  mount it using:
mount -t vboxsf sharename mountpoint
where 'sharename' and 'mountpoint' need to be replaced by the network share name that you configured under Windows, and the mopuntpoint where you wish to mount this folder. The mount point, lets say /mnt/share, must be an existing folder.
You may create a folder by using the 'mkdir' command.
Commented:
Please ignore point #3 above; that was a misunderstanding from my part. Read and follow #4 instead.

Author

Commented:
Torimar,

   Thank you.  It is Fedora 13.  The apt-get was from VirtualBox itself.  I sudo yum install VboxLinuxAdditions - x86.run, and it tells me that no package Vbox LInux... available.  Then "Nothing to do" and quits.  I do this when in that CD - the ISA file I have mounted as a CD right now.

Thoughts?

Awakenings
Commented:
Yes, you do not install VBoxAdditions from the OS repositories, you install them from VBox itself. In the VM 'Settings' dialog, click on 'Storage', then choose the dropdown menu next to 'CDRom' and select VBoxGuestAdditions.
When rebooting your VM, the GuestAdditions will be in the CDRom drive.

In a terminal, you then access the CDRom mount (most likely /cdrom) and start the install script.
Try:

cd /cdrom
sudo sh ./VBoxLinuxAdditions-x86.run

(This is for 32bit Fedora; if your installed version is 64bit, run the 'amd64' install script)

Author

Commented:
Torimar,

    I correctly installed the VBox additions with your help.  I tried;

mount -t vboxsf sharename mountpoint

   But the error I get is mount mountpoint does not exist.  Suggestions?  Sorry...  I'm good with other things, but not Linux.

Thanks,

Awakenings
Commented:
As I said above under #4: you must create that mountpoint first.
Let's say your mountpoint is supposed to be /mnt/shared, then do:

su -       [this will create a root shell for you so you don't have to always type sudo; other wise use sudo in front of all these commands]
mkdir /mnt/shared
mount -t vboxsf sharename /mnt/shared

Author

Commented:
Torimar,

    Thanks.  I think we are almost there!  What you said worked.  I had to chmod the /mnt/shared to get permissions to copy files.  I copied the file and went and checked in the location in Windows 7, and I don't see the file. I was looking under program files/sun/virtualbox which was the only location VirtualBox would allow me to choose for the share.  I couldn't see the file even after a refresh.  Any idea why I am not seeing the file in Windows?

Thanks,

Awakenings
Commented:
Test it the other way around, i.e. place file inside the folder under Windows, then see if you can see and access it in Linux.
- If you can, then this may have to do with some access restrictions in Windows 7 which we'll have to find out about. Are you sure the folder is 'shared' in Win7? Does it have a folder icon with an open hand in it?

- If you can't, something went wrong with configuring the shared folder in the VBox settings in the first place. It's unusual that you couldn't choose any folder you liked, only those underneath the Vbox folder, very unusual, and certainly shouldn't be like that. Are you running an account in  Windows that has admin rights? Have you tried right-clicking the VBox link and running it "as administrator"?

Author

Commented:
Torimar,

   I tried adding the new folder in the directory to windows and nothing showed up in Fedora.  I reloaded the app running as an administrator and I gave extra permissions to the folder (in windows) and that didn't work either.  I am sure the sharing is on and I retested that.  Now sure what else to do.

Thanks,

Awakenings
Commented:
It's misconfigured somehow. Best you do  it all over:

- make sure the Fedora VM isn't running
- in Windows 7, create a folder c:\vbox (you may choose any name, of course)
- right-click c:\vbox, select 'Properties' > 'Sharing' > 'Advanced sharing'
- check 'Share this folder' and give it a share name, let's say: vbox, click 'Ok'
- select the Fedora VM in the VirtualBox window, click the 'Settings' button
- select "Shared Folders"
- delete the 'vboxshared' folder you had setup before by clicking the folder icon with the minus symbol
- add a new one by selecting the folder icon with the plus symbol
- in the "Add share" dialog, click the dropdown arrow in 'Folder path'
- select "other" inside the dropdown
- you should get a Choose folder dialog where you may select/create any folder
- select the c:\vbox folder
- give it a folder name, let's say: vboxfiles
- make sure 'Read-only' is not selected
- boot your VM
- type:
mount -t vboxsf vboxfiles /mnt/shared

Now try sharing files again.

Author

Commented:
Wow...  This is getting annoying, but there is a tiny bit of progress.  I was able to share and set in VB the c:\vbox folder.  Yay!  I did all the commands though and they didn't work.  I did a umount on the two mounted drives, created a new drive called final, mounted that instead (as a test), and performed the variety of tests again.  Still nothing.  I feel like I am one step away, but...

Author

Commented:
Any other thoughts?  From what I can tell, everything seems to be working fine except nothing is working.

Author

Commented:
Maybe there is another way... In Fedora, how do you mount to Windows 7?  I"m trying to read the man page...  I type mount -t ntfs (ip address\share) /mnt/final...  It canot access the share.  Any thoughts?
Commented:
That won't work. Don't even try. Fedora VM is not in one network with the host, nor is it a dual boot situation; you simply can't access the host filesystem directly. You need to use the VBox shared folder setup.

As to the rest: I told you how it should work. You told me it didn't work. That is not enough information for me to start troubleshooting. I need to know exactly what you are doing, and what error messages you get in which situation.
I'm still pretty convinced it is some kind of configuration error on your side; maybe something you didn't do correctly in your first attempts, and which still lingers around and disrupts your present attempts.

Just one more thing: Is this, by any chance, a 64bit Windows 7? Maybe, in that case, you ought to run the VBox application in XP compatibility mode...

Author

Commented:
Oh...  Ok...  I just saw your post.  This is 64 bit Windows 7.  I'll try to XP compatibility mode.

Author

Commented:
Torimar,

   That is the thing.  There are no error messages.  I did everything exactly as you asked, step by step, and still nothing.  Everything seems to have worked with the commands.  There were no hangups or error messages.  It just isn't copying information from one OS to the other.  I have no idea why.

    I just checked the compatibility mode, and I think this program does work with Windows 7.  The compatibility only goes back to 2008 and Windows Vista.  There is no XP compatibility.  I also turned off my firewall (I am behind a HW firewall so this is not as bad as you think.  I still can't copy files.
Commented:
The firewall shouldn't have anything to do with this.

You say it doesn't "copy information".  Did you actually try in both directions a couple of times? I.e. copied two or three random files in Linux to the folder /mnt/shared, and two or three random files in Windows to c:\vbox, then checked if they appeared in the other OS? And please do not use folders for this test, use only files.

Also: as this is the 64bit version of Win7, did you make sure to install not the GuestAdditions I used above in my instructions, but these:
sudo sh ./VBoxLinuxAdditions-amd64.run
?
And did you, before installing the Additions, install Dkms, as suggested in the help manual: 4.4.1. Installing the Linux Guest Additions?
sudo yum install dkms
Commented:
Other than that, I am stumped.
It should work: there are no more reports about problems with Win7 as there are with any other OS'es. Shared folders, however, are always a bit tricky, and it is not unusual to have to try a couple of times.

I'm left with a suspicion though. When re-reading the thread, it is obvious that more than once you tried achieving something which didn't work, then tried again and suddenly it did. (See the fact that you first weren't able to create a shared folder in Win7 outside of the Virtualbox directory)
Also: you sometimes seem to try and guess what could be done rather than follow the instructions in the manual. See your attempt to install the GuestAdditions via yum, which is not mentioned in the manual - in this case it was simply wrong, but did not break anything. In other cases, maybe even before you posted here, you could have tried something that still left a trace in the configuration which now disrupts the correct functioning. That, of course, is just a hypothesis.

But you may want to consider uninstalling and deleteing everything (including the shared folder), then reinstalling Virtualbox (best in another installation folder, not the default one), then reinstalling Fedora. When done, take an immediat snapshot of the VM, so you don't have to reinstall it ever again.

Then try installing GuestAdditions and establishing a shared folder, following the manua. If you wish, you could document your efforts with screenshots and post them here, in case there are problems once more.

Author

Commented:
Torimar,

    I installed a new OS and I see something I am sure happened in the first Fedora instance - when installing the guest editions, there is one part that failed - building the kernel module.  It happened in my second run.  In the meantime, I'm going through the other steps and I will write them out.  I'll try googling that too.

Awakenings

Author

Commented:
Everything else in that package seemed to work fine.
Commented:
Did you install Dkms *before* installing the GuestAdditions? That would help with building the kernel module.

Author

Commented:
Yes...  I'm doing the best to follow the directions.  I came across this page and I am experimenting.

http://digitizor.com/2009/05/26/how-to-install-virtualbox-guest-additions-for-a-linux-guest/

Author

Commented:
That didn't work.  Here is the exact phrase for Google;

Building the VirtualBox Guest Additions kernel modules

    You can probably read Linux faster / better than I, but I am looking.

Author

Commented:
Just an update.  I had a friend help out who is a Linux and VBox person.  We did several things and made more progress  We had to set the kernel location, that helped, but I still have the error "modprobe vboxguest failed".  That occurs when starting virtualBox Guest editions.  My friend said I should either downgrade to Fedora 12 or use VMware (Does the free version allow OS installattions) now?  In the past it didn't.  I could just give you points then open a new ticket.  You have helped quite a bit.
Commented:
I'm quite positive VMWare has been allowing OS installations on the free edition for quite a while. However, from what I read from time to time, setting up VMWare on Linux could be a bit more demanding than Vbox.

Your friend may be right: Fedora 13 is so new, there has hardly been enough time for any repercussions within the community about 'known issues'. Fedora 12 should be a viable option, and it will be supported for at least another one and a half years. Unless you would need F13 for a specific purpose.

On the other hand: do you absolutely need Fedora or a Red Hat based distro? If not, try out Ubuntu or Mint: installing Guest Additions on them has been a breeze on my last attempts: no need to install any extra packages, the VBox kernel would build just from running the VBox GuestAdditions script on a default install.

The choice is up to you. I find the problems you have run into so far clearly indicate that something is
wrong; this could be on the side of your Windows 7 installation (you had more problems with it, didn't you?), or else it could be Fedora 13. The fact that your friend wasn't able to do it either excludes an installation error on the guest side.

Author

Commented:
Torimar,

  I'm gong to sit on this for a day or so.  The reality is that I just want data off of a hard drive.  I don't care about the OS right now.  I chose Fedora because my friend recommended it.  Linux (probably Unix too) was the only way to pull information off the hard drive (without paying for Data Recovery).  Windows could not read the hard drive (don't ask about details).  I've already copied information to the Fedora instance on VirtualBox from this hard drive.  I was hoping it would have been easy like VMWare always was when I used it in the past.  For me, VMWare was always intuitive, but my friend swore up and down about how great it was compared to VMWare so I decided to give it a go - thinking it would have been relatively easy.  Silly me.  If you have any other suggestions for copying information to Windows other than this product, I am all ears.

Thanks,

Awakenings
Commented:
Awakenings,

we could have saved ourselves a lot of time and hassle if you had revealed these intentions of yours right from the start. From the technical point of view, I have a couple of serious objections to make against the way you set up to solve your problem with that hard drive:

1. Fedora is a fabulous OS, but it isn't really a distro for the Linux beginner. For your first steps with this new OS, there are far more recommendable distros (like Ubuntu/Mint, Mepis, PCLinuxOS, even Mandriva or Suse).

2. A virtual machine isn't really the best way to go about a data rescue mission on a separate HDD; connecting another drive to the VM, using USB, sharing files between host and guest - all these issues may easily get in between you and your files, and make this recovery project a complicated nightmare. The best way is to boot off a Linux live CD, either the machine that contains the damaged drive, or a machine that this drive is connected to externally.

3. A complete productivity OS with all the applications needed for the normal daily use of a computer is not the best rescue environmen: it installs hundreds of megabytes of office, multimedia, graphics and internet software that you don't need, and it lacks specific disaster recovery tools you might need. There are specialized Linux distros that concentrate on providing just the tools required for maintenance, backup and recovery - but of these a wide variety, configured and ready to be used immediately.

So what you would best use for your purpose is a specialized bootable live OS. There are a couple (SystemRescueCD, Ubuntu Rescue Remix, Knoppix etc) but none is so good and easy to use as Parted Magic: http://partedmagic.com
It's only ~90 mb as download, but it contains hundreds of specialized tools and applications, configured to work out of the box. It comes as a CD and as a bootable USB version. It has an intuitive GUI, and some of the most used features (like mounting a drive) are run as scripts that may be started by double-clicking an icon on the desktop.
I highly recommend you use this live OS instead of a virtual machine.

Author

Commented:
Torimar,

    Thank you for your advice.  I have spent quite a bit of money buying contraptions to hok up this hard drive directly to my computer.  None of them work.  It is an old IDE hard drive and my system is brand spaking new (almost).  I have tried cards connecting into computers, IDE to sata devices, boot disks (with USB), all have failed.  I only seem to be able to connect with this external boot disk.  Fedora was just recommended to me and was the only way I could gain access to the data.  I have it copied into Fedora now and am thrilled to have made that extra step.  I doubt parted magic has the drivers to allow me to connect to this external USB hard drive.  My expertise really is in areas other than Linux.  Is there any way to just set up a FTP server in Fedora so that I can connect in to retrieve the data?  My other option is wait a couple of weeks for a new update to VirtualBox and then do an install.  Thoughts?

Awakenings
Commented:
Awakenings,

why should Parted Magic, a specialized rescue distro, not have drivers to connect to a USB HDD device if Fedora, an unspecialized distro with a claim of being cutting edge (which includes hardware requirements), seemingly has these drivers and makes them work even from inside a virtual environment? It will cost you less than 10 minutes of downloading and burning to run a test and find out.
Connect the external device, insert the PM CD, and boot your computer off it. Then use the Mount Tool icon on the desktop. It is as simple as that.

Of course, it would normally not be much of a problem to set up an FTP server in Fedora. Normally. But you are not dealing with normal Fedora, you are dealing with Fedora running inside a virtual machine that is controlled by Windows 7 - a scenario which already let you run into problems when trying to set up shared folders. I have no idea what unexpected issues we might be faced with this time.
So before turning to FTP server setup I'd prefer to know for sure that the easier way, Parted Magic, would not work.

Author

Commented:
Torimar,

    My apologies.  While I have not used this tool, I've downloaded several other CD's that people suggested and nothing has worked - nothing has been able to get the USB information from this drive when it should.  I just downloaded it, but I need to go to work so I'll try to burn and test it tonight.  I feel like I am going a step backwards which is why I am reticent.  FTP seems like such a simple thing to set up and it would not need to interact with VirtualBox or Windows 7.  I could then just FTP from Windows 7 to Red Hat.  I will give it a shot though.

Thanks for all the help!

Awakenings
Commented:
I'm afraid you are wrong in your assumptions. For the whole story I'd have to refer you to chapter 6 of the VBox manual: Virtual Networking.
By default, Virtual Box sets a VM up with a virtual network device using NAT (network address translation). This is easily done and will suffice for normal internet connectivity. But the guest is simply using the host's ethernet card, sharing its network address. This means that guest and host may by no means connect to each other via TCP/IP networking. Try to ping your VM from Windows 7 to see what I mean.

In order to get this working as you want it to, VBox would have to create a new separate network device in Windows 7 which the virtual machine could use as a bridge to route its traffic through. This Win7 network device would have to be addressed by a specific virtual network device inside the virtual machine which now you'd have to add, meaning that you would have to do all the setup and configuration manually, plus build a new kernel to support it.
Afterwards you would have to setup a linux FTP server (already more demanding than doing this on Windows) on a Linux system with two network cards, and once this is achieved without Fedora's SELinux getting into the way too much, you'd have to check whether Windows 7 actually will let the extra network device do its job (firewall config) plus what the router has to say to all this.

Maybe you understand why I keep my fingers crossed for you, wishing you good luck with Parted Magic.

Author

Commented:
Woohoo!  Success!  After so much time and so many problems the CD worked!  Thank you so much - even pushing through my doubts!  You have been extremely patient and I appreciate it!  Thank you!

Author

Commented:
It was a compensating way of completing the task, but Torimar made it through most of the stuff anyway...

Commented:
Thank you. I'm very glad you made it.

Keep the Parted Magic CD. It may be of service to you in many ways.

Author

Commented:
Torimar,

    I noticed.  It has alot of very cool tools.  It is very intuitive too.

Cheers!

Awakenings