BLFS‎ > ‎

10. Virtualization

created : 2010-02-23   updated : 2010-02-23
 

Introduction

Recalled that I have been building the BLFS system inside virtual box.  Why would I want virtualization inside virtualization ?
The rationale behind is that a virtual machine can become a physical one through the process of 'realization'.  One of the technique has been shown in the page BLFS->USB boot.
 
This section will describe the process of compiling VirtualBox inside BLFS.
 
Download source :
Check this link for building instructions copied from the official VirtualBox site.
 
 

Requirements

 
GCC 3.3.3 or later (except for the GCC 4.0.x series). GCC 4.4.1 is recommended.
 
Check version :
gcc --version | head -n1
 
Result :
gcc (GCC) 4.4.1
 
 
as86 (real mode assembler, usually part of the dev86 or bin86 package.)
 
Check version :
as -version | head -n 1

Result :
GNU assembler (GNU Binutils) 2.19.1
bcc (Bruce Evans C Compiler; often part of the dev86 package)
Check version :
bcc
 
Result :
bash: bcc: command not found
Package Dev86 is required.  ref : http://cblfs.cross-lfs.org/index.php/Dev86
 
Get source :
 
Unpack :
tar xvf Dev86src-0.16.17.tar.gz
cd dev86-0.16.17

Build and install :
time {
patch -Np1 -i ../dev86-0.16.17-noelks-1.patch &&
make &&
make install ;
} 2>&1 | tee log.txt
 
 
real    3m27.864s
user    0m0.356s
sys     0m2.584s
Check again :
bcc -v 2>&1 | head -n 1
 
Result :
bcc: version 0.16.17
 
 
IASL (Intel ACPI compiler)
 
Check version :
 
iasl
 
Result :
bash: iasl: command not found
 
 
Unpack :
tar xvf acpica-unix-20100121.tar.gz
cd acpica-unix-20100121/compiler
 
Build and install :
time {
make &&
install iasl /usr/bin ;
} 2>&1 | tee log.txt
 
real    0m48.001s
user    0m0.132s
sys     0m0.632s
 
 
Check again :
iasl 2>&1  | head -n 3 | grep version
 
Result :
ASL Optimizing Compiler version 20100121 [Feb 24 2010]
 
xsltproc (libxslt, XML style sheet processor)
 
Check :
xsltproc --version | head -n 1
 
Result :
Using libxml 20706, libxslt 10122 and libexslt 813
 
libxml2 (required for VBox version >= 1.6, XML file handling)
Already installed. See the IBus page
 
libxslt1 (required for VBox version >= 1.6, XML file transformation)
Already installed. See the XOrg Page
 
libXcursor (required to support color mouse pointers in guest)
Already installed.  See the XOrg page.
 
Qt 4.x.y (with x >= 4), including the OpenGL part
 
 
Unpack :
tar xvf qt-x11-opensource-src-4.4.3.tar.gz
cd qt-x11-opensource-src-4.4.3
 
 
Build and install :
time {
./configure -prefix /opt/qt-4.4.3  \
            -release                 \
            -nomake examples         \
            -nomake demos            \
            -no-separate-debug-info &&
make &&
make install ;
} 2>&1 | tee log.txt
 

real    138m12.183s
user    0m26.002s
sys     1m46.647s
 
Create sym link :
 
ln -v -sfn qt-4.4.3 /opt/qt
 
VirtualBox assumes qt4 can be found in /usr/lib/qt4 
ln -v -sfn /opt/qt-4.4.3 /usr/lib/qt4
 
update /etc/ld.so.conf and /etc/man_db.conf
cat >> /etc/ld.so.conf << "EOF" &&
# Begin qt addition to /etc/ld.so.conf
 
/opt/qt/lib
 
# End qt addition
EOF
ldconfig &&
cat >> /etc/man_db.conf << "EOF"
# Begin qt addition to man_db.conf
 
MANDATORY_MANPATH /opt/qt/doc/man
 
# End qt addition to man_db.conf
EOF
 

Update the PKG_CONFIG_PATH environment variable in your ~/.bash_profile or /etc/profile with the following:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig
 
 
 
 
libIDL
Already installed. (see the firefox page)
 
