บันทึกกันลืม #3 : วิธี Patch Kernel 3 สำหรับ vmware player บน ubuntu

จดไว้กันลืม เผื่อเว็บต้นฉบับหาย ฮ่าาาาา

 

How to patch VMware Player/Workstation for Linux 3.x

1. Uninstall VMware Player or Workstation, and rm -rf /usr/lib/vmware/modules/source (or if you backed up the original source .tar files, restore them now and delete any patched xxx-only directories)
2. Install VMware Player 3.1.4 or Workstation 7.1x (unless you have restored original source .tar files and deleted the prior xxxx-only directories), but don’t try to run it yet.
3. Fix the issue with the kernel nomenclature change from 2.6.x to 3.x as follows in a user terminal:

Code:
sudo sed 's/\x83\xe8\x03\x83\xf8\x01\x0f\x96\xc0/\x83\xe8\x02\x83\xf8\x01\x0f\x96\xc0/' -i /usr/lib/vmware/lib/libvmware-modconfig-console.so/libvmware-modconfig-console.so
Code:
sudo sed 's/\x83\xe8\x03\x83\xf8\x01\x0f\x96\xc0/\x83\xe8\x02\x83\xf8\x01\x0f\x96\xc0/' -i /usr/lib/vmware/lib/libvmware-modconfig.so/libvmware-modconfig.so

4. Download the vmware2.6.39patchv3.tar.bz2 patch from here, extract and untar it (disregard/delete the script “patch-modules_2.6.39.sh” — we do not use it).  Note that the actual patch name is vmware2.6.39fixedv3.patch.
5. Download the patch3031vmware741.patch file (link named “vmware fix for 3.1″) from here
6. Open terminal, and change directory to /usr/lib/vmware/modules/source
7. Issue “ls”.  You should see the following 5 files (and nothing else):

Code:
vmblock.tar   vmci.tar   vmmon.tar   vmnet.tar   vsock.tar

8. At this point you need to change to root with “sudo su”.  Then issue

Code:
for i in ./*.tar; do tar -xvf $i; done

to untar the five .tar files.  Each one will extract into a new directory with “-only” as the directory name suffix.  When you are finished you should have, in addition to the original .tar files, the following new directories:

Code:
vmblock-only   vmci-only   vmmon-only   vmnet-only   vsock-only

9. Next, back up the original source .tar files with

Code:
for i in ./*.tar; do mv $i $i.orginal; done

10. Now copy both downloaded patch files to the current directory /usr/lib/vmware/modules/source, and “chmod +x …” each file to make it executable
11. Now issue the command (the character after “-p” is the numeral one, not the letter L)

Code:
patch -p1 < vmware2.6.39fixedv3.patch

It should run to completion with no error output — this replaces selected files in the -only directories.
12. Next issue the command

Code:
patch -p1 < patch3031vmware741.patch

which patches vmnet-only/compat_netdevice.h and should return no error
13. Next, “tar cvf” all of the files in the vxxx-only subdirectories.  So, for example,

Code:
tar cvf vmblock.tar vmblock-only/*

and do this for each of the 5 vxxx-only directories.
14. You are done — exit the terminal, and you can launch VMware Player now and the 3.0 kernel modules will build. When you start a VM, you will see a warning about “this version of the Linux kernel is too new”, but it does not affect the running VM (tested WinXP, Win7, and Kubuntu).

p.s.  This is put together from parts found in 3 different locations (Arch forum, VMware forum, & weltall.heliohost.org).

 

ที่มา : http://kubuntuforums.net/forums/index.php?topic=3118191