Virtualbox – samba share from linux guest

vboxsf sharing from virtualbox host to guest is way too SLOWWWWW.

Might as well get samba running in linux host and share it to the host.

To do that. Need to

1. Configure virtualbox to use NAT.

2. Add a second ethernet connection. Choose “host only”. To add the host in the dropdown. You have to create one in the virtualbox menu, not the vm menu. The guest vm should now have 2 ethernet cable.

3. Boot up the vm. the vm should have 2 eth.


eth1 Link encap:Ethernet HWaddr 08:00:27:2E:6C:AC
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe2e:6cac/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10383 errors:0 dropped:0 overruns:0 frame:0
TX packets:6942 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13362425 (12.7 MiB) TX bytes:476652 (465.4 KiB)

eth2 Link encap:Ethernet HWaddr 08:00:27:FD:D4:82
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fefd:d482/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:249923 errors:0 dropped:0 overruns:0 frame:0
TX packets:162555 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41877967 (39.9 MiB) TX bytes:132228351 (126.1 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2792 errors:0 dropped:0 overruns:0 frame:0
TX packets:2792 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7643866 (7.2 MiB) TX bytes:7643866 (7.2 MiB)

The host can now connect to the guest samba share using 192.168.56.101

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.