VMware Player 2.0.0-45731 and kernel 2.6.22

After upgrade my Fedora 7 up to kernel 2.6.22 I couldn’t configure VMware Player 2.0.0-45731. The configuration crashed during building of vmnet module:
Building the vmnet module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmnet-only'
make -C /lib/modules/2.6.22.1-41.fc7/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.22.1-41.fc7-i686'
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
/tmp/vmware-config0/vmnet-only/userif.c: In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config0/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘h’
/tmp/vmware-config0/vmnet-only/userif.c:630: error: ‘const struct sk_buff’ has no member named ‘nh’
/tmp/vmware-config0/vmnet-only/userif.c:636: error: ‘const struct sk_buff’ has no member named ‘h’
make[2]: *** [/tmp/vmware-config0/vmnet-only/userif.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.22.1-41.fc7-i686'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmnet-only'
Unable to build the vmnet module.

Thanks to Philipp Baer who did a patch for VMWare Workstation 6.0 which works for VMware Player 2.0.0-45731 as well. To solve the problem do following:

  • Untar vmnet.tar to temporary directory:
    $ tar xfv /usr/lib/vmware/modules/source/vmnet.tar -C /tmp/
  • Download the patch:
    $ wget -P /tmp http://npw.net/~phbaer/vmware-workstation-6.0_linux-kernel-2.6.22.patch
  • Apply the patch:
    $ CD /tmp/vmnet-only
    $ patch -p1 < ../vmware-workstation-6.0_linux-kernel-2.6.22.patch $ CD ../
  • Put patched sources back into archive
    $ tar vzcf vmnet.tar vmnet-only
    and copy to the VMWare module source directory

    $cp vmnet.tar /usr/lib/vmware/modules/source/

  • Run VMWare configuration script:
    $ vmware-config.pl

Google Desktop now on Linux

Recently Google announced a Linux version of its Desktop. It allows to search in local files and internet from one interface. Google Desktop supports many types of files such documents, images, music etc (it takes information from service data I guess). Moreover, you can make a search in your search history (sounds funny – search in the search, but I use that feature often) and GMail. Full list of features is available here.

Google Desktop is multilingual application. So, you may use it with your native language. Google Desktop for Linux can be downloaded from here.

A day without X

Here is an interesting experience of using console applications only. As you may see everything can be done without GUI:

Personally, I use VIM and Midnight Commander everyday, links – time to time. I used mutt before I moved to Thunderbird. I was really surprised by playing music and video in the console mode. A Window Management system Twin also looks cool!

Print from Linux via Samba

Recently I faced with problem of printing from the Linux server to the printer connected to the Windows PC via USB. So, here is a brief how to do it using CUPS.
1. Type http://localhost:631/ in your browser to open CUPS web interface and go to “Add new printer” page.
2. For device choose “Windows Printer via SAMBA”. If this options isn’t presented in the drop down list run following command as root:
ln -s `which smbspool` /usr/lib/cups/backend/smb
3. Device URI type in following format:
smb://win_user:win_pass@win_domen/win_PC/printer_name
4. Choose appropriate driver for your printer. I didn’t find my model in the list. So, I chose one from Generic:
Generic -> Generic PCL 6/PCL XL Printer Foomatic/pxlmono
For more information, please refer to OpenPrinting database.

See also:

How to print PDF directly to the printer

We use following approach to build print view of documents in our web-based application. At the begging the document template is filled by real data and HTML page is generated. After that this page is sent to HTMLDOC which converts it into PDF. The users open the document via Acrobat plugin installed in the web browser. This approach has worked fine for years.
But recently we decided to send PDF directly to the printer. I’ve added printer to the our server and implemented a simple function (we have a Xerox printer with PostScript support):
lp -d printer_name -o sides=two-sided-long-edge -o media=A4 -o portrait -o page-ranges=1-7 PDF_file
The strange thing appeared right after that. One type of documents couldn’t print anymore. No errors in the CUPS log or on the printer display. The job just disappeared from the queue and was marked as printed. After spending some time I found the way to solve this problem. I use acroread to convert PDF into PostScript and then send it to the printer:
acroread -toPostScript PDF_file
Acroread creates the PostScript file with the same name but with different extension (.ps) and stores it in the current directory. But you can pass desired directory name as second parameter:
acroread -toPostScript PDF_file /store-dir/
I use Acrobat 5 from DAG repository. It works fine even the server doesn’t have installed X. But if you want to use Acrobat 7 you should do additional work. It needs X and if try to run it from command line it give you an error:
(acroread:6488): GTK-WARNING **: cannot open display:
To solve this just install Xvfb – X server that can run on machines with no display hardware and no physical input devices, and run following command:
xinit acroread -toPostScript PDF_file /store-dir/ -- /usr/X11R6/bin/Xvfb :9 -ac

Fedora Core 6 Tips and Tricks

I’d like to introduce for all who use Linux Fedora this excellent set of Fedora Core 6 Tips and Tricks. I found very useful for me tips about installation of mplayer, Macromedia Flash, IEs4Linux and MS TrueType Fonts. I spent only a few minutes to setup good looking, functional work space.
There is a similar manual for Fedora Core 5.

Fedora Core 6 and Acrobat Reader

After I loose my previous work environment I decided to install Fedora Core 6 released last month. It looks nice and works faster. But I found a big troubles with using Adobe Acrobat Reader. I downloaded RPM from Adobe site and installed it. But when I tried to open it I saw just continiusly repeated messages:
expr: syntax error
After five minutes of googling I found the solution:

1. Open file /usr/bin/acroread as root

2. Find the row 418
echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'

3. Replace it by
echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]*\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'

4. Find the row 644
MIN_GTK_VERSION="240"

5. Replace it by
MIN_GTK_VERSION="2040"

After this simple patching Acrobat Reader works fine.