But when I export and engrave it with lilypond it seems like this: As it is seen note positions are not correct. How can I fix this? Is it about TuxGuitar or lilypond? Or what kind of program should I use to write tabs and export it to lilypond easier?
It looks like that TuxGuitar fails to set the proper clef.
Just find the music in the lilypond file and put
\clef "G_8" in front of it. That will do the trick.
Explanation: As Tom_C correctly points out, guitar is written in treble clef but one octave higher than it actually sounds. TuxGuitar apparently just sets a treble clef (or no clef at all, which amounts to the same). The systemic way to handle that is to use a treble clef with a small 8 under it (which says that everything has in fact to be played one octave lower). That's the clef that Lilypond knows under the name of
Setting the proper clef will also make sure that Lilypond will both "know internally" the correct notes and typeset them correctly, too. You could just transpose everything an octave higher; however, if you for instance played the MIDI generated by Lilypond, it would also sound an octave higher than it should.
This is probably linked to : why is guitar music written one octave higher?
An easy fix would be to transpose everything 12 half tones higher but not sure if it easier in Tux or Lilypond...