libSDL
 
Get source :
 
Unpack :
 
tar xvf SDL-1.2.13.tar.gz
cd SDL-1.2.13
 
Build and install :
 
time {
./configure --prefix=/usr &&
make &&
make install &&
install -v -m755 -d /usr/share/doc/SDL-1.2.13/html &&
install -v -m644 docs/html/*.html /usr/share/doc/SDL-1.2.13/html
} 2>&1 | tee log.txt
 
 
real    7m20.012s
user    0m54.807s
sys     5m53.162s
 
PulseAudio (audio backend)
Too many dependencies,  try to by-pass it first.
 
libhal (detect host floppy/DVD)
 
HAL-0.5.12 provides libhal which have the following dependency :
  PCI Utilities-3.1.4
  usbutils-0.84
    libusb-compat-0.1.3
      libusb-1.0.2
 
 
 
Unpack :
tar xvf pciutils-3.1.4.tar.bz2
cd pciutils-3.1.4
 
 
Build and install :
time {
make PREFIX=/usr ZLIB=no &&
make PREFIX=/usr install &&
make PREFIX=/usr install-lib ;
} 2>&1 | tee log.txt
 
real    0m15.320s
user    0m2.040s
sys     0m10.601s
 
Configuration :
use update-pciids periodically to get latest pci.ids data file
require : which and wget
 
 
Unpack source :
tar xvf libusb-1.0.2.tar.bz2
cd libusb-1.0.2
 
Build and install :
time {
./configure --prefix=/usr &&
make &&
make install ;
} 2>&1 | tee log.txt
 
 
real    0m50.840s
user    0m6.632s
sys     0m37.566s

To have raw USB devices set up properly, add the following udev rule.
cat > /etc/udev/rules.d/23-usb.rules << "EOF"
# Set group ownership for raw USB devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
EOF
 
Add any users that need to access raw USB devices to the usb group.
usermod -a -G usb root
 
 

Unpack source :
tar xvf libusb-compat-0.1.3.tar.bz2
cd libusb-compat-0.1.3
 
Build and install :
time {
./configure --prefix=/usr &&
make &&
make install ;
} 2>&1 | tee log.txt

real    0m40.969s
user    0m4.920s
sys     0m31.850s
 
 
Unpack source :
tar xvf usbutils-0.84.tar.gz
cd usbutils-0.84
 
Build and install :
time {
./configure --prefix=/usr --disable-zlib &&
make &&
make install &&
mv -v /usr/sbin/update-usbids.sh /usr/sbin/update-usbids
} 2>&1 | tee log.txt
 
real    0m26.300s
user    0m4.660s
sys     0m18.065s
 
Configuration :
use update-usbids periodically to get latest usb.ids data file
require : which and wget
 
 
 
HAL-0.5.12
Get source :
 
Unpack :
 
tar xvf hal-0.5.12.tar.gz
cd hal-0.5.12
 
Add user :
groupadd -g 19 haldaemon &&
useradd -c "HAL Daemon User" -d /dev/null -u 19 \
        -g haldaemon -s /bin/false haldaemon
 
Build and install :
time {
./configure --prefix=/usr \
            --sysconfdir=/etc \
            --libexecdir=/usr/lib/hal \
            --localstatedir=/var \
            --disable-policy-kit \
            --disable-gtk-doc &&
make &&
make install
} 2>&1 | tee log.txt
 
real    4m58.579s
user    0m42.203s
sys     3m49.178s
 
Install HAL hardware data :
time {
tar -xf ../hal-info-20090414.tar.gz &&
cd hal-info-20090414 &&
./configure --prefix=/usr &&
make install ;
} 2>&1 | tee log.txt
 
real    0m18.405s
user    0m1.840s
sys     0m13.329s
 
 
libcap (CAP_NET_RAW for ICMP sockets in NAT)
 
libcap requires Gperf and Attr
 
Gperf 
Get source :
 
Unpack source :
 
tar xvf gperf-3.0.4.tar.gz
cd gperf-3.0.4
 
Build and install :
time {
./configure --prefix=/usr &&
make &&
make install ;
} 2>&1 | tee log.txt
 
real    0m50.678s
user    0m6.056s
sys     0m40.239s
 
Attr
 
Unpack Source :
tar xvf attr_2.4.43-1.tar.gz
cd attr-2.4.43
 
 
Build and install :
time {
sed -i Makefile \
   -e '/autoconf/d' \
   -e 's@default: $(CONFIGURE)@default:@' &&
sed -i "/AC_OUTPUT/i\AC_PROG_LIBTOOL" configure.in &&
cp -v install-sh{,.orig} &&
libtoolize -f -i &&
cp -vf install-sh{.orig,} &&
aclocal -I m4 &&
autoconf &&
./configure --prefix=/ --exec-prefix=/ --sbindir=/sbin \
  --bindir=/usr/sbin --libdir=/lib --libexecdir=/usr/lib --includedir=/usr/include \
  --mandir=/usr/share/man --datadir=/usr/share &&
make DEBUG=-DNDEBUG LIBTOOL="$PWD/libtool" &&
make LIBTOOL=$PWD/libtool install install-dev install-lib &&
chmod 755 -v /lib/libattr.so.1.1.0 &&
rm -v /lib/libattr.{,l}a
} 2>&1 | tee log.txt
 
real    1m30.643s
user    0m12.797s
sys     1m3.692s
 

Unpack source :
tar xvf libcap-2.17.tar.gz
cd libcap-2.17
 
Build and install :
time {
patch -Np1 -i ../libcap-2.16-build_fix-1.patch &&
make &&
make install &&
chmod -v 755 /lib/libcap.so.2.17 ;
} 2>&1 | tee log.txt
 
real    0m10.376s
user    0m1.088s
sys     0m6.796s
 
(libpcap may not be required, I built it by accident and left it there)
 
Unpack source :
tar xvf libpcap-1.0.0.tar.gz
cd libpcap-1.0.0
 
Build and install :
time {
./configure --prefix=/usr &&
make &&
make install ;
} 2>&1 | tee log.txt
 
real    0m52.449s
user    0m7.648s
sys     0m39.310s
 
python2.5 or python2.6 (Python bindings)
Already installed.  See the firefox page. 
 
 
gsoap (webservice API, version 2.7.9f or higher)
gSOAP-2.7.15
 
Unpack source :
tar xvf gsoap_2.7.15.tar.gz
cd gsoap-2.7
 
Build and install :
time {
./configure --prefix=/usr &&
make &&
make install ;
} 2>&1 | tee log.txt
 
real    5m35.295s
user    1m45.175s
sys     3m34.705s
 
Xmu (for OpenGL)
Already installed.  See Xorg Libraries in the Xorg page. (or search for libXmu in blfs pdf)
 
Mesa (for OpenGL)
Already installed.  See the Xorg page
 
cURL (version 7.16.1 or higher, required for VBox version >= 3.0)
 
cURL-7.19.7

Unpack source :
tar xvf curl-7.19.7.tar.bz2
cd curl-7.19.7

Build and install :
time {
./configure --prefix=/usr &&
make &&
make install &&
find docs -name "Makefile*" -o -name "*.1" -o -name "*.3" | xargs rm &&
install -v -d -m755 /usr/share/doc/curl-7.19.7 &&
cp -v -R docs/* /usr/share/doc/curl-7.19.7
} 2>&1 | tee log.txt
 
 
real    6m8.487s
user    0m42.807s
sys     4m50.214s
 
 
Building VirtualBox
 
Unpack source :
tar xvf VirtualBox-3.1.4-OSE.tar.bz2
cd VirtualBox-3.1.4_OSE

Build and install :
time {
./configure --disable-hardening --disable-pulse &&
source ./env.sh &&
kmk all ;
} 2>&1 | tee log.txt
 
real    69m44.752s
user    9m23.479s
sys     53m44.338s
 
Build virtualBox kernel module :
time {
cd out/linux.x86/release/bin/src &&
make &&
make install ;
cd ..
} 2>&1 | tee log.txt
 
 
real    3m15.809s
user    0m22.441s
sys     2m15.892s
 
Start virtualbox :
 
cd out/linux.x86/release/bin
LD_LIBRARY_PATH=. ./VirtualBox
 
 
 
End
子網頁 (1): Official Build Instruction
Comments