2013년 6월 5일 수요일

Xen 4.3 RC1 installation

I'd like to share how to install Xen 4.3 RC (Release Candidate) as part of a testing on Xen test day. I freshly installed Ubuntu 12.04 on my physical machine.

Xen source is able to download from git repository or tarball.

# download xen source from git repository
$ mkdir ~/xen-4.3
$ cd ~/xen-4.3
$ git clone -b 4.3.0-rc1 git://xenbits.xen.org/xen.git
Cloning into 'xen'...
remote: Counting objects: 271307, done.
remote: Compressing objects: 100% (59143/59143), done.
remote: Total 271307 (delta 213525), reused 263420 (delta 207531)
Receiving objects: 100% (271307/271307), 53.31 MiB | 748 KiB/s, done.
Resolving deltas: 100% (213525/213525), done.
Note: checking out '4de97462d34f7b74c748ab67600fe2386131b778'.
If you not familiar with git, you can download tarball source
$ wget http://bits.xensource.com/oss-xen/release/4.3.0-rc1/xen-4.3.0-rc1.tar.gz
--2013-05-08 17:55:22--  http://bits.xensource.com/oss-xen/release/4.3.0-rc1/xen-4.3.0-rc1.tar.gz
Resolving bits.xensource.com (bits.xensource.com)... 63.80.4.58, 63.80.4.218
Connecting to bits.xensource.com (bits.xensource.com)|63.80.4.58|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16375588 (16M) [application/x-gzip]
Saving to: `xen-4.3.0-rc1.tar.gz'

34% [=================>                                   ] 5,670,832    468K/s  eta 25s
Installing build tools and related modules.
$ sudo apt-get install build-essential

$ sudo apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif 
$ sudo apt-get install texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial
$ sudo apt-get install make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg-dev
$ sudo apt-get install iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml ocaml-findlib libx11-dev bison flex xz-utils libyajl-dev gettext markdown
$ sudo apt-get install libpixman-1-0 libpixman-1-dev 
$ sudo apt-get install libc6-dev*
Confuging the environment for installing.
$ sudo ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
Will build the following subsystems:
  xen
  kernels
  tools
  stubdom
  docs
configure: creating ./config.status
config.status: creating ./config/Toplevel.mk
=== configuring in tools (/downloads/xen-4.3.0-rc1/tools)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
...
checking for fig2dev... /usr/bin/fig2dev
checking for pod2man... /usr/bin/pod2man
checking for pod2html... /usr/bin/pod2html
checking for pod2text... /usr/bin/pod2text
checking for markdown... /usr/bin/markdown
configure: creating ./config.status
config.status: creating ../config/Docs.mk
To build all subsystems, use "dist" and then run "make install" to install xen.
################
# Build Xen
################
$ sudo make dist
make -C xen install
make[1]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
make -f Rules.mk _install
make[2]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
make -C tools
make[3]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
[ -d figlet ] && make -C figlet
make[4]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
gcc -o figlet figlet.c
make[4]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
make symbols
make[4]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
gcc -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -Wdeclaration-after-statement -o symbols symbols.c
make[4]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
make[3]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
make -f /home/yeonki/xen-4.3/xen/xen/Rules.mk include/xen/compile.h
make[3]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
make -C tools
make[4]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
[ -d figlet ] && make -C figlet
make[5]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
make[5]: `figlet' is up to date.
make[5]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
make symbols
make[5]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
make[5]: `symbols' is up to date.
make[5]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
make[4]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
 __  __            _  _    _____                    _        _     _
 \ \/ /___ _ __   | || |  |___ /    _   _ _ __  ___| |_ __ _| |__ | | ___
  \  // _ \ '_ \  | || |_   |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
  /  \  __/ | | | |__   _| ___) |__| |_| | | | \__ \ || (_| | |_) | |  __/
 /_/\_\___|_| |_|    |_|(_)____/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
...
make[1]: Leaving directory `/home/yeonki/xen-4.3/xen/docs'
install -d -m0755 -p /home/yeonki/xen-4.3/xen/dist/
install -m0644 -p ./COPYING /home/yeonki/xen-4.3/xen/dist
install -m0644 -p ./README /home/yeonki/xen-4.3/xen/dist
install -m0755 -p ./install.sh /home/yeonki/xen-4.3/xen/dist

