This cost me a lot of time to figure out and this is just multiple threads combined into one. Hopefully this will save someone a lot of hassle and please respond if there is a better way to do this! (There probably is but I haven’t found it yet.)
Also most of this is shamelessly ripped from this excellent thread: VirtualBox Guest additions in OpenSUSE 11.2 - openSUSE Forums
This was the only thread that helped me to get shared folders to work but it was incomplete for my purpose so that’s why this thread exists.
Situation: OpenSUSE installed in a Virtualbox Virtual Machine and I want to set a shared folder.
1 - Set up a Virtual Machine and install OpenSUSE 11.2
2 - Create a shared folder on host (HostFolder)
3 - Setup the shared folder in Virtualbox
Via the Virtual Machine details or via Devices > Shared Folders…
4 - Install dependencies for running the Virtualbox installer
You need to install the right development kernelpackage for your machinetype (use ‘zypper search -i kernel’ to see what’s installed)
sudo zypper make gcc kernel-source kernel-hosttype/default-devel
5 - Run the Virtual Machine and go to Devices > Guest Additions
This mounts an iso image in your OpenSUSE guest.
6 - Open a root terminal and run
** cd /usr/src/linux
make oldconfig && make prepare && make scripts && make dep
cp …/linux-obj/$HOSTTYPE/default/Module.symvers .
make prepare**
** A commenter on previously mentioned thread says this step is unnecessary but it doesn’t work without on my system. I suggest trying step 7 first and returning to step 6 if that fails. **
7 - Run **./VirtualboxLinux **yourhosttype .run from the mounted iso image.
8 - Create shared folder in OpenSUSE (GuestFolder)
9 - Test with sudo mount -t vboxsf HostFolder /home/user/GuestFolder
It works? Great! Let’s set up the system so it automounts for your regular useraccount instead of root-only access.
10 - Add this line to /etc/fstab
**HostFolder /home/user/GuestFolder vboxsf defaults,uid=1000,gid=1000 0 0
**
11 - It works for me but if it still doesn’t automount after a reboot; sudo mount -a