读书人

VMware虚拟机ubuntu跟主操作系统硬盘之

发布时间: 2012-06-26 10:04:13 作者: rapoo

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

安装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跟主机之间可以实现文件共享了?

读书人网 >操作系统

热点推荐