vsphere中安装Ubuntu的vmtools

安装前先生成快照,避免后悔!

Ubuntu太自动化了,有些操作,自动的让人会莫名其妙。

 

安装前检查依赖build-essential

[15:41:58]wulei@wulei-virtual-machine:~$ sudo apt-get install build-essential 
[15:42:02][sudo] wulei 的密码: 
[15:42:02]正在读取软件包列表... 完成
[15:42:02]正在分析软件包的依赖关系树       
[15:42:02]正在读取状态信息... 完成       
[15:42:03]build-essential 已经是最新版 (12.1ubuntu2)。
[15:42:03]升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 85 个软件包未被升级。

选中虚拟机右键如下图:


执行过程代码全部贴到这里

[15:43:43]wulei@wulei-virtual-machine:/cdrom$ cd /media/
[15:43:44]wulei@wulei-virtual-machine:/media$ ls
[15:43:44]floppy  floppy0  wulei

[15:43:46]wulei@wulei-virtual-machine:/media$ cd wulei/
[15:43:49]wulei@wulei-virtual-machine:/media/wulei$ ls
[15:43:49]VMware Tools

[15:43:56]wulei@wulei-virtual-machine:/media/wulei$ cd VMware\ Tools/
[15:43:57]wulei@wulei-virtual-machine:/media/wulei/VMware Tools$ ls
[15:43:57]manifest.txt     VMwareTools-9.10.0-2476743.tar.gz  vmware-tools-upgrader-64
[15:43:57]run_upgrader.sh  vmware-tools-upgrader-32

[15:44:50]wulei@wulei-virtual-machine:/media/wulei/VMware Tools$ mkdir -p ~/vmtools
[15:44:53]wulei@wulei-virtual-machine:/media/wulei/VMware Tools$ cp * ~/vmtools

[15:45:00]wulei@wulei-virtual-machine:/media/wulei/VMware Tools$ cd ~/vmtools/
[15:45:01]wulei@wulei-virtual-machine:~/vmtools$ ls
[15:45:01]manifest.txt     VMwareTools-9.10.0-2476743.tar.gz  vmware-tools-upgrader-64
[15:45:01]run_upgrader.sh  vmware-tools-upgrader-32

[15:45:51]wulei@wulei-virtual-machine:~/vmtools$ tar -zxvf VMwareTools-9.10.0-2476743.tar.gz
[15:45:51]vmware-tools-distrib/
[15:45:51]vmware-tools-distrib/lib/
[15:45:51]vmware-tools-distrib/lib/lib64/
[15:45:51]vmware-tools-distrib/lib/lib64/libgnome-menu.so.2/
[15:45:51]vmware-tools-distrib/lib/lib64/libgnome-menu.so.2/libgnome-menu.so.2
[15:45:51]vmware-tools-distrib/lib/lib64/libgnome-menu.so.2/LICENSE

.....

[15:45:54]vmware-tools-distrib/etc/vmware-tools-prelink.conf
[15:45:54]vmware-tools-distrib/etc/xsession-xdm.sh
[15:45:54]vmware-tools-distrib/etc/poweron-vm-default
[15:45:54]vmware-tools-distrib/etc/vmware-user.Xresources
[15:45:54]vmware-tools-distrib/FILES
[15:47:02]wulei@wulei-virtual-machine:~/vmtools$ ls
[15:47:02]manifest.txt     VMwareTools-9.10.0-2476743.tar.gz  vmware-tools-upgrader-32
[15:47:02]run_upgrader.sh  vmware-tools-distrib               vmware-tools-upgrader-64

[15:47:21]wulei@wulei-virtual-machine:~/vmtools$ cd vmware-tools-distrib/
[15:47:22]wulei@wulei-virtual-machine:~/vmtools/vmware-tools-distrib$ ls
[15:47:22]bin  doc  etc  FILES  INSTALL  installer  lib  vgauth  vmware-install.pl