################
# Install Xen
################
$ sudo make install
make -C xen install
make[1]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
make -f Rules.mk _install
make[2]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
make -C tools
make[3]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
[ -d figlet ] && make -C figlet
make[4]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
make[4]: `figlet' is up to date.
make[4]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools/figlet'
make symbols
make[4]: Entering directory `/home/yeonki/xen-4.3/xen/xen/tools'
make[4]: `symbols' is up to date.
make[4]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
make[3]: Leaving directory `/home/yeonki/xen-4.3/xen/xen/tools'
make -f /home/yeonki/xen-4.3/xen/xen/Rules.mk include/xen/compile.h
make[3]: Entering directory `/home/yeonki/xen-4.3/xen/xen'
 __  __            _  _    _____                    _        _     _
 \ \/ /___ _ __   | || |  |___ /    _   _ _ __  ___| |_ __ _| |__ | | ___
  \  // _ \ '_ \  | || |_   |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \
  /  \  __/ | | | |__   _| ___) |__| |_| | | | \__ \ || (_| | |_) | |  __/
 /_/\_\___|_| |_|    |_|(_)____/    \__,_|_| |_|___/\__\__,_|_.__/|_|\___|
...
set -x; make -C figs
+ make -C figs
make[2]: Entering directory `/home/yeonki/xen-4.3/xen/docs/figs'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/yeonki/xen-4.3/xen/docs/figs'
rm -rf //usr/local/share/doc/xen
install -d -m0755 -p //usr/local/share/doc/xen
install -d -m0755 -p //usr/local/share/man
cp -R man1 //usr/local/share/man
cp -R man5 //usr/local/share/man
[ ! -d html ] || cp -R html //usr/local/share/doc/xen
make[1]: Leaving directory `/home/yeonki/xen-4.3/xen/docs'
Xen is successfully installed. The next is to check whether xen boot files has created in /boot/ directory.
ls -al /boot/xen*
lrwxrwxrwx 1 root root       19 Jun  5 15:50 /boot/xen-4.3.gz -> xen-4.3-unstable.gz
-rw-r--r-- 1 root root   821559 Jun  5 15:50 /boot/xen-4.3-unstable.gz
lrwxrwxrwx 1 root root       19 Jun  5 15:50 /boot/xen-4.gz -> xen-4.3-unstable.gz
lrwxrwxrwx 1 root root       19 Jun  5 15:50 /boot/xen.gz -> xen-4.3-unstable.gz
-rw-r--r-- 1 root root 14012010 Jun  5 15:50 /boot/xen-syms-4.3-unstable

# Execute update-grub
$ sudo update-grub
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
dpkg: warning: version 'syms-4.3-unstable' has bad syntax: version number does not start with digit
dpkg: warning: version '/boot/xen.gz' has bad syntax: version number does not start with digit
dpkg: warning: version 'syms-4.3-unstable' has bad syntax: version number does not start with digit
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
dpkg: warning: version 'syms-4.3-unstable' has bad syntax: version number does not start with digit
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /memtest86+.bin
done

# When run "update-grub", an error was occurred. 
# To fix this, remove xen-syms-4.3-unstable and xen.gz
$ sudo rm /boot/xen-syms-4.3-unstable
$ sudo rm /boot/xen.gz

# Re-run update-grub
$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /memtest86+.bin
done

#################################
# Register xen moduels as service
#################################
$ sudo update-rc.d xencommons defaults 19 18
update-rc.d: warning: xencommons start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (2 3 5)
Adding system startup for /etc/init.d/xencommons ...
   /etc/rc0.d/K18xencommons -> ../init.d/xencommons
   /etc/rc1.d/K18xencommons -> ../init.d/xencommons
   /etc/rc6.d/K18xencommons -> ../init.d/xencommons
   /etc/rc2.d/S19xencommons -> ../init.d/xencommons
   /etc/rc3.d/S19xencommons -> ../init.d/xencommons
   /etc/rc4.d/S19xencommons -> ../init.d/xencommons
   /etc/rc5.d/S19xencommons -> ../init.d/xencommons

$ sudo update-rc.d xendomains defaults 21 20
update-rc.d: warning: xendomains start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (2 3 5)
Adding system startup for /etc/init.d/xendomains ...
   /etc/rc0.d/K20xendomains -> ../init.d/xendomains
   /etc/rc1.d/K20xendomains -> ../init.d/xendomains
   /etc/rc6.d/K20xendomains -> ../init.d/xendomains
   /etc/rc2.d/S21xendomains -> ../init.d/xendomains
   /etc/rc3.d/S21xendomains -> ../init.d/xendomains
   /etc/rc4.d/S21xendomains -> ../init.d/xendomains
   /etc/rc5.d/S21xendomains -> ../init.d/xendomains

$ sudo update-rc.d xen-watchdog defaults 22 23
update-rc.d: warning: xen-watchdog start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (2 3 5)
Adding system startup for /etc/init.d/xen-watchdog ...
   /etc/rc0.d/K23xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc1.d/K23xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc6.d/K23xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc2.d/S22xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc3.d/S22xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc4.d/S22xen-watchdog -> ../init.d/xen-watchdog
   /etc/rc5.d/S22xen-watchdog -> ../init.d/xen-watchdog

#################################
# rebooting boot with xen
#################################
$ cat /boot/grub/grub.cfg | grep Xen
submenu "Xen 4" {
menuentry 'Ubuntu GNU/Linux, with Xen 4 and Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4 ...'
menuentry 'Ubuntu GNU/Linux, with Xen 4 and Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4 ...'
submenu "Xen 4.3" {
menuentry 'Ubuntu GNU/Linux, with Xen 4.3 and Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4.3 ...'
menuentry 'Ubuntu GNU/Linux, with Xen 4.3 and Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4.3 ...'
submenu "Xen 4.3-unstable" {
menuentry 'Ubuntu GNU/Linux, with Xen 4.3-unstable and Linux 3.2.0-23-generic' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4.3-unstable ...'
menuentry 'Ubuntu GNU/Linux, with Xen 4.3-unstable and Linux 3.2.0-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os --class xen {
        echo    'Loading Xen 4.3-unstable ...'


$ sudo vi /etc/default/grub
...
GRUB_DEFAULT='Ubuntu GNU/Linux, with Xen 4.3 and Linux 3.2.0-23-generic'
..

$ sudo update-grub
$ sudo boot

References:
1. http://wiki.xen.org/wiki/Archived/Xen_4.3_RC1_test_instructions
2. http://wiki.xen.org/wiki/Compiling_Xen_From_Source
3. http://locatrix.com/build-and-install-xen-4-2-1-from-source-on-ubuntu-12-10/
4. http://blog.heidt.biz/blog/2012/09/17/setting-up-ubuntu-12-dot-04-precise-pangolin-as-xen-dom0/
5. http://lists.xen.org/archives/html/xen-users/2013-05/msg00136.html

댓글 2개:

  1. Hi Yeonki

    To build Xen 4.2.1 on Ubuntu 12.04, I use 'make deb'. It builds the dist and a .deb package, easier to install/uninstall on Ubuntu with dpkg. Do You know if this still works this way on Xen 4.3?

    Thanks, your article is very good.

    Marcond

    답글삭제
  2. Hi, Marcond.
    Thanks for comment.
    4.3 is still in RC. This means it is unstable and needs time for testing and bug fixes. After this time, in my opinion, it will provide easier way of installing Xen 4.3 like you mentioned.

    Regards,
    Yeonki

    답글삭제