设为首页 收藏本站
查看: 1534|回复: 0

[经验分享] VMware虚拟机ubuntu和主操作系统硬盘之间的文件共享的实现

[复制链接]

尚未签到

发表于 2016-1-6 15:27:36 | 显示全部楼层 |阅读模式
  安装vmware-tools就能实现文件共享
 1.在虚拟机种加载linux.iso文件。Settings-Hardware-CD/DVD(IDE)-Use iso image file中加入linux.iso文件。PS:这个文件可以在VMware的安装目录下找到:\Program Files\VMware\VMware Workstation\linux.iso
 
2.启动虚拟机 进入/mnt/cdrom目录
cd /mnt/cdrom
 
3.到cdrom目录里面解压VMware-tools*.tar.gz 到tmp
cp VMware-tools*.tar.gz /tmp 
cd /tmp 
tar xzvf VMware-tools*.tar.gz 
cd vmware-tools-distrib
 
在目录里面是不是看到了一个vmware-install.pl 
OK! 

 
4.运行./vmware-install.pl
 
5.VMware-tools已安装成功了 
cd /mnt 
是不是看到了一个hgfs目录,这就表明安装成功了,下面就要讲一下怎么来设置共享了,这一部分更简单。 
记得上面在VM菜单里进行操作了吗?对!下面接着要在VM菜单里进行,选择setting子项,再选择Options。在窗体的左半部分是不是看到了Shared Folders这么一项,如果你以前没有设置过,应该是Disabled。 
选择always enable,选择Add,选择要和客户Linux进行共享的目录。 

目前已完成了所有的工作了,在/mnt/hgfs下你会看到添加的目录。在windows下向指定的share folders写文件,在Linux客户机里面就能够看到,同样在Linux上写文件在视窗系统下也能够看到,并且能修改。
 
 
PS:事情总是没有你想象的顺利,在执行第四步的过程中,我遇到了 What is the location of the directory of C header files that match your running的问题。
问题描述:运行./vmware-install.pl后,一直按enter键就ok了,当出现下面这个提示后,你就要小心了.
Before running VMware Tools for the first time, you need to configure it by

invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want

this program to invoke the command for you now? [yes]

 

Before you can compile modules, you need to have the following installed...

 

make

gcc

kernel headers of the running kernel

 

 

上面提示的意思安装vmware tools必须先安装gcc 和内核头文件。

Searching for GCC...

Detected GCC binary at "/usr/bin/gcc".

The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.

Would you like to change it? [no]

 

 

问题来了:它找不到我的内核头文件的路径

Searching for a valid kernel header path...

The path "" is not valid.

Would you like to change it? [yes]

 

What is the location of the directory of C header files that match your running

kernel?

提示我要输入内核头文件的路径

 

 

会出现这种问题有两种情况:

一种是你没有安装内核头文件,那就要先安装kervel-deve,在网上也有这方面的资料:

http://hi.baidu.com/wmhx/blog/item/312d7ada4c06c6d6b7fd48a1.html

 

另外一种情况是vmware的问题,其实kernel header已经安装了,只是没有正确的被识别到

解决办法如下:

1.  运行cd /lib/modules/`uname -r`/build/include/linux"
如果没有提示错误信息,
 

2.  做两个软连接就行了,具体方法是运行下面两条命令
ln -s ../generated/autoconf.h
ln -s ../generated/utsrelease.h
这两条命令给vmwaretools关联了正确的内核头文件的位置


3.  再次执行./vmware-install.pl后,如下所示 :vmware已经可以找到了合法的内核头文件路径,接下来就是继续按enter键了。
 

Searching for a valid kernel header path...

Detected the kernel headers of the running kernel at

"/lib/modules/2.6.35-24-generic/build/include".

The path "/lib/modules/2.6.35-24-generic/build/include" appears to be a valid

path to the kernel headers of the running kernel.

Would you like to change it? [no]

 

4.最后,如下提示,则表示vmware-tools安装成功了!

Creating a new initrd boot image for the kernel.

update-initramfs: Generating /boot/initrd.img-2.6.35-24-generic

   Checking acpi hot plug                                              done

Starting VMware Tools services in the virtual machine:

   Switching to guest configuration:                                   done

   Paravirtual SCSI module:                                            done

   Guest filesystem driver:                                            done

   Mounting HGFS shares:                                               done

   Guest memory manager:                                               done

   VM communication interface:                                         done

   Blocking file system:                                               done

   File system sync driver:                                            done

   Guest operating system daemon:                                      done

   Virtual Printing daemon:                                            done

 

The configuration of VMware Tools 8.1.3 build-203739 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 X server session.

 

To enable advanced X features (e.g., guest resolution fit, drag and drop, and

file and text copy/paste), you will need to do one (or more) of the following:

1. Manually start /usr/bin/vmware-user

2. Log out and log back into your desktop session; and,

3. Restart your X session.

 

Enjoy,

 

--the VMware team

 

 

 

成功解决问题!ubuntu跟主机之间可以实现文件共享了 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161097-1-1.html 上篇帖子: vmware已安装tools,但是hgfs仍无内容的解决方法 下篇帖子: 安装VMWare时Failed to create requested registry key
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表