OpenVZ on Linode - Invalid kernel: elf_xen_note_check
Step 1: Custom kernel
apt-get update
apt-get upgrade --show-upgraded
VERSION="2.6.32-28"
apt-get install linux-image-$VERSION-virtual
mkdir /boot/grub
( echo -e "timeout 5\n" && \
echo -e "title Ubuntu 10.04 LTS, kernel $VERSION-server" && \
echo -e "root (hd0)" && \
echo -e "kernel /boot/vmlinuz-$VERSION-server root=/dev/xvda console=hvc0 ro quiet" && \
echo -e "initrd /boot/initrd.img-$VERSION-server" \
) > /boot/grub/menu.lst
# amend linode configuration
reboot
Step 2: Installation
function replace_in_file {
TMP_FILE=/tmp/replace_in_file.$
sed "s/$1/$2/g" $3 > $TMP_FILE && mv $TMP_FILE $3
}
apt-get update
apt-get upgrade
dpkg-reconfigure dash
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 module-assistant debhelper build-essential
VERSION="2.6.32.28"
apt-get build-dep --no-install-recommends linux-image-$VERSION-server
m-a prepare
kernel-packageconfig
Cores=$(Nr () { echo $#; }; Nr $(grep "processor" /proc/cpuinfo | cut -f2 -d":"))
echo "CONCURRENCY_LEVEL := $(($Cores + 1))" | tee -a /etc/kernel-pkg.conf
cd /usr/src
wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux_2.6.32.orig.tar.gz
wget http://download.openvz.org/kernel/branches/2.6.32/current/patches/patch-feoktistov.1-combined.gz
wget http://download.openvz.org/kernel/branches/2.6.32/current/configs/kernel-2.6.32-x86_64.config.ovz
rm -rf linux-2.6.32
tar -xpf linux_2.6.32.orig.tar.gz
rm -rf "linux-2.6.32-openvz"
mv linux-2.6.32 "linux-2.6.32-openvz"
rm linux
ln -s "linux-2.6.32-openvz" linux
cd /usr/src/linux
gunzip -dc /usr/src/patch-feoktistov.1-combined.gz | patch -p1 --batch
cp -rf "/usr/src/kernel-2.6.32-x86_64.config.ovz" .config
make oldconfig
replace_in_file "all: lguest" "all:" /usr/src/linux/Documentation/lguest/Makefile
make-kpkg --initrd --append-to-version="-openvz" --revision=1 kernel_image kernel_headers
cd /usr/src
ls -l *.deb
dpkg -i linux-image-2.6.32.28-openvz_1_amd64.deb
dpkg -i linux-headers-2.6.32.28-openvz_1_amd64.deb
mkinitramfs -k 2.6.32.28-openvz -o /boot/initrd.img-2.6.32.28-openvz
apt-get install --reinstall grub-pc
update-grub
( echo -e "timeout 5\n" && \
echo -e "title Ubuntu 10.04 LTS, kernel $VERSION-openvz" && \
echo -e "root (hd0)" && \
echo -e "kernel /boot/vmlinuz-$VERSION-openvz root=/dev/xvda console=hvc0 ro quiet" && \
echo -e "initrd /boot/initrd.img-$VERSION-openvz" \
) > /boot/grub/menu.lst
cat > /etc/sysctl.conf << "EOF"
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 1
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
EOF
sysctl -p
apt-get install --no-install-recommends vzctl vzquota vzdump
ln -s /var/lib/vz /vz
reboot
Finally, when I try to reboot my Linode I get this:
Booting 'Ubuntu 10.04 LTS, kernel 2.6.32.28-openvz'
root (hd0)
Filesystem type is ext2fs, using whole disk
kernel /boot/vmlinuz-2.6.32.28-openvz root=/dev/xvda console=hvc0 ro q
uiet
initrd /boot/initrd.img-2.6.32.28-openvz
ERROR Invalid kernel: elf_xen_note_check: ERROR: Will only load images built for the generic loader
or Linux images
xc_dom_parse_image returned -1
Error 9: Unknown boot failure
Press any key to continue...
Any clue, what I could do wrong?
9 Replies
Second, while I'm no expert at loading kernels, there seems to be specific instructions for installing OpenVZ kernels in Xen:
They seem to set a xen-related build parameter, and use a xen-related config file for the build, rather than using a generic kernel. So you might want to try that.
@pclissold:
You need a Xen paravirt-enabled kernel to run on a Linode. OpenVZ expects to run on bare metal and will only run under Xen with hardware-assisted virtualisation, and may well not run properly even then.
No, OpenVZ has a xen paravirt-enabled kernel to do exactly this. It's just that there's very little reason to do so rather than just getting multiple smaller linodes.
here
The guide is for the RHEL5 Linux and looking at it I'm still not sure what I missed in my script.
Did anyone manage to install OpenVZ on the Ubuntu 10.04 LTS (Linode)?
@Daniel Stefaniuk:
I want to use OpenVZ to isolate user accounts as described
. hereThe guide is for the RHEL5 Linux and looking at it I'm still not sure what I missed in my script.
Does anyone managed to install OpenVZ on the Ubuntu 10.04 LTS (Linode)?
Dedicated server will be much more effective for this using. And cost will be almost same.
@OZ:
Dedicated server will be much more effective for this using. And cost will be almost same.
Thanks for the advice. However, it is 5 times more to get the cheapest dedicated server in the location I need than the Linode 512. My server is not very heavily loaded and VPS is good solution for now.
What about other Linux distributions? Did anyone manage to install OpenVZ on Fedora or CentOS?
@Guspaz:
No, OpenVZ has a xen paravirt-enabled kernel to do exactly this. It's just that there's very little reason to do so rather than just getting multiple smaller linodes.
Except cost….
The OP has asked for help and he's being told to either buy lots of seperate Linodes or a dedicated box - sheesh.
Perhaps he doesn't have the money for those things and wants to run his "virtual dedicated" server as he wants to.