Friday, May 20, 2011

Wrong UUID on ubuntu 8.04 after p2v and update

 During p2c with VMware converter of an ubuntu 8.04 server the UUIDs of the disk change with respect to the original UUIDs on the phisical machine.
The converter updates the paths in /boot/grub/menu.lst accordingly.

Unluckily, we found that if the kernel is updated, then debian packages will run "update-ubuntu" script to add an entry in menu.lst, overwriting the UUID changes made by converter and replacing the phisical UUID. This happens because the UUID for root is not read by blkid, but taken from a static line in menu.lst itself, the one beginning with kopts!

To fix this you have to boot by editing grub line and providing the correct UUID or path for root, then edit menu.lst, place the right UUID for root in kopts (find them with blkid), run update-grub.

This will NOT directly fix menu.lst!!! It will create an updated version of PART of menu.lst in

/var/lib/ucf/cache/:var:run:grub:menu.lst:kernel

you have to replace the corresponding kernel image list by manually merging this file and menu.lst.

Thursday, May 12, 2011

looking up MAC addresses of ESX NICs in a network switch

I'm struggling to identify to wich ports on a Ge switch a new ESX host has been connected.
First, I checked esx.conf to identify each virtualMac for each nic, then I asked the network gurus to check them out with fdb. Weirdly, not all the MAC's are in the forwarding db. My next try is to put all the nics as uplinks in a vSwitch, and enable nic teaming with beacon probing: I think the beacons broadcasts will update the fdb for each MAC in the switch: will it work?!? Beacon probing is explained in this article.

Sunday, March 13, 2011

better Freetype fonts in Fedora

libfreetype includes some features that enhance much the apparence of rendered fonts: this features are disabled by default in distros like fedora and ubuntu, due to potential copyright issues. But can be enabled quite simply by recompiling the Freetype package. This is how:

rpm -qi freetype
will output informations about the package and the version of the lib you are using:

Name        : freetype                     Relocations: (not relocatable)
Version     : 2.4.2                             Vendor: Fedora Project
Release     : 4.fc14                        Build Date: Mon 15 Nov 2010 11:20:32 AM CET
Install Date: Sat 12 Mar 2011 12:03:25 PM CET      Build Host: x86-03.phx2.fedoraproject.org
Group       : System Environment/Libraries   Source RPM: freetype-2.4.2-4.fc14.src.rpm
  notice on a 64 bit system you'll probably have both .i686 and .x86_64 versions, as well as the .devel versions. Download the rpm source with yumdownloader:

yumdownloader --source freetype
this will download the .src.rpm, in my case  freetype-2.4.2-4.fc14.src.rpm.
Install the package:

 rpm -ih ./freetype-2.4.2-4.fc14.src.rpm
this will create a directory "rpmbuild" and unpackage the files needed to recompile the whole package. cd to the rpmbuild

cd rpmbuild
now we rebuild the package while enabling the copyrighted features:

rpmbuild --clean -bb --with bytecode_interpreter --with subpixel_rendering --with xfree86 SPECS/freetype.spec

after that you'll find new packages in rpbuild/RPMS/x86_64/ . you can install them with

sudo rpm -Uh RPMS/x86_64/freetype-X.Y.Z-K.fcXX.x86_64.rpm --force
you can also install the devel lib.

Now for the 32 bit libraries, first make sure you have the 32 bit versions of the devel libs needed to recompile:
 [massi@poldon rpmbuild]$ rpm -qa | grep libX11-devel
libX11-devel-1.3.4-3.fc14.x86_64
[massi@poldon rpmbuild]$
Download and install the missing 32 bit package:

 yumdownloader libX11-devel-1.3.4-3.fc14.i686
 sudo rpm -ih libX11-devel-1.3.4-3.fc14.i686

Now recompile the package with target "i686" to produce the 32 bit lib:

 rpmbuild --target i686 --clean -bb --with bytecode_interpreter --with subpixel_rendering --with xfree86 SPECS/freetype.spec
The .rpms will be in RPMS/i686 . Install the 32 bit libraries as you did with the 64 bit ones.
 sudo rpm -ih RPMS/i686/freetype-2.4.2-4.fc14.i686.rpm --force
sudo rpm -ih RPMS/i686/freetype-devel-2.4.2-4.fc14.i686.rpm --force

Now restart X and enjoy truetype fonts with proper rendering and hinting support ;-)






















 

Thursday, April 1, 2010

Troubles browsing from Linux and not from Windows

At some customers or with some friends' adsl connection I have been puzzled to see that I could perfectly surf the web with IE or firefox from a bridged Windows VM but coud not open any site from my linux host.
Recently I was lucky to met a linux guru that explained me why!

This seems to be related to TCP windows scaling .
To fix the problem it is enought to turn it off by doing this as root:

[root@poldon ~]#      cd /proc/sys/net/ipv4
[root@poldon ipv4]# echo "0" > tcp_window_scaling
[root@poldon ipv4]#

Then edit /etc/sysctl.conf and add a line "net.ipv4.tcp_window_scaling = 0" to make the option persistant across reboots.






Many thanks to Graziano for pointing this out to me!

Monday, March 15, 2010

how to check wich db is a vCenter using

To know wich ODBC sources is being used by a vCenter and Update Manager, one needs to check the registry of the windows machine.
After you know the ODBC source, you can open it and see wich db and witch server it is pointing to.

HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VirtualCenter\DB

the same for the update manager. 


source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003928

Thursday, March 11, 2010

error printing from vmware to cups

On my linux machine I use vmware workstation 7.0.1 to run several windows machines. In each I use virtual printing to let the printers I configured on my host machine appear as local printers, without the need to share them throught samba or to configure them on each single vm.

From time to time (after upgrades) my virtual printer ceases to work: when I print from the vm the job fails and in my host machine I get an error from cups "stopping job because the scheduler could not execute a filter"

This seems to be caused by the filter

/usr/lib/cups/filter/thnucups

wich is incorrectly set to permissions "-rwsr-xr-x" instead of 555 "-r-xr-xr-x" as all the others.

to fix the problem, just set the permissions to 555

sudo chmod 555 /usr/lib/cups/filter/thnucups