Share windows folder to CentOS 6.4 on VirtualBox 4.2.12

I've tried CIFS to connect windows netdirve ,but it sometimes can't connect on, so I'm trying VirtualBox tools to share windows folder,and it works fine.


install CentOS Guest Additions
Because My CentOS using minimal install,
the tools will install by console

create share folder
Open VirtualBox manager->Select ur Vm->Settings->Shard folders->add u want share from win32 to linux folders,etc:D:\sites folder name:sites

input Guest Additions tool ISO
swith to ur vm screen,Devices->Install Guest Additions


mount Guest Additions tool ISO to /media

$ sudo mount /dev/cdrom /media


check the ISO is really mounted

$ ls /media



install Guest Additions tool dependency

$ sudo yum install gcc kernel kernel-devel


install Guest Additions tool

$ sudo /media/VBoxLinuxAdditions.run

Becaus CentOS not windows ,so we can ignore "Installing the Windows System drivers[FAILED]" msg

manual mount it

$ sudo mount.vboxsf [vm folder name] [mount point]

sample:
mount vm folder named sites to /mnt/sites/:

$ sudo mount.vboxsf sites /mnt/sites/


check folder is really mounted

$ ls /mnt/sites


auto mount it when VM boot

$ sudo vim /etc/fstab

add this line at fstab file bottom

/sites /mnt/sites vboxsf defaults 0 0


reboot CentOS VM

$ sudo reboot -h now

check folder is really auto mounted after boot

$ ls -l /mnt/sites



NOTE: Using cifs is much faster then vboxsf

References
http://tonysv.blogspot.tw/2011/03/centos-mount-virtualbox-share-folder.html
http://chaeltung.blogspot.tw/2012/11/virtualbox-centosguest-additions.html
http://blog.roodo.com/rocksaying/archives/7374721.html
http://www.ericlin.me/virtualbox-shared-folders-with-centos-server-guest

留言