VirtualBox Shared Folders?

I am running Haiku in VirtualBox, with good success. The VirtualBox Guest Additions package enables the shared clipboard, which is a life-saver! But I haven’t been able to get shared folders working. Are shared folders supported?

If I run:

VBoxControl sharedfolder list

in the Terminal shows the shares that I have added to the virtual machine. This page “https://dev.haiku-os.org/wiki/HardwareInfo/VirtualBox” gives an example command for mounting a shared folder as:

mount -t vboxsf -p SharedFolderFullOfLolcats /mountpoint

Assuming I “mkdir” a folder named “/mountpoint” and chmod 777 it (and replace “SharedFolderFullOfLolcats” with my real shared folder name), I get a “mount: No such device” error.

Am I doing this correctly?

Details: I am currently running a GCC2 Hybrid nightly (50043), under VirtualBox 5.0.14, and got the “VirtualBox Guest Additions” package from HaikuDepot.

Yes, you are doing it correctly. Unfortunately, the gcc2 version of the VirtualBox Guest Additions package from HaikuDepot doesn’t include vboxsf driver because it crashes Haiku, IIRC. See https://github.com/haikuports/haikuports/blob/master/app-emulation/virtualbox-guest-additions/virtualbox_guest_additions-4.3.53_svn.recipe#L74

There was VirtualBox Guest Additions for gcc4 archive in zip format which included said filesystem driver but it only works with gcc4 Haiku of course. http://www.freelists.org/post/haiku-development/RFC-GSOC-2011-VirtualBox-guest-additions-added-to-official-optional-packages

There are two options: either fix the driver so it doesn’t crash the kernel or use VMware with https://depot.haiku-os.org/vmware_addons which also has the same function which even if buggy (you can’t open some files (like jpeg) from shared folders directly) seems to work.

Another option, is to use FTP. I happen to run on VMWARE 8.x (with the guest addition), on a Mac. You can enable FTP on the Mac (host), quite easily and then just use the FTP client on Haiku to move files back and forth (get/put).

This is probably the wrong forum for this (no pun intended), but are there any notes from previous developers on where to start with the driver code? I’ve searched all the ways I know of, and haven’t seen anything specific.

The BeOS driver documentation is still mostly relevant:

https://www.haiku-os.org/legacy-docs/bebook/DeviceDrivers.html

This is all I could find https://github.com/scgtrp/vbox-haiku/commits/master/src/VBox/Additions/haiku/sharedfolders

I succeed running share using VMWARE on WinXP but used SAMBA package (obtained from HaikuDepot).
Configure SAMBA with

~>lpe /system/settings/samba/smb.conf &

My smb.conf file:

[global]
workgroup = COMSYTEC
passdb backend = smbpasswd:/system/settings/samba/passdb.tdb
security = user
debug level = 5

[haiku]
path = /boot/home
valid users = remoteuser
browsable = yes
public = yes
read only = no

Set sufficient access rigths for /boot/home

create user remoteuser
~> useradd remoteuser
~> passwd remoteuser

let SAMBA know about remoteuser

~> smbpasswd remoteuser

Run daemon:

~> smbd -D

get haiku’s IP address using ifconfig e.g.

~> infconfig

/dev/net/pcnet/0
Hardware type: Ethernet, Address: 00:0c:29:b6:26:97
Media type: Auto-select
inet addr: 192.168.42.158, Bcast: 192.168.42.255, Mask: 255.255.255.0
MTU: 1500, Metric: 0, up broadcast link auto-configured
Receive: 299 packets, 0 errors, 31770 bytes, 0 mcasts, 0 dropped
Transmit: 241 packets, 0 errors, 62493 bytes, 0 mcasts, 0 dropped
Collisions: 0

and map remote drive on windows

\192.168.42.158\haiku

login as remoteuser with selected password

My smb.conf file seems not quite correct while windows connects very slowly but when it is ready everything is going fine.