lost and found ( for me ? )

Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

How to build FreeRadius 3.0.2 from source on Ubuntu 13.10

Here is how to build FreeRadius 3.0.2 from source.

Download the source code from http://freeradius.org/ and build it.

Before building freeradius, install openssl libraries which are required to build radius.

# apt-get install libssl1.0.0 libssl-dev

build freeradius

# tar xzvf freeradius-server-3.0.2.tar.gz
# cd freeradius-server-3.0.2

nn, error

# ./configure
configure: WARNING: talloc headers not found. Use --with-talloc-include-dir=<path>.
configure: error: FreeRADIUS requires libtalloc

# apt-get install libtalloc-dev -y

# ./configure
# make
# make install

Okay, I was able to build radius.

# which radiusd
/usr/local/sbin/radiusd

# /usr/local/sbin/radiusd -v
radiusd: FreeRADIUS Version 3.0.2, for host x86_64-unknown-linux-gnu, built on Apr 16 2014 at 01:09:14

# ls -l /usr/local/etc/raddb/
README.rst         hints              panic.gdb          sites-enabled/
certs/             huntgroups         policy.d/          templates.conf
clients.conf       mods-available/    proxy.conf         trigger.conf
dictionary         mods-config/       radiusd.conf       users
experimental.conf  mods-enabled/      sites-available/  

Compile QEMU-KVM on Linux Mint 12 64bit ver.


Here’s an explanation of how to switch from the KVM installed via apt-get to the KVM building from the source.
I’ve installed the KVM ( kvm , libvirtd , virt-manager ) via apt-get and it works well.

This explanation is:

Use KVM kernel modules installed via apt-get ( kvm , kvm_intel or kvm_amd )
Use qemu-kvm built from the source.
# uname –ri
3.0.0-14-generic x86_64

# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"

# kvm –version  <- installed via apt-get
QEMU emulator version 0.15.0 (qemu-kvm-devel), Copyright (c) 2003-2008 Fabrice Bellard

# libvirtd –version <- installed via apt-get
libvirtd (libvirt) 0.9.2

# virt-manager –version <- installed via apt-get
0.9.0


- the preparation before building qemu-kvm from source

Install the following packages via apt-get to build qemu-kvm.
# LANG=C apt-get install gcc gcc-4.6 libsdl1.2-dev make libz-dev uuid-d
ev libasound2-dev gcc libc6-dev zlib1g-dev linux-headers-3.0.0-14
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'zlib1g-dev' instead of 'libz-dev'
gcc is already the newest version.
gcc-4.6 is already the newest version.
libc6-dev is already the newest version.
make is already the newest version.
zlib1g-dev is already the newest version.
The following extra packages will be installed:
 libaa1-dev libaudio-dev libaudiofile-dev libavahi-client-dev
 libavahi-common-dev libcaca-dev libdbus-1-dev libdrm-dev libesd0-dev
 libgl1-mesa-dev libglu1-mesa-dev libkms1 libncurses5-dev libpulse-dev
 libslang2-dev libtinfo-dev libxt-dev mesa-common-dev
Suggested packages:
 libasound2-doc ncurses-doc
The following NEW packages will be installed:
 libaa1-dev libasound2-dev libaudio-dev libaudiofile-dev libavahi-client-dev
 libavahi-common-dev libcaca-dev libdbus-1-dev libdrm-dev libesd0-dev
 libgl1-mesa-dev libglu1-mesa-dev libkms1 libncurses5-dev libpulse-dev
 libsdl1.2-dev libslang2-dev libtinfo-dev libxt-dev mesa-common-dev uuid-dev
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 5447 kB of archives.
After this operation, 25.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y


Get the latest KVM source ( qemu-kvm-1.0.tar.gz ) from http://sourceforge.net/projects/kvm/files/
# ls
qemu-kvm-1.0.tar.gz


- compile qemu-kvm

qemu-kvm does not include kvm-kmod ( KVM kernel modules )
I use KVM kernel modules which I have installed via apt-get.
# tar xzvf qemu-kvm-1.0.tar.gz
# cd qemu-kvm-1.0/

# ./configure --prefix=/usr/local/kvm
KVM support       yes
# make
# make install

# ls /usr/local/kvm/*
/usr/local/kvm/bin:
qemu-ga  qemu-img  qemu-io  qemu-nbd  qemu-system-x86_64

/usr/local/kvm/etc:
qemu

/usr/local/kvm/share:
qemu

# /usr/local/kvm/bin/qemu-system-x86_64 --version
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard


make sure your OS has loaded KVM kernel modules.
# lsmod | grep kvm
kvm_intel              61643  0
kvm                   383781  1 kvm_intel


- start the VM with qemu-kvm 1.0

I’ve already had the VM ( CentOS 6.2 ) , so I’ll fly this VM with qemu-kvm 1.0.
# /usr/local/kvm/bin/qemu-system-x86_64 -m 1024 -hda /var/disk1/libvirt/images/centos6-vm1.img -monitor telnet::4444,server,nowait -vnc :0 –daemonize


- Connect to the VM via VNC

check the PID of the VM.
# ps aux | grep qemu-system | grep centos
/usr/local/kvm/bin/qemu-system-x86_64 -m 1024 -hda /var/disk1/libvirt/images/centos6-vm1.img -monitor telnet::4444,server,nowait -vnc :0 –daemonize

check the listen ports
# lsof -np 25904 | grep -i tcp
qemu-syst 25904 root    3u  IPv4 2434434         0t0      TCP *:4444 (LISTEN)
qemu-syst 25904 root   14u  IPv4 2432962         0t0      TCP *:5900 (LISTEN)


TCP port 5900 is for VNC access ( -vnc :0 )
TCP port 4444 is for qemu-monitor access. (-monitor telnet::4444,server,nowait )

start VNC viewer
$ vncviewer 127.0.0.1::5900  ( or vncviewer 127.0.0.1:0 )



- access to the qemu monitor via telnet
# telnet 127.1 4444
Trying 127.0.0.1...
Connected to 127.1.
Escape character is '^]'.
QEMU 1.0 monitor - type 'help' for more information
(qemu) info vnc
Server:
    address: 0.0.0.0:5900
       auth: none
Client:
    address: 127.0.0.1:49941
 x509_dname: none
   username: none
(qemu) info version
1.0.0 (qemu-kvm-1.0)
(qemu) info status
VM status: running
(qemu) info kvm
kvm support: enabled
(qemu) system_powerdown
(qemu) Connection closed by foreign host.


- memo

The binary file of qemu-kvm installed via apt-get is /usr/bin/kvm which is the symbolic link file of /usr/bin/qemu-system-x86_64.
# ls –l /usr/bin/kvm  ( install via apt-get )
lrwxrwxrwx 1 root root  /usr/bin/kvm -> qemu-system-x86_64

# ls -l /usr/bin/qemu-system-x86_64 ( install via apt-get )
-rwxr-xr-x 1 root root  /usr/bin/qemu-system-x86_64


The binary file of qemu-kvm built from the source is /usr/local/kvm/bin/qemu-system-x86_64
# ls /usr/local/kvm/bin/qemu-system-x86_64 ( built from the source )
/usr/local/kvm/bin/qemu-system-x86_64