linux学习记录
分类: LINUX
2011-11-23 15:39:10
虚拟机下Linux和windows的文件共享――共享方式
Sailor_forever 转载请注明
http://blog.csdn.net/sailor_8318/archive/2008/04/15/2295428.aspx
windows的共享文件
虚拟机》设置》选型》点下共享文件夹选中后》添加》
下一步》名称(随便填) 》 浏览选择一个共享文件夹》下一步》选择启用该共享》完成
二、 安装VMvare tools
虚拟机 》 安装vmvare tools 》 弹出对话框 》 确定 》会在虚拟机里弹出cdrom界面如下,桌面上有vmvare tools 盘符
下面就是虚拟机里面的命令操作了,打开虚拟终端
[root@dding root] # cd /mnt
[root@dding mnt]# ls –l 当前没有hgfs文件夹,因为vmvare tools 没有安装
总用量 32
drwxr-xr-x 2 root root 4096 4月 4 03:45 cdrom
drwxr-xr-x 2 root root 4096 4月 4 20:40 entertain
drwxr-xr-x 2 root root 4096 4月 4 03:45 floppy
drwxr-xr-x 2 root root 4096 4月 5 18:49 linux
drwxr-xr-x 2 root root 4096 6月 23 02:04 myramdisk
drwxr-xr-x 2 root root 4096 4月 5 20:20 software
drwxr-xr-x 2 root root 4096 4月 4 20:39 study
drwxr-xr-x 2 root root 4096 4月 4 20:39 system
用rpm命令安装
[root@dding mnt]# rpm -ivh cdrom/VMwareTools-5.5.3-34685.i386.rpm
Preparing... ########################################### [100%]
package VMwareTools-5.5.3-34685 is already installed
用rpm -qa | grep Tools 检查含有Tools的已经安装程序,显示安装成功
[root@dding mnt]# rpm -qa | grep Tools
VMwareTools-5.5.3-34685
重启vmvare-tools 服务
[root@dding mnt]# /etc/init.d/vmware-tools restart
Skipping VMware Tools services shutdown on the host: [ 确定 ]
Starting VMware Tools services on the host:
Switching to host config: [ 确定 ]
正常情况下,此时可以在mnt目录下见到hgfs文件夹
[root@dding mnt]# ls
cdrom entertain floppy hgfs linux myramdisk software study system
查看hgfs文件夹里是否存在windows刚共享的windows-share,存在即表示成功,注意名字为虚拟机下面的名字,即第一步中所设置的windows-share,对应于windows下面的Linux,见上面的图
[root@dding mnt]# ls hgfs/
windows-share
三、设置软链接便于访问
做个软连接,将windows-share放到根目录下,成为新的文件windows,以免每次都得进入/mnt/hgfs/windows-share /目录,以后直接操作根目录下面的windows目录即可了
实际上现在windows下面的E:/Linux/ 和虚拟机下面的/mnt/hgfs/windows-share以及根目录下的/windows就是一样的了,改变任意一个,三者同时改变,是硬同步的
[root@dding mnt]# ln –s /mnt/hgfs/windows-share /windows
[root@dding mnt]# ls /windows 即可见到windows系统下面共享的东西了
×××××××××××××××××××××××××××××××××
当然也可能你比较不幸,vmvare-tools显示安装成功了,但可能实际上安装过程出现了错误,这个时候需要重新配置vmvare-tools,命令如下:
[root@dding mnt]# /usr/bin/vmware-config-tools.pl
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ 确定 ]
Trying to find a suitable vmhgfs module for your running kernel.
The module up-2.4.20-8.i686-RH9.0 loads perfectly in the running kernel.
pcnet32 18240 1
Unloading pcnet32 module
Trying to find a suitable vmxnet module for your running kernel.
The module up-2.4.20-8.i686-RH9.0 loads perfectly in the running kernel.
Detected XFree86 version 4.3.0.
关闭控制台鼠标服务: [ 确定 ]
启动控制台鼠标服务: [ 确定 ]
Please choose one of the following display sizes (1 - 13):
[1] "640x480"
[2]< "800x600"
[3] "1024x768"
[4] "1152x864"
[5] "1280x800"
[6] "1152x900"
[7] "1280x1024"
[8] "1376x1032"
[9] "1400x1050"
[10] "1680x1050"
[11] "1600x1200"
[12] "1920x1200"
[13] "2364x1773"
Please enter a number between 1 and 13:
[2] 3.
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: [ 确定 ]
Guest filesystem driver: [ 确定 ]
DMA setup: [ 确定 ]
Guest operating system daemon: [ 确定 ]
The configuration of VMware Tools 5.5.3 build-34685 for Linux for this running
kernel completed successfully.
You must restart your X session before any mouse or graphics changes take
effect.
You can now run VMware Tools by invoking the following command:
"/usr/bin/vmware-toolbox" during an XFree86 session.
To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/network start
Enjoy,
--the VMware team
经过上述步骤候,一般没有问题了
详细过程可以见我的原始解决文档,里面有问题的解决过程及记录