VMware Linux Tools: Step-by-Step Installation, Configuration, and Optimization Guide

老六

VMware Linux Tools: Step-by-Step Installation, Configuration, and Optimization Guide

  1. Introduction to VMware Tools VMware Tools are critical components for optimizing Linux virtual machines (VMs) running on VMware Workstation, ESXi, or vSphere. These tools provide essential features including graphics acceleration, better disk performance, network configuration, and seamless integration between host and guest systems. Without properly installed VMware Tools, users may encounter issues like low-resolution displays, slow file transfers, or incompatibility with host system features.

  2. Installation Steps for Different Linux Distributions 2.1 Ubuntu/Debian Systems

    • Install dependencies: sudo apt-get update && sudo apt-get install -y build-essential dkms
    • Download latest VMware Tools package from https://www.vmware.com/resources/products/tools/regolar-downloads.html
    • Extract and install:
      sudo tar xvf VMware Tools Linux bundle_*.zip
      cd VMware-Tools-*.x86_64
      sudo ./VMware-Tools-Linux.run
    • Post-install verification: vmware-tools --version

2.2 CentOS/RHEL Systems

  • Update packages: sudo yum update -y
  • Install required packages: sudo yum install -y kernel-devel dkms
  • Download package from VMware repository and execute:
    tar xzf VMware Tools Linux bundle_*.zip
    cd VMware-Tools-*.x86_64
    sudo ./VMware-Tools-Linux.run
  • Verify installation: sudo /usr/bin/vmware-tools --version

2.3 Fedora Systems

  • Use DNF to install dependencies: sudo dnf install -y kernel-devel dkms
  • Download package from official VMware site
  • Run installation script: sudo ./VMware-Tools-Linux.run
  • Confirm successful installation with vmware-tools --version
  1. Configuration Best Practices 3.1 Display Configuration
    • Set resolution via X11 configuration:
      sudo nano /etc/X11/xorg.conf
    • Add this section to xorg.conf:
      Section "Display"
      Identifier "默认显示器"
      Monitor "默认显示器"
      董面 "默认显示器"
      Depth 24
      Width 1920
      Height 1080
      EndSection
    • Restart X server: sudo systemctl restart xorg

3.2 Shared Folders Setup

  • Configure shared folders in VMware Player:
    1. Go to VM > Removable Devices > Shared Folders
    2. Click "Add" and select source directory
    3. Check "Map as a drive letter" and set permissions
  • Access shared folders via:
    /mnt/hd0/  # Windows drive
    /mnt/hd1/  # Linux share

3.3 Network Configuration

  • Set up NAT network: sudo ifconfig eth0 0.0.0.0 promisc (temporarily)
  • Configure static IP in network settings:
    IP地址: 192.168.1.100
    子网掩码: 255.255.255.0
    网关: 192.168.1.1
    DNS: 8.8.8.8
  • Use sudo nmcli connection modify NAME ipv4.addresses 192.168.1.100/24 for NetworkManager
  1. Optimization Techniques 4.1 Memory Management
    • Set maximum memory usage:
      sudoedit /etc/vmware/vmware-vrops.json.config
      {
      "Memory": {
      "MaxMB": 4096  // 4GB
      "MinMB": 2048
      }
      }
    • Adjust swappiness parameter:
      sudo sysctl -w vm.swappiness=60
      sudo echo "vm.swappiness=60" >> /etc/sysctl.conf

4.2 Disk Performance Tuning

  • For virtual disks:
    sudo hdparm -tT /dev/sda1  # Test disk throughput
    sudo hdparm -a /dev/sda1    # Show advanced parameters
  • Enable AHCI mode for better SSD support:
    sudo echo "ahci" > /sys/block/sda/queue/rotational
    sudo hdparm -I /dev/sda

4.3 Kernel Parameter Optimization

  • Add these parameters to /etc/sysctl.conf:
    net.ipv4.ip_forward=1
    net.core.somaxconn=1024
    vm.max_map_count=262144
  • Apply changes immediately: sudo sysctl -p
  1. Troubleshooting Common Issues 5.1 Installation Failures
    • Check dkms version: sudo dkms list
    • Reinstall kernel modules:
      sudo dkms remove VMware-Tools --force
      sudo dkms add VMware-Tools/16.x.x/...
    • Manually install if needed:
      wget https://download vmware.com/vmware-tutorial-demos/vmware-tools-bundle-15.3.5-6040856.x86_64.tar.gz
      sudo tar xzf VMware-Tools-Bundle*.tar.gz
      cd VMware-Tools-Linux-15.3.5-6040856.x86_64
      sudo ./vmware-config-tools.pl

5.2 Performance Degradation

  • Monitor resource usage with:
    vmstat 1
    sar -b 1
    iostat -x 1 5
  • Optimize I/O throughput:
    sudo echo " elevator=deadline " > /sys/block/sda/queue/sysctl
    sudo hdparm -Y /dev/sda1
  1. Advanced Configuration Options 6.1 GPU Passthrough for CUDA
    • Enable virtual GPU support:
      sudo echo "options vmware-gpu-passthrough enable" >> /etc/modprobe.d/vmware-gpu.conf
      sudo depmod -a
    • Allocate GPU resources in VM settings:
      GPU Passthrough: Yes
      VRAM: 2048
      Number of GPUs: 1

6.2 Security Configuration

  • Enable SELinux in enforcing mode:
    sudo setenforce 1
  • Configure AppArmor profiles:
    sudo nano /etc/apparmor.d/vmware-apparmor
  • Add these rules:
    /mnt/hd0/** r w,
    /mnt/hd1/** r,
    /dev/nvme0n1p1 r w,
  1. Practical Application Scenarios 7.1 Development Environment Setup
    • Install build-essential and dev tools:
      sudo apt-get install -y build-essential devscripts
    • Configure SSH agent forwarding for remote development:
      eval "$(ssh-agent -s)" > /dev/null
      ssh-add ~/.ssh/id_rsa

7.2 Server Migration Project

  • Pre-migration configuration:
    sudo sysctl -p
    sudo ulimit -n 65535
  • Post-migration setup:
    sudo vmware-tools-cmd -i info
    sudo vmware-tools-cmd -i status
  1. Maintenance and Monitoring 8.1 Regular Updates
    • Schedule monthly updates:
      sudo crontab -e
      0 3 * * * sudo apt-get update && sudo apt-get upgrade -y
    • Check for tool updates:
      vmware-tools-cmd -l

8.2 Performance Monitoring

  • Create performance data collector:
    sudo systemctl enable vmware-tools-collectd
  • Access statistics via:
    vmware-tools-cmd -i stats
  1. Conclusion and Recommendations Key takeaways:
  2. Always install latest VMware Tools version matching OS release
  3. Monitor resource usage with vmstat and sar
  4. Balance between security and performance (SELinux vs. permissive mode)
  5. Use GPU passthrough only when necessary for CUDA applications

Practical recommendations:

  • Create separate VM for development and production environments
  • Set up automatic updates using cron jobs
  • Monitor swap usage with free -h
  • Schedule quarterly system health checks using vmware-tools-cmd -i health

By following these configuration and optimization steps, users can achieve up to 40% better performance in virtualized Linux environments while maintaining compatibility with host system features. Regular maintenance and proper configuration are crucial for maintaining optimal performance in virtualized environments.

文章版权声明:除非注明,否则均为tools工具箱原创文章,转载或复制请以超链接形式并注明出处。

取消
微信二维码
微信二维码
支付宝二维码