[15:47:39]wulei@wulei-virtual-machine:~/vmtools/vmware-tools-distrib$ sudo ./vmware-install.pl 
[15:47:40]open-vm-tools are available from the OS vendor and VMware recommends using 
[15:47:40]open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
[15:47:46]Do you still want to proceed with this legacy installer? [no]y
[15:47:56]open-vm-tools are available from the OS vendor and VMware recommends using 
[15:47:56]open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
[15:48:01]Do you still want to proceed with this legacy installer? [no] 
[15:48:01]
[15:48:07]wulei@wulei-virtual-machine:~/vmtools/vmware-tools-distrib$ sudo ./vmware-install.pl -y
[15:48:07]VMware Tools 9.10.0 build-2476743 for Linux installer
[15:48:07]Usage: ./vmware-install.pl [[-][-]d[efault]]
[15:48:07]default: Automatically answer questions with the proposed answer.
[15:48:07][[-][-]f[orce-install]]
[15:48:07]force-install: install even if open-vm-tools are available for this 
[15:48:07]distribution. [[-][-]prefix=<path to install product: bin, lib, doc>]    Put 
[15:48:07]the installation at <path> instead of the default location.  This implies 
[15:48:07]'--default'.
[15:48:07]--clobber-kernel-modules=<module1,module2,...>    Forcefully removes any VMware
[15:48:07]related modules installed by any other installer and installs the modules 
[15:48:07]provided by this installer.  This is a comma seperated list of modules.
[15:48:07]
[15:48:11]wulei@wulei-virtual-machine:~/vmtools/vmware-tools-distrib$ sudo ./vmware-install.pl
[15:48:11]open-vm-tools are available from the OS vendor and VMware recommends using 
[15:48:11]open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
[15:48:13]Do you still want to proceed with this legacy installer? [no] yes
[15:48:13]
[15:48:13]Creating a new VMware Tools installer database using the tar4 format.
[15:48:13]
[15:48:13]Installing VMware Tools.
[15:48:13]
[15:48:13]In which directory do you want to install the binary files? 
[15:48:15][/usr/bin] 
[15:48:15]
[15:48:15]What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[15:48:15][/etc] 
[15:48:15]
[15:48:15]What is the directory that contains the init scripts? 
[15:48:15][/etc/init.d] 
[15:48:15]
[15:48:15]initctl: 无法连接到 Upstart: Failed to connect to socket /com/ubuntu/upstart: 拒绝连接
[15:48:16]In which directory do you want to install the daemon files? 
[15:48:16][/usr/sbin] 
[15:48:16]
[15:48:16]In which directory do you want to install the library files? 
[15:48:16][/usr/lib/vmware-tools] 
[15:48:16]
[15:48:16]The path "/usr/lib/vmware-tools" does not exist currently. This program is 
[15:48:16]going to create it, including needed parent directories. Is this what you want?
[15:48:16][yes] 
[15:48:16]
[15:48:17]
[15:48:17]
[15:48:18]In which directory do you want to install the documentation files? 
[15:48:18][/usr/share/doc/vmware-tools] 
[15:48:18]The path "/usr/share/doc/vmware-tools" does not exist currently. This program 
[15:48:18]is going to create it, including needed parent directories. Is this what you 
[15:48:18]want? [yes] 
[15:48:18]The installation of VMware Tools 9.10.0 build-2476743 for Linux completed 
[15:48:18]successfully. You can decide to remove this software from your system at any 
[15:48:18]time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
[15:48:18]
[15:48:18]Before running VMware Tools for the first time, you need to configure it by 
[15:48:18]invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 
[15:48:18]this program to invoke the command for you now? [yes] 
[15:48:18]
[15:48:19]Initializing...
[15:48:19]
[15:48:19]
[15:48:19]
[15:48:19]
[15:48:19]
[15:48:25]
[15:48:25]Making sure services for VMware Tools are stopped.
[15:48:25]
[15:48:26]Stopping VMware Tools services in the virtual machine:
[15:48:26]   Guest operating system daemon:                                      done
[15:48:26]   VMware User Agent (vmware-user):                                    done
[15:48:26]   Unmounting HGFS shares:                                             done
[15:48:26]   Guest filesystem driver:                                            done
[15:48:26]
[15:48:26]
[15:48:26]update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
[15:48:26]The module vmci has already been installed on this system by another installer 
[15:48:26]or package and will not be modified by this installer.
[15:48:26]
[15:48:26]The module vsock has already been installed on this system by another installer
[15:48:26]or package and will not be modified by this installer.
[15:48:26]
[15:48:26]The module vmxnet3 has already been installed on this system by another 
[15:48:26]installer or package and will not be modified by this installer.
[15:48:26]
[15:48:26]The module pvscsi has already been installed on this system by another 
[15:48:26]installer or package and will not be modified by this installer.
[15:48:26]
[15:48:26]The module vmmemctl has already been installed on this system by another 
[15:48:26]installer or package and will not be modified by this installer.
[15:48:26]
[15:48:26]The VMware Host-Guest Filesystem allows for shared folders between the host OS 
[15:48:26]and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
[15:48:26]to enable this feature? [no] 
[15:48:26]The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 
[15:48:26]upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
[15:48:26]
[15:48:26]The vmblock enables dragging or copying files between host and guest in a 
[15:48:26]Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[15:48:26][no] 
[15:48:26]VMware automatic kernel modules enables automatic building and installation of
[15:48:26]VMware kernel modules at boot that are not already present. This feature can
[15:48:26]be enabled/disabled by re-running vmware-config-tools.pl.
[15:48:26]
[15:48:26]Would you like to enable VMware automatic kernel modules?
[15:48:26][no] 
[15:48:26]
[15:48:26]Disabling timer-based audio scheduling in pulseaudio.
[15:48:26]
[15:48:26]Do you want to enable Guest Authentication (vgauth)? [yes] 
[15:48:26]
[15:48:26]
[15:48:26]Detected X server version 1.19.6
[15:48:26]
[15:48:26]
[15:48:26]
[15:48:26]Distribution provided drivers for Xorg X server are used.
[15:48:26]
[15:48:26]Skipping X configuration because X drivers are not included.
[15:48:26]
[15:48:28]Creating a new initrd boot image for the kernel.
[15:48:28]update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic
[15:48:56]   Checking acpi hot plug                                              done
[15:48:56]Starting VMware Tools services in the virtual machine:
[15:48:57]   Switching to guest configuration:                                   done
[15:48:57]   Guest operating system daemon:                                      done
[15:48:57]   VGAuthService:                                                      done
[15:48:57]The configuration of VMware Tools 9.10.0 build-2476743 for Linux for this 
[15:48:57]running kernel completed successfully.
[15:48:57]
[15:48:57]You must restart your X session before any mouse or graphics changes take 
[15:48:57]effect.
[15:48:57]
[15:48:57]You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
[15:48:57]command line.
[15:48:57]
[15:48:57]To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
[15:48:57]file and text copy/paste), you will need to do one (or more) of the following:
[15:48:57]1. Manually start /usr/bin/vmware-user
[15:48:57]2. Log out and log back into your desktop session; and,
[15:48:57]3. Restart your X session.
[15:48:57]
[15:48:57]Enjoy,
[15:48:57]
[15:48:57]--the VMware team
[15:48:57]
[15:49:00]Found VMware Tools CDROM mounted at /media/wulei/VMware Tools. Ejecting device 
[15:49:00]/dev/sr0 ...
[15:49:00]umount: /media/wulei/VMware Tools: target is busy
[15:49:00](In some cases useful info about processes that
[15:49:00]use the device is found by lsof(8) or fuser(1).)
[15:49:00]/usr/bin/eject:卸载 `/media/wulei/VMware Tools'失败
[15:49:00]Eject Failed:  If possible manually eject the Tools installer from the guest 
[15:49:00]cdrom mounted at /media/wulei/VMware Tools before canceling tools install on 
[15:49:00]the host.
[15:49:54]wulei@wulei-virtual-machine:~/vmtools/vmware-tools-distrib$ sudo reboot 

 

安装完成后,设置分辨率,显示Unknown Display

通过xrandr命令查看并设置分辨率即可

搭配一个最终效果图

 

 


版权声明:本文为nailwl原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。