环境: Ubuntu 12.04 (64 bits), Virtualbox 4.2.8源码
首先从https://www.virtualbox.org/wiki/Downloads下载Virtualbox源代码,其官方Wiki上还提供了编译指导:https://www.virtualbox.org/wiki/Linux%20build%20instructions。总体上按指导上一步步来就行,但实际操作中总还是会碰到问题的,下面总结一下:
1. 指导中提到要创建libXTrap.so的软链接,但Ubuntu中压根没有这个文件。根据https://forums.virtualbox.org/viewtopic.php?f=10&t=52734,不用去管它。
2. /home/zjin/source/VirtualBox-4.2.8/src/bldprogs/checkUndefined.sh: following symbols not defined in the files
xxx:
__realpath_chk __memcpy_chk __sprintf_chk
根据https://forums.virtualbox.org/viewtopic.php?f=10&t=54337,创建LocalConfig.kmk,内容为
3.
jni.h: No such file or directory
LocalConfig.kmk中JDK路径没设好,确保VBOX_JAVA_HOME路径下有include/jni.h。
4. 编译tex文件时出错:
! I can't find file `bchr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Transcript written on mfput.log.
! I can't find file `bchr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
根据http://michail.flouris.net/2010/07/using-the-tkiz-package-in-latex-on-rhel5-centos-fc-and-ubuntu-linux/,
$ sudo apt-get install texlive-fonts-recommended
即可解决。