之前的時候裝過ubuntu的虛擬機,但是由於系統還原以後不知道爲何不能用了,但是在此安裝居然出現很莫名其妙的錯誤,如今記錄總結一下。node
在安裝虛擬機VMware tools以前,你須要知道以下概念:linux
(1)虛擬機有免安裝綠色版,也有非免安裝綠色版,通常非免安裝綠色版在你安裝完虛擬機後,其目錄下會自動生成VMware tools安裝文件(windows.iso、linux.iso),而免安裝綠色版由於是壓縮包,裏面有沒有VMware tools安裝文件那就要看發佈這個包的人有沒有把VMware tools安裝文件打包在裏面咯,若是沒有,那你就要麻煩點,本身去下載咯。ubuntu
(2)虛擬機能夠裝多個系統、多種系統(只要你硬盤夠嗆~),這你們都知道,然而VMware tools不是針對虛擬機的,而是針對系統的,也就是說假如你虛擬機裝有兩個系統(能夠都是Windows XP),其中一個系統中安裝了VMware tools,那麼就只有安裝了VMware tools的這個系統才能使用VMware tools的功能,另一個系統並不能使用VMware tools,不要覺得在一個系統中裝了VMware tools,之後我裝什麼系統就不用安裝VMware tools均可以使用VMware tools了,你哪一個系統須要使用VMware tools,哪一個系統就要安裝VMware tools,這是一一對應的關係。windows
(3)VMware tools安裝根據系統,就有不一樣的VMware tools鏡像,不過你們都是ISO格式的包(windows.iso、linux.iso),安裝的時候就要根據你的虛擬系統來選擇再安裝了,不要見到是*.iso格式就選了,好比Linux有Linux的VMware tools,通常命名爲linux.iso,它最終是經過運行linux.iso包裏面 *.pl 格式的文件進行VMware tools安裝的,若是你是XP系統,VMware tools安裝包通常命名爲windows.iso,它最終是經過運行windows.iso包裏面 steup.exe來運行安裝的。session
安裝VMWare Tools:app
一、點擊「虛擬機 - 安裝VMWare Tools」,雙擊桌面上出現的光盤圖標,右擊「…….tar.gz」後綴文件將其解壓縮桌面上。tcp
二、打開「終端」,運行su命令後輸入密碼獲取root用戶權限,依次執行下面的命令(注意這裏版本號可能有所不一樣,能夠在終端中執行uname -r查看當前內核版本):ide
cd /usr/src/linux-headers-2.6.38-8-generic/includepost
cp -p generated/utsrelease.h linux/utsrelease.hui
cp -p generated/autoconf.h linux/autoconf.h
三、在終端中進入桌面的解壓縮目錄(以本身的實際分區目錄爲基準):
cd /home/june/桌面/vmware-tools-distrib
而後執行:
sudo ./vmware-install.pl(注意 / 前有一個 . )
四、而後剩下的就沒什麼了,跟之前的基本一致,一路回車,一直到提示選擇分辨率,再到提示「Enjoy, — the VMware team」就行了。最後就是在「首選項 - 啓動應用程序」裏把vmware-toolbox添加進去就能夠了。
Creating a new VMware Tools installer database using the tar4 format.
Installing VMware Tools.
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc]
What is the directory that contains the init scripts?
[/etc/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]
The installation of VMware Tools 8.4.6 build-385536 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
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]
Initializing...
Making sure services for VMware Tools are stopped.
The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=vmmemctl to override.
Before you can compile modules, you need to have the following installed...
make
gcc
kernel headers of the running kernel
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...
Detected the kernel headers of the running kernel at
"/lib/modules/2.6.38-8-generic/build/include".
The path "/lib/modules/2.6.38-8-generic/build/include" appears to be a valid
path to the kernel headers of the running kernel.
Would you like to change it? [no]
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vmhgfs-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vmhgfs-only/backdoor.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/backdoorGcc32.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/bdhandler.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/cpName.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/cpNameLinux.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/cpNameLite.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/dentry.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/dir.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/file.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/filesystem.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/fsutil.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/hgfsBd.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/hgfsEscape.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/hgfsUtil.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/inode.o
/tmp/vmware-root/modules/vmhgfs-only/inode.c:159:4: warning: initialization from incompatible pointer type
/tmp/vmware-root/modules/vmhgfs-only/inode.c:173:4: warning: initialization from incompatible pointer type
/tmp/vmware-root/modules/vmhgfs-only/inode.c: In function ‘HgfsPermission’:
/tmp/vmware-root/modules/vmhgfs-only/inode.c:1867:10: warning: passing argument 1 of ‘atomic_read’ from incompatible pointer type
/usr/src/linux-headers-2.6.38-8-generic/arch/x86/include/asm/atomic.h:23:19: note: expected ‘const struct atomic_t *’ but argument is of type ‘unsigned int *’
CC [M] /tmp/vmware-root/modules/vmhgfs-only/kernelStubsLinux.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/link.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/message.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/messageBackdoor.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/module.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/page.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/request.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/rpcout.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/stubs.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/super.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/tcp.o
CC [M] /tmp/vmware-root/modules/vmhgfs-only/transport.o
LD [M] /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.mod.o
LD [M] /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vmhgfs-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vmhgfs-only'
cp -f vmhgfs.ko ./../vmhgfs.o
make:離開目錄「/tmp/vmware-root/modules/vmhgfs-only」
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vmxnet-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vmxnet-only/vmxnet.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vmxnet-only/vmxnet.mod.o
LD [M] /tmp/vmware-root/modules/vmxnet-only/vmxnet.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vmxnet-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vmxnet-only'
cp -f vmxnet.ko ./../vmxnet.o
make:離開目錄「/tmp/vmware-root/modules/vmxnet-only」
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vmblock-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/block.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/control.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/dbllnklst.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/dentry.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/file.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/filesystem.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/inode.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/module.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/stubs.o
CC [M] /tmp/vmware-root/modules/vmblock-only/linux/super.o
LD [M] /tmp/vmware-root/modules/vmblock-only/vmblock.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vmblock-only/vmblock.mod.o
LD [M] /tmp/vmware-root/modules/vmblock-only/vmblock.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vmblock-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vmblock-only'
cp -f vmblock.ko ./../vmblock.o
make:離開目錄「/tmp/vmware-root/modules/vmblock-only」
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vmci-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vmci-only/kernelStubsLinux.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciDatagram.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciEvent.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciGuestDs.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciGuestKernelIf.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciKernelIf.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciProcess.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciQueuePair.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciUtil.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmci_drv.o
LD [M] /tmp/vmware-root/modules/vmci-only/vmci.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vmci-only/vmci.mod.o
LD [M] /tmp/vmware-root/modules/vmci-only/vmci.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vmci-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vmci-only'
cp -f vmci.ko ./../vmci.o
make:離開目錄「/tmp/vmware-root/modules/vmci-only」
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vmci-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vmci-only/kernelStubsLinux.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciDatagram.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciEvent.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciGuestDs.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciGuestKernelIf.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciKernelIf.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciProcess.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciQueuePair.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmciUtil.o
CC [M] /tmp/vmware-root/modules/vmci-only/vmci_drv.o
LD [M] /tmp/vmware-root/modules/vmci-only/vmci.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vmci-only/vmci.mod.o
LD [M] /tmp/vmware-root/modules/vmci-only/vmci.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vmci-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vmci-only'
cp -f vmci.ko ./../vmci.o
make:離開目錄「/tmp/vmware-root/modules/vmci-only」
Using 2.6.x kernel build system.
make:進入目錄'/tmp/vmware-root/modules/vsock-only'
make -C /lib/modules/2.6.38-8-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: 正在進入目錄 `/usr/src/linux-headers-2.6.38-8-generic'
CC [M] /tmp/vmware-root/modules/vsock-only/linux/af_vsock.o
CC [M] /tmp/vmware-root/modules/vsock-only/linux/notify.o
CC [M] /tmp/vmware-root/modules/vsock-only/linux/stats.o
CC [M] /tmp/vmware-root/modules/vsock-only/linux/util.o
CC [M] /tmp/vmware-root/modules/vsock-only/linux/vsockAddr.o
CC [M] /tmp/vmware-root/modules/vsock-only/driverLog.o
LD [M] /tmp/vmware-root/modules/vsock-only/vsock.o
Building modules, stage 2.
MODPOST 1 modules
CC /tmp/vmware-root/modules/vsock-only/vsock.mod.o
LD [M] /tmp/vmware-root/modules/vsock-only/vsock.ko
make[1]:正在離開目錄 `/usr/src/linux-headers-2.6.38-8-generic'
make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: 正在進入目錄 `/tmp/vmware-root/modules/vsock-only'
make[1]: 「postbuild」是最新的。
make[1]:正在離開目錄 `/tmp/vmware-root/modules/vsock-only'
cp -f vsock.ko ./../vsock.o
make:離開目錄「/tmp/vmware-root/modules/vsock-only」
The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=vmxnet3 to override.
The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer. Use the flag
--clobber-kernel-modules=pvscsi to override.
Disabling timer-based audio scheduling in pulseaudio.
Detected Xorg X server version 1.10.1.
Distribution provided drivers for Xorg X server are used.
Skipping X configuration because X drivers are not included.
Creating a new initrd boot image for the kernel.
update-initramfs: Generating /boot/initrd.img-2.6.38-8-generic
vmware-tools start/running
The configuration of VMware Tools 8.4.6 build-385536 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 "/usr/bin/vmware-toolbox-cmd" from the
command line or by invoking "/usr/bin/vmware-toolbox" from the command line
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.
To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/networking stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/networking start
Enjoy,
--the VMware team
root@cc-virtual-machine:/home/cc/桌面/vmware-tools-distrib#