安装vmtool
重新打开虚拟机
提示安装tar程序已经挂载在cd上
[root@atom /]#cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17
drive name: sr0
drive speed: 1
drive # of slots: 1
Can close tray: 1
Can open tray: 1
Can lock tray: 1
Can change speed: 1
Can select disk: 0
Can read multisession: 1
Can read MCN: 1
Reports media changed: 1
Can play audio: 1
Can write CD-R: 1
Can write CD-RW: 1
Can read DVD: 1
Can write DVD-R: 1
Can write DVD-RAM: 1
Can read MRW: 1
Can write MRW: 1
Can write RAM: 1
[root@atom /]#mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only #挂载只读
[root@atom /]#cd /mnt/
[root@atom mnt]#ls
manifest.txt run_upgrader.sh VMwareTools-10.3.10-13959562.tar.gz vmware-tools-upgrader-32 vmware-tools-upgrader-64
[root@atom vmware-tools-distrib]#cp VMwareTools-10.3.10-13959562.tar.gz /home/tom/
[root@atom tom]#tar -zxvf VMwareTools-10.3.10-13959562.tar.gz
[root@atom tom]#cd vmware-tools-distrib/
[root@atom vmware-tools-distrib]#ls
bin caf doc etc FILES INSTALL installer lib vgauth vmware-install.pl
[root@atom vmware-tools-distrib]#vim INSTALL
[root@atom vmware-tools-distrib]#./vmware-install.pl #安装vmtool
[root@atom vmware-tools-distrib]#./vmware-install.pl #这里提示安装过了open-vm-tools
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
The installer will next check if there are any missing kernel drivers. Type yes
if you want to do this, otherwise type no [yes] yes
INPUT: [yes]
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] ^C[root@atom vmware-tools-distrib]#^C #提示有则不安装vmware tools,取消,下面可以直接运行命令
[root@atom vmware-tools-distrib]#vm
vmcore-dmesg vm-support vmware-namespace-cmd vmware-user-suid-wrapper
vmhgfs-fuse vmtoolsd vmware-rpctool vmware-vgauth-cmd
vmmouse_detect vmware-checkvm vmware-toolbox-cmd vmware-vmblock-fuse
vmstat vmware-hgfsclient vmware-user vmware-xferlogs
虚拟机存储压缩
[root@atom vmware-tools-distrib]#vmware-toolbox-cmd disk list #下面说shrink disk 不管用,可能是使用了分配好的磁盘或者快照等
Shrink disk is disabled for this virtual machine.
Shrinking is disabled for linked clones, parents of linked clones,
pre-allocated disks, snapshots, or due to other factors.
See the User's manual for more information.
那么下面要去删除掉快照才能进行虚拟机磁盘压缩。(因为我的虚拟机前期配置的比较个性化,快照比较有用,所以先克隆了虚拟机当前状态为副本来做压缩。)
[root@atom ~]#vmware-toolbox-cmd disk list
/
/boot
[root@atom ~]#vmware-toolbox-cmd disk shrink /
Please disregard any warnings about disk space for the duration of shrink process.
Progress: 100 [===========>]
Disk shrinking complete.
结束后,压缩一半多的空间。
空间不足
当前操作目录的空间不够,换个剩余空间大的目录。
打开父虚拟磁盘
我这里是空间不足导致删除快照出错,网上解决办法是再创一个快照,然后成功删除则解决问题。
克隆时出错
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager -R "E:\vsys_file\Centos_7\CentOs7.0-000001.vmdk"
The virtual disk, 'E:\vsys_file\Centos_7\CentOs7.0-000001.vmdk', was corrupted and has been successfully repaired.
C:\Program Files (x86)\VMware\VMware Workstation>
虚拟机文件目录下有 .scoreboard
由vmx进程生成的某种统计信息文件,在vmx配置中禁用后,可以删除它。
vmx.scoreboard.enabled = "FALSE"