Virtualbox is installed in Windows 7, and centos 5.6 is installed through virtualbox. to access some files in windows under centos, configure the data space in virtualbox:
Virtualbox 4.0.8
[Root @ zuantianyang-lnx ~] # Lsb_release-
LSB version: core-4.0-amd64: core-4.0-ia32: core-4.0-noarch: graphics-4.0-amd64: graphics-4.0-ia32: graphics-4.0-noarch: printing-4.0-amd64: printing-4.0-ia32: printing-4.0-noarch
Distributor ID: centos
Description: centos release 5.6 (final)
Release: 5.6
Codename: Final
1. Install virtualbox guest addition. Click "Install enhancement" under the "device" menu ":
[Root @ zuantianyang-lnx vboxadditions_4.0.8_71778] $ LS-LRT
Total 37520
-R-XR-x 1 Root 278832 05-31 22: 17 vboxwindowsadditions.exe
-R-XR-x 1 Root 9284432 05-31 VBoxWindowsAdditions-amd64.exe
-R-XR-x 1 Root 14664192 05-31 22: 17 vboxsolarisadditions. PKG
-R-XR-x 1 Root 7853516 05-31 22: 17 vboxlinuxadditions. Run
-R-XR-x 1 Root 5523 05-31 22: 17 runasroot. Sh
-R-XR-x 1 Root 6966 05-31 22: 17 Autorun. Sh
-R-XR-x 1 Root 647 05-31 22: 17 autorun. inf
Dr-XR-x 2 root Root 4096 05-31 64bit
Dr-XR-x 3 Root 4096 05-31 32bit
-R-XR-x 1 Root 6190464 05-31 VBoxWindowsAdditions-x86.exe
[Root @ zuantianyang-lnx vboxadditions_4.0.8_71778] $./vboxlinuxadditions. Run
2. Find the data space in settings of virtualbox, add the folder to be shared, and select Auto-mount and fixed allocation:
Device --> allocate Data Space --> Add Data Space
I chose drive C for the entire win7 drive, Data Space Location C: \, data space name c_drive
3. confirm the existence of/sbin/mount. vboxsf
4. Check whether the boxvfs module is loaded: lsmod | grep vboxvfs. If it is not loaded, run the modprobe vboxvfs command to load it.
5. Create a mount point:
[Root @ zuantianyang-lnx ~] # Cd/
[Root @ zuantianyang-lnx/] # mkdir win7_c_drive
[Root @ zuantianyang-lnx/] # Mount-T vboxsf c_drive win7_c_drive
C_drive is the data space name, corresponding to the shared Windows folder.
6. To enable the Windows folder to be accessed after the machine is restarted, mount the folder automatically after centos is restarted. You need to modify/etc/fstab and add
C_drive/win7_c_drive vboxsf defaults 0 0 save, mount the Windows shared directory c_drive to cenos/win7_c_drive
[Root @ zuantianyang-lnx ~] # Cd/etc/
[Root @ zuantianyang-lnx etc] # vi fstab
/Dev/volgroup00/logvol00/ext3 defaults 1 1
Label =/boot ext3 defaults 1 2
Tmpfs/dev/SHM tmpfs defaults 0 0
Devpts/dev/PTS devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0
/Dev/volgroup00/logvol01 swap defaults 0 0
# Automatically mount windows7 c_drive to/win7_c_drive during startup, byrneyang.
C_drive/win7_c_drive vboxsf defaults 0 0
7. unmount
# Sudo umount-F/mnt/shared