얼마전 필요에 의해서 VMWare 7.1을 설치하고 우분투 10.10을 게스트OS로 설치했다.
작업할 게 있어서 Win7(호스트OS)의 특정 폴더를 공유 폴더로 설정하고 재부팅...
/mnt/hgfs가 비어 있었다.
vmware-tools 는 당연 설치되어 있었다.
(내가 설치한 것은 아니고 요즘 VMWare가 너무 좋아서 게스트OS설치할때 자동으로 설치된 것이다.)

$ vmware-hgfsclient 제대로 공유폴더를 보여준다.

무슨 문제인지 몰라서 구글링 시작

헛, vmware-tools의 버그란다. 그것도 아주 작은 버그...

출처 : http://blog.naver.com/bestbabo?Redirect=Log&logNo=90025401435
원출처 : http://www.debuntu.org/how-to-vmware-tools-hgfs-module-on-ubuntu-gutsy-gibbon-7.10

At the moment, the vmware-tools provided with workstation 6.0.2 do not compile under Ubuntu Gutsy 7.10.
Only one module fails: vmhgfs. This module allow one to share a folder on the host with the guest.

This tutorial will show the few changes required in order to be able to compile this module, and therefore ease file sharing between the host and the guest.

The original error that one might get while compiling the tools will have the following:

CC [M] /tmp/vmware-config0/vmhgfs-only/filesystem.o
/tmp/vmware-config0/vmhgfs-only/filesystem.c: In function ‘HgfsInitFileSystem':
/tmp/vmware-config0/vmhgfs-only/filesystem.c:582: error: too few arguments to function ‘kmem_cache_create'
/tmp/vmware-config0/vmhgfs-only/filesystem.c:593: error: too few arguments to function ‘kmem_cache_create'

In this tutorial, I will consider that the vmware-tools's .tar.gz is already untarred in your home dir and that user can gain root credential with sudo.

First of all, you need to get in the working directory of vmware-tools:

$ cd ~/vmware-tools-distrib

Then, we will back up the old vmhgfs.tar:

$ mv lib/modules/source/vmhgfs.tar vmhgfs.tar.orig

Now, we untar vmhgfs.tar.orig:

$ tar -xvf vmhgfs.tar.orig

Now edit vmhgfs-only/compat_slab.h:

$ vim vmhgfs-only/compat_slab.h

and change:

if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR)

with

if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR)

Finally, re-tar vmhgfs-only directory in lib/modules/source/vmhgfs.tar:

$ tar -cvf lib/modules/source/vmhgfs.tar vmhgfs-only

Then copy this new tar into /usr/lib/vmware-tools/modules/source/ :

$ sudo cp lib/modules/source/vmhgfs.tar /usr/lib/vmware-tools/modules/source/vmhgfs.tar

That's it, now you can re-run the tools config script:

$ sudo vmware-config-tools.pl



이글에도 사소한 버그가 있었다.
compat_slab.h 는 vmhgfs-only/share/ 밑에 있다.
(이정도는 애교)

어쨋든, 상황종료.

보통 ext3로 포맷을 하게되면, 시간이 무지 오래 걸린다.
지금 하고 있는 프로젝트에서 사용하려고 하니, 하세월이다.

KLDP에 있는 Quick Format은 ext3가 아닌 ext2용 inode를 만들기 때문에, 금방 끝나긴 하지만, ext2로 mount해야한다.
더 좋은 방법(?)은 생성되는 inode의 수를 줄여준다. 물론, 파일을 많이 만들 수는 없다. 하지만 금방 끝난다...

1. e2fsprogs의 소스를 받아서,
2. misc/mke2fs.c의 main()위에 있는 PRS()함수를 찾는다.
3. 거의 아랫부분의 param.s_inodes_count의 값을 계산하기 바로 위에,
4. num_inodes = 1; reserved_ration = 1; 값을 강제적으로 세팅했다.
5. 결론적으로 원래 만들어 져야 할 inode의 수보다 1/512배 만큼의 inode가 만들어진다.

포맷도 빠르고, ext3를 사용할 수 있어서 좋다.
단점은 파일을 많이 만들 수 없다는 것...

+ Recent posts