[리눅스/Linux] vmware tools 설치
용도) vmware 하이퍼바이저와 Guest OS 간에 필요한 기능 제공 및 성능 개선 등
- 상세한 내용은 최하단 링크 참조
[설치방법 (CentOS 6)]
1) vmware-tools 에 필요한 패키지 설치
yum install perl gcc kernel-devel fuse-libs -y
- fuse-libs 는 호스트와 파일공유를 위한 라이브러리로 설치 필요시 선택할 것
2) vmware-tools 를 가상 CDROM 으로 마운트
- vmware workstation) 메뉴 [VM] → [Install VMware Tools...]
- esxi) 차후 작성예정
3) 압축 해제 후 설치 진행
- Guest OS에서 아래와 같이 진행 (대화식으로 설치가 이루어지므로 기본 경로에 설치할 것이니 엔터만 계속 눌러주면 됨)
[root@centos6 ~]# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@centos6 ~]# ll /mnt
total 54602
-r-xr-xr-x. 1 root root 1941 Jul 31 2022 manifest.txt
-r-xr-xr-x. 1 root root 4943 Jul 31 2022 run_upgrader.sh
-r--r--r--. 1 root root 54056661 Jul 31 2022 VMwareTools-10.3.25-20206839.tar.gz
-r-xr-xr-x. 1 root root 917188 Jul 31 2022 vmware-tools-upgrader-32
-r-xr-xr-x. 1 root root 930632 Jul 31 2022 vmware-tools-upgrader-64
[root@centos6 ~]# tar xzf /mnt/VMwareTools-10.3.25-20206839.tar.gz -C /usr/local/src/
[root@centos6 ~]# cd /usr/local/src
[root@centos6 src]# ll
total 4
drwxr-xr-x. 8 root root 4096 Jul 31 2022 vmware-tools-distrib
[root@centos6 src]# cd vmware-tools-distrib/
[root@centos6 vmware-tools-distrib]# ll
total 160
drwxr-xr-x. 2 root root 4096 Jul 31 2022 bin
drwxr-xr-x. 2 root root 4096 Jul 31 2022 doc
drwxr-xr-x. 5 root root 4096 Jul 31 2022 etc
-rw-r--r--. 1 root root 138990 Jul 31 2022 FILES
lrwxrwxrwx. 1 root root 13 May 19 12:11 INSTALL -> ./doc/INSTALL
drwxr-xr-x. 2 root root 4096 Jul 31 2022 installer
drwxr-xr-x. 14 root root 4096 Jul 31 2022 lib
drwxr-xr-x. 3 root root 4096 Jul 31 2022 vgauth
lrwxrwxrwx. 1 root root 31 May 19 12:11 vmware-install.pl -> ./bin/vmware-uninstall-tools.pl
[root@centos6 src]# ./vmware-install.pl
- 자동기동 파일 등록) /etc/init/vmware-tools.conf
- 서비스 파일) /etc/vmware-tools/services.sh
4) 설치 완료 후 확인
- 설치 완료 후 서비스가 기동 되었는지 확인 (vmtoolsd)
- 서비스 기동이 안된다면 확인
[root@centos6 vmware-tools-distrib]# ps -ef | grep vm
root 12457 1 0 12:18 ? 00:00:00 /usr/sbin/vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse
root 12480 1 0 12:18 ? 00:00:00 /usr/sbin/vmtoolsd
root 12501 1 0 12:18 ? 00:00:00 /usr/lib/vmware-vgauth/VGAuthService -s
root 12834 12820 0 12:18 pts/1 00:00:00 grep vm
[root@centos6 ~]# /etc/vmware-tools/services.sh status
vmtoolsd is running
[설치방법 (CentOS 7 이상)]
1) open-vm-tools 설치
yum install open-vm-tools -y
- 서비스 관리명은 vmtoolsd
- 부팅시 자동기동은 등록됨
[root@centos7 ~]# systemctl status vmtoolsd
● vmtoolsd.service - Service for virtual machines hosted on VMware
Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2023-05-19 05:09:50 KST; 7s ago
Docs: http://github.com/vmware/open-vm-tools
Main PID: 1508 (vmtoolsd)
CGroup: /system.slice/vmtoolsd.service
└─1508 /usr/bin/vmtoolsd
May 19 05:09:50 c79 systemd[1]: Started Service for virtual machines hosted on VMware.
[호스트와 Guest OS간 파일공유]
- 호스트를 이용하여 파일공유를 할 수 있는 방법을 기록해둠
※ 호스트 OS ※
▷ VM 설정 [Options] 탭 → [Shared Folders]
※ Guest OS ※
- vmtools 서비스가 켜져 있어야 하며, 호스트를 마운트함
- 마운트할 디렉토리를 만들고 마운트 시도 (mkdir /mnt/hgfs)
[root@centos6 ~]# mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs
fuse: warning: library too old, some operations may not not work
[root@centos6 ~]# cd /mnt/hgfs/vmshare
[root@centos6 vmshare]# ll
total 0
-rwxrwxrwx. 1 root root 0 May 19 03:48 file1.txt
- 부팅시 자동기동을 하도록 설정한다면 아래와 같이 /etc/fstab 에 등록
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0
[에러 메세지]
- 호스트 공유 디렉토리 연결 불가 (마운트시 vmhgfs-fuse 를 못찾을 경우)
▷ 라이브러리 설치가 안되었으므로, fuse-libs 설치 후 vmtools 재설치
[root@centos6 mnt]# mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs
/bin/sh: vmhgfs-fuse: command not found
▷ 서비스를 기동해서 보면 일부 에러가 남 (Blocking file system)
[root@centos6 vmshare]# /etc/vmware-tools/services.sh stop
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
VGAuthService: [ OK ]
VMware User Agent (vmware-user): [ OK ]
Blocking file system: [ OK ]
Unmounting HGFS shares: [ OK ]
Guest filesystem driver: [ OK ]
VM communication interface socket family: [ OK ]
VM communication interface: [ OK ]
[root@centos6 vmware-tools-distrib]# /etc/vmware-tools/services.sh start
Checking acpi hot plug [ OK ]
Starting VMware Tools services in the virtual machine:
Switching to guest configuration: [ OK ]
VMware Automatic Kmods: [ OK ]
VM communication interface: [ OK ]
VM communication interface socket family: [ OK ]
Blocking file system: [FAILED]
Guest operating system daemon: [ OK ]
VGAuthService: [ OK ]
- 호스트 공유 디렉토리 연결 불가 (마운트시 cannot open conntection 발생)
▷ 호스트에 공유 설정이 안되어 있으므로 설정할 것
[root@centos6 mnt]# mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs
Error -107 cannot open connection!
[주요 명령어 정리]
vmtools 서비스 기동 | /etc/vmware-tools/services.sh start |
vmtools 서비스 정지 | /etc/vmware-tools/services.sh stop |
vmtools 서비스 확인 | /etc/vmware-tools/services.sh status |
open vm tools 서비스 기동 | systemctl start vmtoolsd |
open vm tools 서비스 정지 | systemctl stop vmtoolsd |
open vm tools 서비스 확인 | systemctl status vmtoolsd |
linux) 호스트 파일 공유 (수동 마운트) | mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs |
windows) 호스트 파일 공유 (수동 마운트) | \\vmware-host\Shared Folders |
vmtools 삭제 | /usr/bin/vmware-uninstall-tools.pl |
open vm tools 삭제 | yum remove open-vm-tools |
업데이트) 2023.05.19
참고링크)