Ok, finally solved this - not quite sure how but hope the following will help people:
I finally gave up on trying to get VirtualBox to use my specified shared folder as it should and instead attempted trying to set up a samba file share. Somewhere along the line of trying to get Samba working, VirtualBox sorted itself out!
Unsure of whether I needed to or not, I went into User and Groups (in Admin), unlocked the settings, chose Root then Properties. Selected the User Privileges tab and clciked "Share files in the local network". I also checked that my user account had this option selected (it did, by default). (I don't think any of this was necessary, you could probably try the next thing first and skip this bit - but I thought I should include it for completeness).
Next I went into the Synaptic package manager and searched for "Samba". "Samba-Common" was already installed but, above that, was the package "Samba" - I downloaded and installed that. Then I rebooted.
I then mounted my second internal hard drive manually and was trying to get the drive to automatically mount on boot (I wish there was an easier way of doing it that messing around with fstab - I find that very confusing and don't really understand it... if you're reading this and wondering what on earth fstab is, it's file found in /etc/ that stands for [I think[ file system table - it 'maps' a physical drive to a 'location' (e.g. "Home", etc) in the Unix file system, 'mounting' the drive).
I also (for whatever reason), tried one final time to reinstall the 'Guest Additions' Now, I may be a bit slow, but I couldn't actually work how to reinstall these - from within your VirtualBox environment (ie.e when your Virtual OS is actually running), choose (from the task bar) Devices, then "Install Guest Additions". If you look under 'Start' on the Windows OS, you will find, under 'all programs', a Virtual Box additions folder with the option to uninstall Guest Additions - DON'T DO THIS! I'm not sure why, but everywhere on the web tells you not to - just reinstall Guest additions from the taskbar -> Device -> Install Guest additions.
I tried this - and found that sometime, within the Windows OS, the Guest Additions install would start, and other times it wouldn't. If it doesn't start automatically, try browsing (in the Windows OS) to My Computer - I found that VirtualBox had 'mounted' what must be CD ISO image - so it looked like, in my CD drive, I had a CD containing the guest additions. I double clicked on this and the install started. (Note - after you've finished the install, the CD ROM appears to keep the 'guest additions' image. Right click on it and pick 'eject' and it goes away - once you've finished with it, obviously).
At this point I went into the VirtualBox Shared Folders (My Network places -> Entire Network -> VirtualBox Shared Folders) and was pleased to find that I could see my shared folder, //home/steve/share (shown as "\\XBOXSVR\share").
I saved a file there (from within XP) and switched to linux - and, sure enough, the file was sitting in the //home/steve/share file - excellent!! It was now working!
I have no idea at what point this was 'fixed' - I'd reinstalled Guest Additions a number of times and it was doing nothing, I also don't think it was adding 'share files' to the root account (once this was all working, I removed that option, and the shared files are still working fine). The Ubuntu 8.04 system I was using was brand new and fully patched, so it couldn't be any of that. The only thing I can think of is the Samba install I did (even though I just installed the package and didn't configure anything else).
The last thing I had to do then was share the actual drive that I wanted to see in both Ubuntu and the VirtualBox guest XP OS. This was much easier than it seems, I'll outline the steps here:
- I identified the drive I wanted to share - did this by opening a terminal window and typing 'sudo fdisk -l' (whcih prompts you for your password). This lists all the current physical drives in your computer. Typically hard drives start hda (e.g. hda1, hda2 etc), but in laptops, SCSI drives or SATA drives, these seem to be listed sda1, sda2 etc (no other diffeence from my perspective for this purpose). I knew my data drive was about 100GB and was in the NTFS file system (as it was created for use with windows), and I hence identified the drive to be sda3.
- I wanted to double check I had the right drive - I'd actually already mounted the data drive on my ubuntu desktop (this was done automatically when I clicked on the drive under Places), and I then (in the terminal window) typed 'mount'. This told me all drives that were mounted - and I could see sda3. I then right clicked on the data drive on the desktop, clicked 'unmount' and the drive disappeared from the desktop. I then returned to the terminal window and typed mount again - sure enough, sda3 was gone. I now knew I had the right drive.
- Final thing was to edit the fstab file to get the data drive to automatically mount. I did this by, within the same terminal window, typing 'gedit /etc/fstab'
This opened the fstab file in the gedit editor.
- I added the following line to the file:
Code: Select all
/dev/sda3 /media/data ntfs user,fmask=0111,dmask=0000 0 0
This wasn't the actual line I found on the 'net - I made the following changes:- I had to specify my drive in the first bit (i.e. sdfa3 - the example I found was [/b]hda1[/b]).
- I specified where I wanted this mounted, and the 'share' name - so I created a directory in /media called 'data' and then told the fstab file to mount sda3 to 'media/data'. You could put the 'container' folder (called 'data' here) anywhere I guess, but it makes sense to put it in /media.
- I specified 'ntfs' - the example I found was for 'ext3' (the linux file system). Everything I copied identically (i.e. everything from user,fmask onwards...)
- I saved the file, exited the terminal and rebooted the whole computer.
- On rebooting into Linux, sure enough I now had my data drive automatically mounted on my desktop.
- The final thing was then go into VirtualBox, add this as a shared folder (poiinting the shared folder at /media/data), started the machine and browsed the XP network - and there was the data drive!
Important - it takes about 5-10 seconds to read your shared fodler - so don't be disillusioned if you double the click your share folder and it appears empty - give it a few seconds and you should see your files appear. I mapped this drive to F: (you can find out how to do this anywhere here by googling it - I won't cover that) and then pointed
My Documents to the F: drive - so now I have seamless use of a shared data drive, and I'm delighted!
I know this is all really basic stuff for most people, but I really hope this can help some newbies like me!
[ModEdit: for readability]