본문 바로가기
Security/[리얼] Linux

리눅스 최신 커널에서 발생하는 vmware 설치에러

by blackcon 2015. 10. 19.
728x90

에러 문구

1. 리눅스 커널 및 vmware 버전

zifan@Z1F4N{~}:uname -a
Linux Z1F4N 3.19.8-ckt6 #3 SMP Mon Oct 19 17:12:48 KST 2015 x86\_64 x86\_64 x86\_64 GNU/Linux
zifan@Z1F4N{~}:vmware -v
VMware Workstation 11.0.0 build-2305329

2. vmware 설치 시 에러 문구

위의 이미지와 같이 vmware 11.0을 설치하게되면 아래의 문구로 경고창이 뜨게됩니다.
(조치 후에 포스팅중이라 캡처본이 없네요..)

"Before you can run VMware, several modules must be compiled and loaded into the running kernel."

3. 해결방법

이 경우는 커널의 버전과 vmware의 헤더와 버전이 맞지않아서 발생하는 에러입니다. 이럴때는 아래와 같이 조치를 하면 끝!

1) 실행 환경

OS: Ubuntu 16.04 LTS
Kernel : Linux bk 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
vmware : VMware Workstation 12.0.0 build-2985596

2) 순서 및 command


원본 : http://ubuntuforums.org/showthread.php?t=2275220
Step 1: log in as root (e.g. sudo -s)
Step 2: Enter your Root password.
Step 3: Enter these commands:


curl http://pastie.org/pastes/9934018/download -o /tmp/vmnet-3.19.patch
cd /usr/lib/vmware/modules/source
tar -xf vmnet.tar
patch -p0 -i /tmp/vmnet-3.19.patch
mv vmnet.tar vmnet.tar.SAVED
tar -cf vmnet.tar vmnet-only
rm -r vmnet-only
vmware-modconfig --console --install-all

3) 발생한 에러 및 조치방법

command

/usr/bin/make -j4 -C /tmp/modconfig-Y4YhUa/vmmon-only auto-build HEADER\_DIR=/lib/modules/4.4.0-21-generic/build/include CC=/usr/bin/gcc IS\_GCC\_3=no

error msg

'vmmon.ko' 타겟에 대한 명령이 실패했습니다

solution

cd /usr/lib/vmware/modules/source
tar xf vmmon.tar
vi ./vmmon-only/linux/driver.c /\* 400번줄 쯤에 아래의 코드가 있고 (-)로 표시된 줄은 지우고, (+)로 된 줄을 추가해 준다. \*/

> \--- vmmon-only/linux/driver.c   2015-11-13 16:56:44.870183155 +0100   
> +++ vmmon-only/linux/driver.c.new   2015-11-13 17:13:18.924228241 +0100   
> @@ -400,9 +400,7 @@   
>  #ifdef VMX86\_DEVEL   
>     unregister\_chrdev(linuxState.major, linuxState.deviceName);   
>  #else   
> \-   if (misc\_deregister(&linuxState.misc)) {   
> \-      Warning("Module %s: error unregistering\\n", linuxState.deviceName);   
> \-   }   
> +   misc\_deregister(&linuxState.misc);   
>  #endif 

mv vmmon.tar vmmon.tar.bak
tar cf vmmon.tar ./vmmon-only
sudo vmware-modconfig --console --install-all
728x90